Skip to content

Commit ee0b995

Browse files
GitanshKapoorxrmxtammy-baylis-swi
authored
fix(pika): pass destination instead of task_name to _enrich_span (#4563)
* Update span enrichment to use destination instead of task_name * Refactor enrich_span assertion in test_utils.py - 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. * Update CHANGELOG.md * Update CHANGELOG with recent fixes and improvements - Update CHANGELOG.md - Updated the Pull Request URL * Update CHANGELOG.md * Add changelog fragment for pika destination fix * Update .changelog/4563.fixed Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com> * Update 4563.fixed --------- Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com> Co-authored-by: Tammy Baylis <96076570+tammy-baylis-swi@users.noreply.github.com>
1 parent b1b872b commit ee0b995

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

.changelog/4563.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
`opentelemetry-instrumentation-pika`: pass destination to `_enrich_span` instead of `task_name`

instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def _get_span(
155155
kind=span_kind,
156156
)
157157
if span.is_recording():
158-
_enrich_span(span, channel, properties, task_name, operation)
158+
_enrich_span(span, channel, properties, destination, operation)
159159
return span
160160

161161

instrumentation/opentelemetry-instrumentation-pika/tests/test_utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ def test_get_span(
4747
tracer.start_span.assert_called_once_with(
4848
name=generate_span_name.return_value, kind=span_kind
4949
)
50-
enrich_span.assert_called_once()
50+
enrich_span.assert_called_once_with(
51+
tracer.start_span.return_value,
52+
channel,
53+
properties,
54+
destination,
55+
None,
56+
)
5157

5258
@mock.patch("opentelemetry.context.get_value")
5359
@mock.patch("opentelemetry.instrumentation.pika.utils._generate_span_name")

0 commit comments

Comments
 (0)