Skip to content

redis: emit db.namespace for database index - #4988

Draft
PuvaanRaaj wants to merge 1 commit into
open-telemetry:mainfrom
PuvaanRaaj:fix/4986-redis-db-namespace
Draft

redis: emit db.namespace for database index#4988
PuvaanRaaj wants to merge 1 commit into
open-telemetry:mainfrom
PuvaanRaaj:fix/4986-redis-db-namespace

Conversation

@PuvaanRaaj

Copy link
Copy Markdown

Description

Emit db.namespace for the Redis database index when stable database semantic conventions are enabled. In database/dup mode, retain the legacy integer attribute and emit the stable string attribute.

Fixes #4986

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Redis instrumentation test suite (67 passed)
  • Semantic-convention helper tests (4 passed)
  • Ruff check and format verification

Does This PR Require a Core Repo Change?

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@PuvaanRaaj
PuvaanRaaj requested a review from a team as a code owner August 22, 2026 21:41
@PuvaanRaaj
PuvaanRaaj force-pushed the fix/4986-redis-db-namespace branch from f1f19f2 to 9ed14d5 Compare August 22, 2026 21:41
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 22, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-08-22 21:43 UTC

Move out of draft to request review.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@PuvaanRaaj
PuvaanRaaj marked this pull request as draft August 22, 2026 21:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f1f19f2736

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1057 to +1058
self.assertIn(DB_NAMESPACE, span.attributes)
self.assertEqual(span.attributes[DB_NAMESPACE], "0")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Cover db.namespace in asynchronous Redis tests

When stable database semantic conventions are used through async Redis clients or async pipelines, this helper also emits db.namespace, but the added assertions exercise only the synchronous client; the existing async stable/dup tests do not verify the new attribute. Add corresponding DB_NAMESPACE name and string-value assertions for the async variants so both public APIs are guarded.

AGENTS.md reference: AGENTS.md:L94-L96

Useful? React with 👍 / 👎.

Comment on lines +1057 to +1058
self.assertIn(DB_NAMESPACE, span.attributes)
self.assertEqual(span.attributes[DB_NAMESPACE], "0")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Exercise the supported Redis version bounds

These assertions run through test-requirements.txt, which pins only redis==5.0.1, and the Redis tox environments have no oldest/latest factors, even though the package supports redis >=2.6. Add oldest/latest requirement sets and tox factors so the new namespace behavior is validated at both supported dependency boundaries.

AGENTS.md reference: AGENTS.md:L97-L98

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

redis: db.namespace is not shown for Redis database index in stable semconv mode

1 participant