open-telemetry / open-telemetry/opentelemetry-python-contrib
redis: db.namespace is not shown for Redis database index in stable semconv mode
Nobody has claimed this yet.
- 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
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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