Prevent Lettuce Redis db.namespace being included in span names#18984
Merged
laurit merged 1 commit intoJun 15, 2026
Conversation
d0d8ebc to
cf1ead0
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts Lettuce 5.1 span-name extraction to ensure Redis db.namespace (Redis database index) is not used as a span-name target, aligning with Redis stable semantic conventions and preventing future upstream tag changes from affecting span names.
Changes:
- Use a span-name-specific
DbClientAttributesGetterfor Lettuce 5.1 that always returnsnullforgetDbNamespace()when computing span names. - Make
LettuceDbAttributesGetternon-finalto allow the span-name-specific override. - Add a clarifying comment in Jedis 4.0 singleton initialization to match the same Redis span-naming rationale.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceTelemetryBuilder.java | Ensures Redis db.namespace is ignored for span-name extraction by using a specialized getter. |
| instrumentation/lettuce/lettuce-5.1/library/src/main/java/io/opentelemetry/instrumentation/lettuce/v5_1/LettuceDbAttributesGetter.java | Removes final to enable a span-name-only subclass override of getDbNamespace(). |
| instrumentation/jedis/jedis-4.0/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/jedis/v4_0/JedisSingletons.java | Adds documentation comment explaining why db.namespace is masked for Redis span naming. |
jaydeluca
approved these changes
Jun 14, 2026
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 makes Lettuce 5.1 library span-name extraction ignore
db.namespace. Redis stable semantic conventions do not use the Redis database index (db.namespace) as a span-name target.Today Lettuce 5.1 does not appear to expose the selected Redis database index to command spans through its upstream tracing API. This is defensive for if/when upstream Lettuce starts emitting
db.namespaceas a command span tag.