30 Mar 2026
08:33 AM
- last edited on
31 Mar 2026
07:06 AM
by
MaciejNeumann
Hi,
I have some traces where some spans have logs, but others don't. This issue occurs primarily in .NET applications.
I have the log enrichment options enabled in the OneAgent features:
I'll include an example to make it clearer; in this trace, you can see how logs appear in the span
However, they do not appear in this span
but I have verified that there are logs for this call, which in theory should be correlated.
I still can't get all spans to have associated logs. Could you help me figure out what's causing this?
Thanks and regards
30 Mar 2026 08:46 AM
Hi,
Based on your description and screenshots, your OneAgent log enrichment configuration looks correct, since some spans already have correlated logs.
In this case, the issue is usually not configuration-related, but rather caused by missing context propagation (trace/span) in the application.
OneAgent is working correctly and the issue is caused by incomplete context propagation in the .NET application
Dynatrace can only correlate logs with spans when the log is created within the same execution context (thread/request), or the log contains trace_id and span_id.
If logs are generated:
the context can be lost. In such cases, both the span and log exist, but they are not correlated.
That’s why you see logs only for some spans.
I think you should check:
Possible solutions:
Featured Posts