-
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
Write TraceId in HTTP Response headers #40857
Comments
@bclozel Thanks for pushing this forward. Adding a TraceId Response Header is something I usually configure by hand and it would be nice if that was something provided by Spring Boot out-of-the-box! Just a bit more Spring Boot magic, which is great IMHO. I can't promise much, but would you accept a Pull Request for this issue? |
@neiser thanks for the offer - Spring Boot 3.4 is due next November and the main branch is not currently building against Spring Framework 6.2 so I don't think we're in a position to work on this right now. |
Hi @bclozel, I'm new to open source and would like to contribute. This can be learning opportunity for me. In one of my learning project (spring-webflux), I used a WebFilter to add the traceId and spanId to my incoming requests. Please let me know if I can contribute in any way. |
FYI, the wish to have such an I'm curious though why a custom header was chosen, instead of (not yet officially ratified)
Actually, falling into the rabbit hole of |
|
@dalbani nobody requested this format before you did. It's probably a good idea to revisit the header format in the milestone phase. Please create a new issue to request this change. |
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
As of spring-projects/spring-framework#30632, Spring Framework allows to extend the
ServerHttpObservationFilter
. Spring Boot could extend this class and contribute it if "micrometer-tracing" is on the classpath and aTracer
bean is available.The sample implementation is quite straightforward. We should then adapt the auto-configuration to only contribute this filter subclass if conditions are meant, otherwise keep contributing the current setup.
The text was updated successfully, but these errors were encountered: