Skip to content

Setting management.observations.conventions to open-telemetry enables neither semantic convention - #52619

Merged
wilkinsona merged 1 commit into
spring-projects:mainfrom
b84330808:observation-conventions-dashed-value
Nov 4, 2026
Merged

wilkinsona merged 1 commit into
spring-projects:mainfrom
b84330808:observation-conventions-dashed-value

Conversation

@b84330808

Copy link
Copy Markdown
Contributor

The reference docs say to set management.observations.conventions to open-telemetry to switch to OpenTelemetry's semantic conventions. ObservationProperties binds it fine, but @ConditionalOnSemanticConventions doesn't match it. SemanticConventions.isActive only accepts the enum name ignoring case (open_telemetry) or the form without separators (opentelemetry). As a result, with open-telemetry neither MICROMETER nor OPEN_TELEMETRY is active, and the WebMvc/WebFlux auto-configuration defines no ServerRequestObservationConvention at all.

This change compares the canonical form of the property value with the canonical name, the same way the lenient enum conversion does, so dashes are ignored too.

SemanticConventionsTests.ignoresDashMatch and ConditionalOnSemanticConventionsTests.whenPropertyIsSetToDashedOpenTelemetryOnlyOpenTelemetryIsActive fail without the change and pass with it.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. label Nov 4, 2026
@wilkinsona wilkinsona added type: bug A general bug and removed status: waiting-for-triage An issue that has not yet been triaged. Contributions will not be accepted. labels Nov 4, 2026
@wilkinsona wilkinsona added this to the 4.2.x milestone Nov 4, 2026
@wilkinsona wilkinsona self-assigned this Nov 4, 2026
@wilkinsona
wilkinsona force-pushed the observation-conventions-dashed-value branch from f71223e to c959a8a Compare November 4, 2026 17:16
wilkinsona pushed a commit to b84330808/spring-boot that referenced this pull request Nov 4, 2026
Compare the canonical form of the management.observations.conventions
value with the canonical name of the conventions. Prior to this commit,
only the exact enum name and the form without separators matched, so
the documented 'open-telemetry' value matched neither MICROMETER nor
OPEN_TELEMETRY.

Signed-off-by: Wei-Lun Li <[email protected]>

See spring-projectsgh-52619
Compare the canonical form of the management.observations.conventions
value with the canonical name of the conventions. Prior to this commit,
only the exact enum name and the form without separators matched, so
the documented 'open-telemetry' value matched neither MICROMETER nor
OPEN_TELEMETRY.

Signed-off-by: Wei-Lun Li <[email protected]>

See spring-projectsgh-52619
@wilkinsona
wilkinsona force-pushed the observation-conventions-dashed-value branch from c959a8a to 978afd5 Compare November 4, 2026 17:16
@wilkinsona wilkinsona modified the milestones: 4.2.x, 4.2.0-RC2 Nov 4, 2026
@wilkinsona
wilkinsona merged commit 6a7c795 into spring-projects:main Nov 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants