dramatiq icon indicating copy to clipboard operation
dramatiq copied to clipboard

Missing OpenTelemetry instrumentation

Open staticdev opened this issue 2 years ago • 1 comments

Feature request

Is your feature request related to a problem? When using dramatiq, there is no easy way to instrument it with logs, metrics and traces using OpenTelemetry.

Describe the solution you'd like Add instrumentation similar to it's fork https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/instrumentation/opentelemetry-instrumentation-remoulade

Upstream issue https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1916

staticdev avatar Aug 21 '23 15:08 staticdev

Would you be open to contributions for this PR?

I'm planning on building a similar module to opentelemetry-instrumentation-remoulade for a work related project. Possibly also with Opentelemetry metrics support (similar to what you have with the Prometheus middleware).

If there's quorum for it, I think I can prepare a PR to be merged upstream, and some docs for the project.

Cheers!

octavifs avatar Feb 21 '24 15:02 octavifs

Would you be open to contributions for this PR?

Yup. A PR would be welcome.

Bogdanp avatar Feb 25 '24 06:02 Bogdanp

I think I'd prefer having this in a separate package after all. If anyone makes one, ping me and I'll add a link!

Bogdanp avatar Apr 28 '24 05:04 Bogdanp

Hi Bogdan, I'll reach the opentelemetry guys if I have some time this week. I've got a middleware implemented, for opentelemetry support, with both traces and metrics integrated. Supports retries, etc. as well.

This is a sample from the system I have in production, with the custom keys added on each actor send/process action, showcasing retries opentelemetry-dramatiq-middleware-blanked

As you said, no need to add this to core, a middleware is more than enough. Just need to test out a bit more the metrics implementation and the packaging, so it will only be a pip install away.

I'll post back when I have some updates. Cheers!

octavifs avatar May 05 '24 10:05 octavifs