open-telemetry / open-telemetry/opentelemetry-python-contrib

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

Open Beginner friendly
#4,986 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

Describe your environment

OS: Mac OS 26.6.2
Python version: 3.12
Package version: 0.66b0.dev

What happened?

The Redis database index is shown only in the default database semconv mode. When stable semconv mode is enabled, the database index is not shown.

In _set_db_redis_database_index, the comment says that db.redis.database_index was removed with no replacement in semconv 1.38.0. However, db.redis.database_index was replaced by db.namespace in semconv 1.26.0

Steps to Reproduce

https://github.com/open-telemetry/opentelemetry-python-contrib/blob/466ae4c00de77d1f54f77a9600f1d08eba2306b5/opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py#L605-L613

Expected Result

Default semconv mode should show db.redis.database_index and stable semconv mode should show db.namespace. In database/dup, both db.redis.database_index and db.namespace should be shown.

Actual Result

db.redis.database_index is shown in default semconv and db.namespace is not shown in stable semconv.

Additional context

No response

Would you like to implement a fix?

None

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in opentelemetry-instrumentation/src/opentelemetry/instrumentation/_semconv.py at _set_db_redis_database_index and review the surrounding semconv-mode handling. Reproduce the Redis database index behavior in default, stable, and database/dup modes, then verify that each mode emits the attributes described in the expected result.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, redis
Domain
observability
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.