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

Fix spring webmvc latest dep test #4687

Merged
merged 3 commits into from
Nov 24, 2021

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Nov 21, 2021

Resolves #4683

@laurit
Copy link
Contributor Author

laurit commented Nov 21, 2021

/easycla

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.

do you know why it broke with spring boot 2.6.0? i looked and spring-webmvc was only bumped from 5.3.12 to 5.3.13. mostly wondering if that was the breaking point (5.3.12 to 5.3.13) or if we have a testing problem that made us miss an earlier breakage

// application-crashing side-effects with grails. That is why we don't add all HandlerMapping
// classes here. Although now that we run findMapping after the request, and only when server
// span name has not been updated by a controller, the probability of bad side-effects is much
// reduced.
Copy link
Member

Choose a reason for hiding this comment

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

just confirming my understanding (missed this advantage to moving it to the end 👍)

Suggested change
// reduced.
// reduced even if we did add all HandlerMapping classes here

Comment on lines 34 to 36
// copied from ServletRequestPathUtils
private static final String PATH_ATTRIBUTE =
"org.springframework.web.util.ServletRequestPathUtils.PATH";
Copy link
Member

Choose a reason for hiding this comment

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

I happened to click into an earlier version of ServletRequestPathUtils and noticed they used lowercase .path there, but uppercase .PATH in later versions.

maybe we can get the constant via reflection instead?

@laurit
Copy link
Contributor Author

laurit commented Nov 21, 2021

do you know why it broke with spring boot 2.6.0? i looked and spring-webmvc was only bumped from 5.3.12 to 5.3.13. mostly wondering if that was the breaking point (5.3.12 to 5.3.13) or if we have a testing problem that made us miss an earlier breakage

I believe that it broke because previously HandlerMapping.usesPathPatterns() returned false, but now it returns true. Something must have changed in the default configuration of spring boot. Most likely this can be made to fail with earlier versions(usesPathPatterns was added in 5.3).

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.

thx 👍

@trask
Copy link
Member

trask commented Nov 22, 2021

@open-telemetry/java-instrumentation-approvers the spring-webmvc span naming is a hairy bit of instrumentation, would be great to get one more review on this PR before merging

@trask trask merged commit 9039269 into open-telemetry:main Nov 24, 2021
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
* Fix spring webmvc latest dep test

* review comments

* remove latest dep version restriction
@laurit laurit deleted the spring-webmvc-latest-dep branch July 6, 2023 17:46
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.

Remove testLatestDeps restriction from spring-webmvc instrumentation
2 participants