Skip to content

Optimize tomcat uri construction#4008

Merged
trask merged 3 commits intoopen-telemetry:mainfrom
trask:optimize-tomcat-uri-construction
Aug 30, 2021
Merged

Optimize tomcat uri construction#4008
trask merged 3 commits intoopen-telemetry:mainfrom
trask:optimize-tomcat-uri-construction

Conversation

@trask
Copy link
Copy Markdown
Member

@trask trask commented Aug 28, 2021

Part of #3699

At least until we resolve #3700

(this particular one is showing up in my benchmarks)

@trask trask marked this pull request as ready for review August 29, 2021 02:48
length += 1 + query.length();
}

StringBuilder url = new StringBuilder(length);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I initially thought that as this does not encode any characters it could result in an invalid url (would that actually matter?), but javadoc for HttpServletRequest.getQueryString states that "The value is not decoded by the container" and the same for getRequestURI so as far as I understand this looks good.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

good point, I added a TODO to this method to investigate and document encoding requirement

@trask trask merged commit 0f9308b into open-telemetry:main Aug 30, 2021
@trask trask deleted the optimize-tomcat-uri-construction branch August 30, 2021 20:34
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.

Don't capture http.scheme, http.host and http.target if already capturing http.url

4 participants