Skip to content

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

Open
GitanshKapoor wants to merge 9 commits into
open-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 9 commits into
open-telemetry:mainfrom
GitanshKapoor:fix/pika-update-destination-property

Conversation

@GitanshKapoor
Copy link
Copy Markdown

@GitanshKapoor GitanshKapoor commented May 10, 2026

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!

@emdneto
Copy link
Copy Markdown
Member

emdneto commented May 12, 2026

Thanks for the PR!

Just a heads-up: we no longer update CHANGELOG.md directly. The changelog is now generated from changelog fragments using Towncrier.

Please add the appropriate changelog fragment for this change instead of editing CHANGELOG.md manually. You can find the instructions and expected format in CONTRIBUTING.md.

@GitanshKapoor GitanshKapoor requested a review from xrmx May 13, 2026 15:50
@GitanshKapoor
Copy link
Copy Markdown
Author

Thanks for the PR!

Just a heads-up: we no longer update CHANGELOG.md directly. The changelog is now generated from changelog fragments using Towncrier.

Please add the appropriate changelog fragment for this change instead of editing CHANGELOG.md manually. You can find the instructions and expected format in CONTRIBUTING.md.

Thanks for the heads-up!

I’ve added a changelog fragment in .changelog/4563.fixed following the Towncrier format, so CHANGELOG.md is no longer edited manually.

Please let me know if any adjustments are needed. 🙂

Comment thread .changelog/4563.fixed
@@ -0,0 +1 @@
'opentelemetry-instrumentation-pika': pass destination to _enrich_span instead of task_name
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.

Nit:

Suggested change
'opentelemetry-instrumentation-pika': pass destination to _enrich_span instead of task_name
`opentelemetry-instrumentation-pika`: pass destination to _enrich_span instead of task_name

Copy link
Copy Markdown
Contributor

@tammy-baylis-swi tammy-baylis-swi left a comment

Choose a reason for hiding this comment

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

Lgtm! Will also need a Maintainer's approval.

@GitanshKapoor
Copy link
Copy Markdown
Author

Lgtm! Will also need a Maintainer's approval.

Thank you for the feedback! Waiting on a Maintainer’s approval.

@xrmx @tammy-baylis-swi

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

4 participants