AspNet: How to reuse NGINX request_id as TraceId #3943
-
I have a NGINX load balancer in front of my applications, and I want to use the request_id generated from NGINX as the Trace ID when stating both AspNet and AspNetCore instrumentation. The ID is forwarded in a custom header from nginx and is already a 32 char hex string, so it should be possible. I was thinking of using AspNetCoreInstrumentationOptions.EnrichWithHttpRequest for .NET and AspNetInstrumentationOptions.Enrich for .NET Framework. However, the TraceId is read only, presumably because it must be immutable after the activity is created. Is there a way to set a custom TraceId when the activity gets first created for a web request? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@geemark - Have you considered using custom propagator for this? |
Beta Was this translation helpful? Give feedback.
@geemark - Have you considered using custom propagator for this?