Fix Vert.x Redis stable span names#18986
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Vert.x Redis client instrumentation to produce stable database span names using the generic DB span-name fallback logic, while intentionally excluding Redis db.namespace (database index) from span-name target selection. This aligns Redis span naming with stable DB semantic conventions: prefer {db.operation.name} {server.address:server.port} over including the DB index.
Changes:
- Switch span naming from a command-only extractor to
DbClientSpanNameExtractor, using a specialized attributes getter that returnsnullfordb.namespaceso span-name target falls back toserver.address:server.port. - Keep emitting
db.namespaceas an attribute in stable semconv mode (only excluding it from the span-name target selection). - Update Vert.x Redis client tests to assert the new stable semconv span names (e.g.,
GET localhost:6379) while preserving old-semconv command-only names.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| instrumentation/vertx/vertx-redis-client-4.0/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/vertx/redisclient/v4_0/VertxRedisClientTest.java | Updates span name assertions to expect {OP} {host}:{port} in stable DB semconv mode and command-only names otherwise. |
| instrumentation/vertx/vertx-redis-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/redisclient/v4_0/VertxRedisClientSingletons.java | Uses DbClientSpanNameExtractor with a span-name attributes getter that suppresses db.namespace so naming falls back to server target. |
| instrumentation/vertx/vertx-redis-client-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/vertx/redisclient/v4_0/VertxRedisClientAttributesGetter.java | Makes the getter non-final to allow the span-name-specific anonymous override of getDbNamespace. |
laurit
reviewed
Jun 15, 2026
| VertxRedisClientAttributesGetter getter = new VertxRedisClientAttributesGetter(); | ||
| // Redis semantic conventions don't follow the regular pattern of adding db.namespace to the | ||
| // span name. | ||
| VertxRedisClientAttributesGetter spanNameAttributesGetter = |
Contributor
There was a problem hiding this comment.
since we are going to need this in multiple instrumentations an alternative could be a wrapper for DbClientAttributesGetter that delegates other methods, but not getDbNamespace
laurit
approved these changes
Jun 15, 2026
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.
Summary
This updates Vert.x Redis stable database span names to use the generic DB span-name fallback while still excluding Redis
db.namespacefrom span-name target selection.In stable database semconv mode, Vert.x Redis already emits both
db.namespaceandserver.address/server.port. Redis semconv says the Redis database index (db.namespace) should not be used in span names, so stable span names should fall through to the available server target, e.g.GET localhost:6379, instead of remaining command-only or using the DB index.Default / old database semconv span names remain command-only.