Skip to content

Fix Vert.x Redis stable span names#18986

Merged
laurit merged 1 commit into
open-telemetry:mainfrom
trask:vertx-redis-stable-span-names
Jun 15, 2026
Merged

Fix Vert.x Redis stable span names#18986
laurit merged 1 commit into
open-telemetry:mainfrom
trask:vertx-redis-stable-span-names

Conversation

@trask

@trask trask commented Jun 13, 2026

Copy link
Copy Markdown
Member

Summary

This updates Vert.x Redis stable database span names to use the generic DB span-name fallback while still excluding Redis db.namespace from span-name target selection.

In stable database semconv mode, Vert.x Redis already emits both db.namespace and server.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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 returns null for db.namespace so span-name target falls back to server.address:server.port.
  • Keep emitting db.namespace as 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.

@trask trask marked this pull request as ready for review June 14, 2026 00:38
@trask trask requested a review from a team as a code owner June 14, 2026 00:38
VertxRedisClientAttributesGetter getter = new VertxRedisClientAttributesGetter();
// Redis semantic conventions don't follow the regular pattern of adding db.namespace to the
// span name.
VertxRedisClientAttributesGetter spanNameAttributesGetter =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 laurit merged commit 0094958 into open-telemetry:main Jun 15, 2026
95 checks passed
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