feat(micrometer): OpenTelemetry database semantic conventions for query observations#233
Merged
Conversation
…ry observations Observability backends key their database tooling on the OpenTelemetry database client semantic conventions over OTLP: latency panels, service-map database nodes, and query views recognize db.* attributes. Storm's observations carried only storm.* key values, so its spans rendered as generic custom spans outside that tooling. - OtelDatabaseObservationConvention (storm-micrometer): extends the default convention with db.system.name, db.operation.name (low cardinality) and db.query.text (high cardinality, placeholders only, never parameter values), keeping the storm.* key values for custom dashboards and db.statement for backends that predate the stabilized conventions. fromJdbcUrl derives the database product from a JDBC URL using the conventions' well-known identifiers. - Spring Boot starters: storm.observations.semantic-conventions=otel activates the convention, with the database product detected from the application's DataSource; an ObservationConvention bean still wins, and an unknown property value fails fast. Shared by both starters via StormObservationAutoConfiguration. - Ktor plugin: an ObservationConvention<StormQueryObservationContext> registered in the dependency container overrides the naming and key values, mirroring the starters' convention bean. The result is backend-specific database UX from vendor-neutral telemetry: the same spans light up whichever OTLP-capable backend the application points at. Fixes #231
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Observability backends key their database tooling on the OpenTelemetry database client semantic conventions over OTLP: latency panels, service-map database nodes, and query views recognize the standard
db.*attributes. Storm's observations carried onlystorm.*key values, so its spans rendered as generic custom spans outside that tooling.Fixes #231
What's included
OtelDatabaseObservationConvention(storm-micrometer): extends the default convention withdb.system.nameanddb.operation.nameas low-cardinality key values anddb.query.textas a high-cardinality value (parameter placeholders only, never values). Thestorm.*key values remain for custom dashboards, anddb.statementis kept for backends that predate the stabilized conventions.fromJdbcUrlderives the database product from a JDBC URL using the conventions' well-known identifiers (mariadb,postgresql,h2database,oracle.db,microsoft.sql_server,ibm.db2;other_sqlfallback).storm.observations.semantic-conventions=otelactivates the convention through the sharedStormObservationAutoConfiguration, with the database product detected from the application'sDataSource. A user-definedObservationConventionbean still wins; an unknown property value fails startup with a descriptive error.ObservationConvention<StormQueryObservationContext>registered in the dependency container overrides the automatic binding's naming and key values, mirroring the starters' convention bean.The result is backend-specific database UX from vendor-neutral telemetry: the same spans light up whichever OTLP-capable backend the application points at — Elastic, Grafana, Datadog — with zero vendor-specific code in Storm or the application.
Verification
storm.*key values; JDBC URL mapping for the well-known products.db.system.name=h2databaseon an observation recorded through the auto-configured template with the property set, plus the fail-fast case for unknown property values.Docs: Observability sections of spring-integration.md and ktor-integration.md, the yaml examples, and the changelog entry.