Skip to content

v3_preview applied for lowercase normalization for <name> in servlet.…#17822

Merged
trask merged 8 commits intoopen-telemetry:mainfrom
IswaryaIyapalam:fix/#15848
Apr 20, 2026
Merged

v3_preview applied for lowercase normalization for <name> in servlet.…#17822
trask merged 8 commits intoopen-telemetry:mainfrom
IswaryaIyapalam:fix/#15848

Conversation

@IswaryaIyapalam
Copy link
Copy Markdown
Contributor

fix given for this 15848 issue
First time contributing. Would be happy to get feedback if my understanding and fix is correct.

@IswaryaIyapalam IswaryaIyapalam requested a review from a team as a code owner April 12, 2026 19:07
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Apr 12, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@trask
Copy link
Copy Markdown
Member

trask commented Apr 13, 2026

hi @IswaryaIyapalam! can you investigate the CI failures? thanks

@@ -1,3 +1,5 @@
plugins {
id("otel.library-instrumentation")
id("otel.javaagent-instrumentation")
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.

you shouldn't add this. Library instrumentations are standalone instrumentations that you include in you application as jar. Agent instrumetnations are bundled in side the javaagent. This module is a library instrumentation.

// normalize parameter name similarly as is done with header names when header values are
// captured as span attributes
parameterName = parameterName.toLowerCase(Locale.ROOT);
if(!AgentCommonConfig.get().isV3Preview())
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.

This is a library instrumentation. AgentCommonConfig is a javaagent only class, it can't be used here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @laurit, i referred the code. I assumed otel instrumentation api module can be used to get the common config and v3 preview flag. Please check the latest changes and let me know

// normalize parameter name similarly as is done with header names when header values are
// captured as span attributes
parameterName = parameterName.toLowerCase(Locale.ROOT);
CommonConfig commonConfig = new CommonConfig(GlobalOpenTelemetry.get());
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.

If you add this here then it will be run when each key is created, perhaps it would be better to do this once in the constructor? It would be better to use GlobalOpenTelemetry.getOrNoop() since GlobalOpenTelemetry.get() prevents subsequent calls to GlobalOpenTelemetry.set(). Using the GlobalOpenTelemetry isn't guaranteed to work correctly for library instrumenations since they might not set it. To correctly handle library instrumenations you'd need to pass an OpenTelemetry instance to the constructor of ServletRequestParametersExtractor, but imo it isn't really important. The main idea behind this flag is to ease transitioning to the new defaults, so when we are finally ready to move to 3.0 we could search for the usages of this flag and flip the default instead of doing all these changes right before the release or maintaining a separate branch.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for highlighting the mistakes. Corrected the code as per your suggestion.

@IswaryaIyapalam IswaryaIyapalam marked this pull request as draft April 19, 2026 06:52
@IswaryaIyapalam IswaryaIyapalam marked this pull request as ready for review April 19, 2026 07:39
Co-authored-by: Trask Stalnaker <[email protected]>
@trask trask added this to the v2.27.0 milestone Apr 19, 2026
@trask trask merged commit dfbf501 into open-telemetry:main Apr 20, 2026
93 checks passed
@otelbot
Copy link
Copy Markdown
Contributor

otelbot Bot commented Apr 20, 2026

Thank you for your contribution @IswaryaIyapalam! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

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.

3 participants