-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: Add trace ID to the response header. #24
Conversation
Maybe we should add a switch and an option for the header key configure. |
Yes, I think what you said is very accurate. I have made the changes, please review again. |
The configuration of HTTP header names may be very useful, as some one may want to use x-trace-id, x-request-id, and so on. |
I think the default trace-id is sufficient. "b3" is a header used for zipkin distributed tracing. When used in the response header, it can be a bit confusing. |
Okay, use trace-id by default. |
@lafer-fz Thank you very much for your contribution, this is a very useful feature. However, the usual practice in the community is to abstract a mechanism for custom response headers, which is indeed more generic. Consider referring to the Javaagent version implementation: https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/javaagent-extension-api/src/main/java/io/opentelemetry/javaagent/bootstrap/http/HttpServerResponseCustomizer.java The traceid response header can be considered as a way to become a plugin integrated by default /cc @rogerogers |
I've been quite busy lately, i'll take a look at the Java implementation later. Additionally, Java itself is a bit more flexible. |
PATL @rogerogers @CoderPoet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/LGTM
What type of PR is this?
feat: Add trace ID to the response header.
What this PR does / why we need it (English/Chinese):
During the debugging process, it may be necessary to use the trace ID to troubleshoot issues. As a server-side developer, I would appreciate it if others could provide me with the trace ID of the problematic requests.
Which issue(s) this PR fixes:
Fixes(#23)