Opentelemetry Datadog integration (TraceId/SpanId issues) #30562
-
I'm trying to convert from using the Datadog java agent to using Quarkus' integrated Opentelemetry. Following the Quarkus docs I have the Traces publishing successfully and Logs are being scraped same as before. I am now trying to enable the Log/Trace correlation but am hitting the issue of incompatible TraceId/SpanId formats as discussed in https://docs.datadoghq.com/tracing/other_telemetry/connect_logs_and_traces/opentelemetry/?tab=java. Datadog wants unsigned 32bit decimal (not hex values). Interestingly it seems to handle the raw Opentelemetry values OK for the Trace ingestion - it just truncates and converts the Ids, e.g. So inspired by the IdGenerator producer example and this exporter example: #29143, I hoped something similar would be possible for the MDCProvider. I've tried installing variations of the code below via a CDI producer and via META-INF/services/org.jboss.logmanager.MDCProvider.
Unfortunately this appears to not get installed. Is there a proper way to do it? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
/cc @Ladicek (tracing), @brunobat (opentelemetry,tracing), @radcortez (opentelemetry,tracing) |
Beta Was this translation helpful? Give feedback.
-
Solved using a log Filter (https://quarkus.io/guides/logging#console-log-handler) instead:
Custom IdGenerator also no longer required. |
Beta Was this translation helpful? Give feedback.
-
No you don't have to because DD can be mapped to something other than those defaults. But you can if you want to via the |
Beta Was this translation helpful? Give feedback.
-
@brunobat would this make sense to be captured in a quarkiverse.datadog extension? |
Beta Was this translation helpful? Give feedback.
-
FYI, this is no longer required. DataDog is now natively supporting the OTEL formats (Trace 128 bit hex / Span 64 bit hex) when parsing injected logs. So the only requirement is to remap the names which can be done in DataDog Log Profiles or in your Quarkus log formats (depending on whether you are using JSON or console logging). DataDog docs still refer to requiring integer format and although they recently added the 128 bit Trace ID support, their OTEL specific docs still say it needs to be 64 bit. However I've just tested using the full length native hex formats and it all works. I'm assuming that despite the docs, this is official support due to their OTEL partnership and it just makes sense as they use the hex formats elsewhere. |
Beta Was this translation helpful? Give feedback.
FYI, this is no longer required. DataDog is now natively supporting the OTEL formats (Trace 128 bit hex / Span 64 bit hex) when parsing injected logs. So the only requirement is to remap the names which can be done in DataDog Log Profiles or in your Quarkus log formats (depending on whether you are using JSON or console logging).
DataDog docs still refer to requiring integer format and although they recently added the 128 bit Trace ID support, their OTEL specific docs still say it needs to be 64 bit. However I've just tested using the full length native hex formats and it all works. I'm assuming that despite the docs, this is official support due to their OTEL partnership and it just make…