-
Notifications
You must be signed in to change notification settings - Fork 41k
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
Change X-Trace-Id response header in favour of "traceresponse" #44431
Comments
@bclozel Wouldn't it make sense make the header name configurable? Additionally, is there a reason for not supporting this for WebFlux? |
I'm not sure I understand; how would that work?
No, I'm working on it. We were just waiting for community feedback before expanding support. |
Instead of using this constant here: Lines 38 to 40 in 4c37267
The filter gets a bean property traceIdHeaderName that is being populated by ObservationFilterConfigurations from a new property, something like management.observations.http.server.requests.trace-header-name=x-my-custom-trace-id-header-name .
I see, thank you. |
@kzander91 but what would be the purpose of changing the header name? |
Sorry, I missed that we're not just discussing header names, but also different header values (i.e. formats). I guess if we're using established header names, it would not make sense to make them customizable, you're right. In my app, I have built a filter myself that exposes the trace id as a response header (under a name I have chosen myself). If this topic was just about exposing the trace id, and the header name was configurable, I could have replaced my own filter with Boot's new filter. |
No worries @kzander91 I was just making sure I didn't miss anything. As for the custom header that was our original intent but we got feedback and apparently that's not what people expect. Hopefully the "traceresponse" will be more adopted in the future. |
Prior to this commit, we added support for the "X-Trace-Id" HTTP response header in spring-projectsgh-40857. This wrote the traceId information for MVC applications, if the `management.observations.http.server.requests.write-trace-header` was set. After receiving feedback from the community, we are revisiting this feature with the following changes: * the header is now "traceresponse" and implements the W3C draft standard, see https://w3c.github.io/trace-context/#trace-context-http-response-headers-format * the property is now "management.observations.http.server.requests.write-traceresponse" * both MVC and WebFlux are now supported Closes spring-projectsgh-44431
Changes are now ready but on hold, as we are discussing with the Micrometer team whether this feature belongs in Micrometer directly. |
We received feedback on our new
X-Trace-Id
response header support for Spring Boot 3.5 (see #40857). Instead of using anX-
header we could be considering one of the currently developed drafts.It seems both
traceresponse
andServer-Timing
are being considered at the moment, with no clear guidance from the observability community. As far as I understand,Server-Timing
has the following priorities:Browsers can use this header to include its information in their "Developer tools" tabs to give the full picture of the web page performance: from backend activity to resource loading and HTML rendering. The traceId information would only be useful if this UI is also capable of retrieving and rendering the full trace information in the same context.
I think we'll go with the
traceresponse
header and the related format, as its main goal is toidentify a completed request in a tracing system
, which better aligns with our intent here.The text was updated successfully, but these errors were encountered: