Skip to content

Prevent Lettuce Redis db.namespace being included in span names#18984

Merged
laurit merged 1 commit into
open-telemetry:mainfrom
trask:lettuce-redis-namespace-span-name
Jun 15, 2026
Merged

Prevent Lettuce Redis db.namespace being included in span names#18984
laurit merged 1 commit into
open-telemetry:mainfrom
trask:lettuce-redis-namespace-span-name

Conversation

@trask

@trask trask commented Jun 13, 2026

Copy link
Copy Markdown
Member

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.namespace as a command span tag.

@trask trask force-pushed the lettuce-redis-namespace-span-name branch from d0d8ebc to cf1ead0 Compare June 13, 2026 18:57
@trask trask changed the title Prevent Lettuce Redis namespace span names Prevent Lettuce Redis db.namespace being included in span names Jun 13, 2026
@trask trask requested a review from Copilot June 13, 2026 18:58

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 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 DbClientAttributesGetter for Lettuce 5.1 that always returns null for getDbNamespace() when computing span names.
  • Make LettuceDbAttributesGetter non-final to 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.

@trask trask marked this pull request as ready for review June 14, 2026 00:23
@trask trask requested a review from a team as a code owner June 14, 2026 00:23
@laurit laurit merged commit d0be67f 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.

4 participants