Skip to content
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

Wrap request to avoid modifying attributes of the original request #10389

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Feb 2, 2024

Resolves #10379
Or spring mvc instrumentation tries to update the root span name/set route at the end of the request if it wasn't already set earlier. This usually happens when the request is rejected for some reason and request processing does not reach the part where request handler is determined and where we usually do the name update. If that is the case we try to find the handler that matches current request and use the patter it matches as the route. This process alters request attributes which is not desired. This PR wraps the original request so that its attributes could be preserved.

@laurit laurit requested a review from a team as a code owner February 2, 2024 13:24
Copy link
Member

@kenfinnigan kenfinnigan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick turnaround @laurit!

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@laurit laurit merged commit acb078b into open-telemetry:main Feb 6, 2024
47 checks passed
@laurit laurit deleted the spring-request-wrap branch February 6, 2024 06:44
steverao pushed a commit to steverao/opentelemetry-java-instrumentation that referenced this pull request Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spring WebMVC instrumentation alters HTTP Response code in certain scenarios
3 participants