Add OpenTelemetry integration #1027
Replies: 2 comments
-
Hello ! It's an excellent initiative, opening this discussion. I'm currently dissatisfied by the current state of observability in Procrastinate. I think investing in making it easier to integrate OpenTelemetry or other tools should definitely be a step in the right direction, for traces, but also metrics and logs (as far as I can tell, there's no code to modify to integrate logs properly, but it's worth testing that autoinstrumentation works well and maybe point to the relevant part of OTel's doc). Of course, this can work be split in multiple parts. I've never played with Open Telemetry before, so it's all very abstract for me, but I'll do my best to answer your questions:
OpenTelemetry in general, yes, though I believe it's probably sane to keep it optional. I believe some people won't have the rest of the infra ready for this.
Let's discuss what we can do in procrastinate so that this is less invasive, whether we decide to ship opentelemetry optional code or just make it easier to people to integrate these kind of libs without commitments to otel in particular.
(damn, I'm answering questions in advance)
I'm perfectly ok with that too, and I'll add multiple steps in between:
That said, for now, I'm ok having live in the contrib section, with potential optional dependencies (
Aha, that's a complex question. I don't know otel enough to know if it's simple or not, so it's hard to say. In procrastinate, we usually try to make things async at core, and use
It's reassuring that I'm not the only one making typos :) Let's keep this discussion moving. It's a bit blurry in my mind so far, and I'll let this sink in a bit. I guess I'd love to gather opinions from other frequent users/occasional contributors and get a sense of how we can work together on this to manage expectations and avoid spending time on some code until we know it's going to get merged. Maybe something that could be cool to better understand this could be to dust off the docker-compose file and setup a small observability stack that would gather logs, metrics, traces in a toy app (such as the Django app in the demos folder). That could also give us a playground for testing an equivalent async stack later. Let us play :) I don't expect an immediate decision but it's an opportunity to evolve the app in a good future-friendly way. |
Beta Was this translation helpful? Give feedback.
-
I'd be keen to see this as it was on my todo list, so +1 from me. One suggestion - it would be useful to go a level higher and wrap the execution of the job so that the job.id can be included in the span attributes (and perhaps also whether the job will retry). |
Beta Was this translation helpful? Give feedback.
-
Hi !
I'm currently evaluating procrastinate for my company as a replacement for Celery and I needed to have an OpenTelemetry integration where a span would be created when a task is deferred and when a task is ran.
Like many other OpenTelemetry integrations it relies on monkey patching, which is not very satisfying to me, but hey "it works™" !
I just wanted to share with you the task middleware that I made in order to discuss about it and have your feedbacks:
django
?procrastinate-opentelemetry
or something) ?Have a nice day 🌴
Beta Was this translation helpful? Give feedback.
All reactions