Skip to content

Conversation

@liamdiprose
Copy link
Contributor

@liamdiprose liamdiprose commented Jan 14, 2026

Hey again,

We've using OpenTelemetry to track our task metrics. We couldn't adapt this metrics adapter to work: https://github.com/DoumanAsh/metrics-opentelemetry so we created this layer.

We'd love for it to be merged upstream. Let me know how I can help it happen.

Cheers,
Liam

Copy link
Member

@geofmureithi geofmureithi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution!

There is only some small changes requested mainly to avoid confusion between job, message, and request. To do so, we prefer to use task as a general term, job for mutable requests and message for immutable requests.

@geofmureithi
Copy link
Member

geofmureithi commented Jan 14, 2026

Also:

  1. You need to rebase as there are some conflicts
  2. Add an entry to the CHANGELOG.md file.

@liamdiprose liamdiprose force-pushed the feature/opentelemetry-metrics branch from 47aae4d to fb2a246 Compare January 14, 2026 21:51
@liamdiprose liamdiprose force-pushed the feature/opentelemetry-metrics branch from fb2a246 to 6d7c832 Compare January 14, 2026 21:53
@liamdiprose
Copy link
Contributor Author

liamdiprose commented Jan 14, 2026

Thank you for clearing up the terminology. I've made the changes you requested and rebased on main.

On the topic of metric names, OpenTelemetry have a catalogue of semantic conventions for choosing metric names. For example, axum-otel-metrics uses the HTTP Semantic Conventions with metric names like http.server.request.duration (the periods are converted to _ by opentelemetry-prometheus for the /metrics endpoint in the example).

There aren't any semantic conventions for task scheduler metrics but the General guidelines recommend we consider prior art when choosing metric names. The Messaging conventions are designed with queues in mind and might fit apalis.

Based on my understanding, we would get these metric names

Prometheus Metric OpenTelemetry Messaging Metric
tasks messaging.client.consumed.messages
task_duration messaging.process.duration

These semantic conventions also come with required attributes. Let me know if this changes your mind on the metric names for the otel layer.

@liamdiprose
Copy link
Contributor Author

Let me know how I can help with the security audit.

Copy link
Member

@geofmureithi geofmureithi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for this contribution

@geofmureithi geofmureithi merged commit 179f0ad into apalis-dev:main Jan 17, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants