Skip to content

Spring instrumentation metadata#16325

Merged
trask merged 2 commits intoopen-telemetry:mainfrom
lucacavenaghi97:spring-metadata
Mar 2, 2026
Merged

Spring instrumentation metadata#16325
trask merged 2 commits intoopen-telemetry:mainfrom
lucacavenaghi97:spring-metadata

Conversation

@lucacavenaghi97
Copy link
Copy Markdown
Member

Part of #14096

Add metadata for Spring instrumentation modules: display_name, semantic_conventions, features, and configurations where applicable.

Split experimental test suites for spring-web-6.0 (experimental HTTP client telemetry) and spring-ws-2.0 (experimental controller telemetry) so that default and experimental behaviors are tested separately.

Also fixes the attribute name typo in spring-webmvc metadata (spring-webmvc-view-name -> spring-webmvc.view.name).

Add metadata (display_name, semantic_conventions, features, configurations)
for all Spring instrumentation modules. Split experimental test suites for
spring-web-6.0 and spring-ws-2.0 so that default and experimental behaviors
are verified independently. Fix spring-webmvc attribute name typo in metadata
(spring-webmvc-view-name -> spring-webmvc.view.name).
@lucacavenaghi97 lucacavenaghi97 requested a review from a team as a code owner February 28, 2026 18:06
Copy link
Copy Markdown
Member

@jaydeluca jaydeluca left a comment

Choose a reason for hiding this comment

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

couple small notes, but nice job!

systemProperty("otel.instrumentation.common.enduser.id.enabled", "true")
systemProperty("otel.instrumentation.common.enduser.role.enabled", "true")
systemProperty("otel.instrumentation.common.enduser.scope.enabled", "true")
systemProperty("metadataConfig", "otel.instrumentation.common.enduser.id.enabled=true,otel.instrumentation.common.enduser.role.enabled=true,otel.instrumentation.common.enduser.scope.enabled=true")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

since this instrumentation doesn't emit any telemetry, we don't need to do any of the collectMetadata stuff in this gradle file (and remove from instrumentations.sh)

Comment on lines +246 to +248
"spring:spring-web:spring-web-6.0:javaagent:test"
"spring:spring-web:spring-web-6.0:javaagent:testExperimental"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

since these don't emit any telemetry, we can also remove them from here (the existing one was a mistake)

Suggested change
"spring:spring-web:spring-web-6.0:javaagent:test"
"spring:spring-web:spring-web-6.0:javaagent:testExperimental"

testClassesDirs = sourceSets.test.get().output.classesDirs
classpath = sourceSets.test.get().runtimeClasspath
jvmArgs("-Dotel.instrumentation.http.client.emit-experimental-telemetry=true")
systemProperty("metadataConfig", "otel.instrumentation.http.client.emit-experimental-telemetry=true")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

since this doesn't emit telemetry we don't need the collectMetadata configs. I'm also not sure if theres much benefit to splitting out this particular test suite because it doesn't change the emitted attributes, but I don't think it hurts anything to keep it

Comment on lines +9 to +12
- name: otel.instrumentation.http.client.emit-experimental-telemetry
description: >
Enables the capture of experimental HTTP client telemetry, including URL template
as the span name.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you don't need to change this, i'm just making note / thinking out loud - elsewhere we've documented this config, we usually use this description:

    description: >
      Enable the capture of experimental HTTP client telemetry. Adds the `http.request.body.size`
      and `http.response.body.size` attributes to spans, and records `http.client.request.size` and
      `http.client.response.size` metrics.

but i think it is different for this instrumentation, where your description is accurate for what it does in this case (which is to only update the template info).

I will need to think of how to handle this type of thing if we move to a single description for these common config options

default: false
description: >
Enables the capture of experimental span attributes `spring-webmvc-view-name` and
Enables the capture of experimental span attributes `spring-webmvc.view.name` and
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nice catch!

…telemetry

Address review feedback: spring-security-config-6.0 and spring-web-6.0
don't emit their own telemetry, so metadata collection is unnecessary.
Also remove their entries from instrumentations.sh.
@lucacavenaghi97
Copy link
Copy Markdown
Member Author

Done, thanks for the review! :)

@trask trask merged commit d60d5f0 into open-telemetry:main Mar 2, 2026
93 checks passed
@otelbot
Copy link
Copy Markdown
Contributor

otelbot Bot commented Mar 2, 2026

Thank you for your contribution @lucacavenaghi97! 🎉 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