New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update OTEL trace_id value from a request header #5056
Comments
The router would only originate a trace Id when it doesn't get one from the headers. Do you have tracing propagation setup or any exporters enabled? Can you share more of your configuration? |
Put another way, the thing you're asking for should definitely already work. The router is meant to play nice with existing distributed tracing headers, including passing them to subgraphs as fit. @BrynCooke Anything to add here? |
I tried it and left comment here. #4823 (comment)
Update: i'll take another look tmr to observe the change. |
In debug mode, I get following error
looks like trace_id is recreated because it couldn't parse UUID header. |
What is your subgraph server implemented in and what telemetry mechanism (SDK, format, etc.) are you using in it? |
They use opentracing in SDK for datadog. It looks like trace context use trace-id https://github.com/opentracing/specification/blob/master/rfc/trace_identifiers.md#trace-context-http-headers But still Im not completely sure they are related, it'd be great if anyone know how they work together. |
Is your feature request related to a problem? Please describe.
There is an existing infrastructure that utilizes a dedicated request header for trace ID. In Router, it'd make sense to use that as the value of OTEL
trace_id
for all logging, metrics, and span tags. This could reduce multiple trace ids labeled everywhere and also helps to correlate request logs from apollo-router, otherwise user may have to lookup 2 different trace ids to find a request logs.i.e.
As you can see above, the trace_id is not the one our infrastructure use, but generated by apollo router.
i.e. we use
trace_id
for Splunk and Datadog in current Node gateway, and would like to continue to use same names in Router. Ifdisplay_trace_id: true
is enabled from logging, there maybe be two trace_ids that could potentially overwrite each other if located at same level(I have not check if this is the case today but maybe possible?).Describe the solution you'd like
Have an option to override default
trace_id
value from a request header's UUID like value. This should update default trace_id value everywhere, including span attributes, logging, metrics etc.trace id header will be created in router_service if it doesn't exist, this created header should be able to propagate as trace_id as well
The text was updated successfully, but these errors were encountered: