Integration with existing trace libraries #1062
Replies: 2 comments 5 replies
-
The Moleculer built-in tracing feature is a complete solution like the OpenTelemetry lib. Yeah, Moleculer Tracer doesn't have instrumentation for external libs and I don't plan to add it because it's a big "hacking" job, a lot of time, and doesn't give extra to the framework itself. Instead, my suggestion is to create a Moleculer instrumentation for OpenTelemetry. Similar to what dd-trace does. It can be a middleware (based on the built-in tracing middleware) which wraps the |
Beta Was this translation helpful? Give feedback.
-
I made an OpenTelemetry middleware and a demo Moleculer project which demonstrates my suggestion. It uses B3 propagator which pushes tracing info into https://github.com/icebob/moleculer-opentelemetry-demo The main things are in:
My experiences with OT:
|
Beta Was this translation helpful? Give feedback.
-
Projects like opentelmetry provide prebuilt instrumentation adapters for a whole range of libraries like MySQL, express, cloud SDKs, socket.io etc. It would convenient to use these tools in Moleculer without having to abandon the built-in tracing API provided by the framework.
Perhaps there's a way to share the current trace and span context between Moleculer and another library like OpenTelemetry and allow both to update the trace context.
A better idea might be to have a configurable
SpanFactory
that can create span instances that follow the existing Moleculer API but can use delegate span objects from other frameworks.Beta Was this translation helpful? Give feedback.
All reactions