I'm trying to setup my net6 project to send traces and logs to grafana loki and tempo for better observability. I'm successfully setup sending traces to tempo using opentelemetry.instrumentation(All traces have TraceId). Now I'm trying to get TraceId for other logs, but can't get it. I'm using NLog.Web.AspNetCore(5.3.2) and NLog.DiagnosticSource(5.0.0) packages and as mentioned here - https://github.com/NLog/NLog.DiagnosticSource - I can get TraceId via ${activity:property=TraceId} variable, but when I use layout like "consoleLayout": "${activity:property=TraceId} [${time} ${uppercase:${level}]} ${logger} ${aspnet-request-method}..." this variable is empty.
I did not find any information that would need to configure something else. As far as I understand, TraceID is present by default, and I only need to get it. What I missed?
I was able to get TraceId in nlog after I have added
builder.Services.AddLogging(o => o
.Configure(x => x.ActivityTrackingOptions = ActivityTrackingOptions.TraceId | ActivityTrackingOptions.SpanId));