Skip to content

fix(pika): pass destination instead of task_name to _enrich_span#4563

Open
GitanshKapoor wants to merge 5 commits intoopen-telemetry:mainfrom
GitanshKapoor:fix/pika-update-destination-property
Open

fix(pika): pass destination instead of task_name to _enrich_span#4563
GitanshKapoor wants to merge 5 commits intoopen-telemetry:mainfrom
GitanshKapoor:fix/pika-update-destination-property

Conversation

@GitanshKapoor
Copy link
Copy Markdown

Description

In _get_span (utils.py), _enrich_span was called with task_name
instead of destination, causing the messaging.destination span
attribute to always show "(temporary)" on publish spans and the
consumer tag on consume spans, instead of the actual queue or exchange name.

Fixes #1026

Type of change

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

How Has This Been Tested?

Updated test_get_span in test_utils.py to assert that _enrich_span
is called with destination as the argument, not task_name. All
existing tests in tests/test_utils.py pass.

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

- tightened the test_get_span assertion to verify _enrich_span
is called with destination, not task_name.
- changed enrich_span.assert_called_once() to enrich_span.assert_called_once_with(...) with destination as the argument.
@GitanshKapoor GitanshKapoor requested a review from a team as a code owner May 10, 2026 09:42
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 10, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@xrmx xrmx moved this to Ready for review in Python PR digest May 11, 2026
Comment thread CHANGELOG.md Outdated
### Fixed

- `opentelemetry-instrumentation-pika`: Fix `messaging.destination` span attribute set to `task_name` instead of `destination` in `_get_span`
([#1026](https://github.com/open-telemetry/opentelemetry-python-contrib/issues/1026))
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.

We use PR urls not issues

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

  • Hi, I’ve updated the PR URL as suggested. Thanks!

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

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

[autoinstrumentation-pika] Wrong property set as destination

2 participants