Skip to content

Conversation

@herin049
Copy link
Contributor

Description

Add a default span name of "redis" for pipeline operations to handle edge cases where the span name cannot be derived or when the pipeline operation consists of no commands.

Fixes #3337

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Two test cases for the sync & async clients have been added in this PR verifying that a default span name of "redis" is given for pipeline operations with no commands. The tests can be ran using:

uv run tox -e py39-test-instrumentation-redis 

Does This PR Require a Core Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

See contributing.md for styleguide, changelog guidelines, and more.

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

@herin049 herin049 force-pushed the fix-unnamed-spans-redis branch from a60f1a7 to b86b687 Compare November 13, 2025 19:30
Copy link
Member

@emdneto emdneto left a comment

Choose a reason for hiding this comment

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

Semconv spec says:

If neither {db.operation.name} nor {target} are available, span name SHOULD be {db.system.name}. So I think it's ok.

@xrmx xrmx enabled auto-merge (squash) November 18, 2025 13:55
@xrmx xrmx moved this from Ready for review to Approved PRs in @xrmx's Python PR digest Nov 18, 2025
@xrmx xrmx merged commit 1d97282 into open-telemetry:main Nov 18, 2025
647 checks passed
@github-project-automation github-project-automation bot moved this from Approved PRs to Done in @xrmx's Python PR digest Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

opentelemetry-instrumentation-redis occasionally produces unnamed spans

4 participants