dd-trace-java
dd-trace-java copied to clipboard
Question: Using OpenTelemetry for custom instrumentation
With OpenTelemetry now having a stable release of their tracing specification. Are there any plans for adopting that over OpenTracing for custom instrumentation? Today I am using the Datadog java agent for auto instrumentation exporting to an agent running in a sidecar.
I would like to add custom trace instrumentation and looking at the Datadog docs it is suggested to use the OpenTracing libraries.
Ideally, I would like to use the OpenTelemetry libraries instead as there is an intention to move to OpenTelemetry for all our instrumentation in the future.
I have looked at using the OpenTelemetry auto instrumentation javaagent coupled with the OpenTelemetry collector exporting to Datadog but unfortunately, the JVM metrics and correlation with infrastructure metrics is not as good as what the Datadog agents provide.
Is this possible? Any advice would be greatly appreciated.
As I mentioned on this comment, the OpenTracing is deprecated, so what are the plans to support Opentelemetry as a way to add custom instrumentation?
We tried to use both, the Open Telemetry Java Agent with Datadog Trace Java Agent, but we had problems with it. Looks like they don't play well together
While it doesn't get done, what we can do to circumvent this limitation?
@reify-marcio-faria As I answered in your other comment, adding support for OpenTelemetry is definitely on our roadmap, but I can't give you any solid dates. The best path forward for now is to stick with using OpenTracing, and use the OpenTelemetry compatibility layer if you want to switch an OpenTelemetry based agent.
Can I ask is there any progress on this topic? If no can you please prioritize the support since it's on your road map?
Hello,
I can confirm OTel is part of our roadmap:
In addition to these, we are currently preparing to roll out:
- Support for OTel runtime metrics.
- Additional improvements to our OTel product and feature support that are under active development, such as 128-bit trace IDs and support for the OpenTelemetry API in Datadog tracers.
I am currently working on it and you can follow the development of the feature from the related PR: #4669
Best, Bruce
You can try using OpenTelemetry for custom instrumentation since 1.10.0 (it keeps improving in 1.11.0 and 1.12.0).
The support is still in progress, so the public documentation is not yet ready for prime time.
As stated in the release note, you can enable it using the DD_TRACE_OTEL_ENABLED=true
flag. You will only need to have the opentelemetry-api
dependency (no sdk nor exporter).