Open Justinas-Jurciukonis opened 3 months ago
Hi @Justinas-Jurciukonis :wave:
Currently, many external tracing systems (e.g., OpenTelemetry) utilize 128-bit Trace IDs, so when Datadog interoperates with them, we can end up with broken traces and logs correlation. This is why, alongside the OTel API support, 128-bit trace ID generation has been enabled by default (#2358) since 0.94.0 to match these open standards.
The behavior you are experiencing is expected. The results of these two functions are the same when DD_TRACE_128_BIT_TRACEID_GENERATION_ENABLED
is disabled. \DDTrace\logs_correlation_trace_id
should be used to ensure the right trace identifier format is used.
@PROFeNoM Maybe you can add this as warning into documentation page?
@Justinas-Jurciukonis We're planning to change the default setting in the next few months, given that our backend now also supports 128 bit trace ids :-)
Bug report
As stated inside Manual Injection documentation
\DDTrace\current_context()
should return trace identifiers and we always have used following code:and it worked fine for some time. But now (as of 0.98.1 and 1.1.0) adding this
trace_id
loses Traces information and even sometimes matches accross multiple requests.I have logged following code and see that
\DDTrace\current_context()
and\DDTrace\logs_correlation_trace_id()
returns different results:If using
\DDTrace\logs_correlation_trace_id()
, than Traces are matched against log recordsPHP version
8.3
Tracer or profiler version
0.98.1; 1.1.0
Installed extensions
No response
Output of
phpinfo()
No response
Upgrading from
No response