Spring instrumentation metadata#16325
Conversation
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).
jaydeluca
left a comment
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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)
| "spring:spring-web:spring-web-6.0:javaagent:test" | ||
| "spring:spring-web:spring-web-6.0:javaagent:testExperimental" |
There was a problem hiding this comment.
since these don't emit any telemetry, we can also remove them from here (the existing one was a mistake)
| "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") |
There was a problem hiding this comment.
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
| - name: otel.instrumentation.http.client.emit-experimental-telemetry | ||
| description: > | ||
| Enables the capture of experimental HTTP client telemetry, including URL template | ||
| as the span name. |
There was a problem hiding this comment.
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 |
…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.
|
Done, thanks for the review! :) |
|
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. |
Part of #14096
Add metadata for Spring instrumentation modules:
display_name,semantic_conventions,features, andconfigurationswhere applicable.Split experimental test suites for
spring-web-6.0(experimental HTTP client telemetry) andspring-ws-2.0(experimental controller telemetry) so that default and experimental behaviors are tested separately.Also fixes the attribute name typo in
spring-webmvcmetadata (spring-webmvc-view-name->spring-webmvc.view.name).