open-telemetry / open-telemetry/opentelemetry-python-contrib
Add link from previous trace when publishing messages with pika
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 1.1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 16
Description
What problem do you want to solve?
From my understanding of messaging-spans, when a producer publishes a message, its span would be linked with the span of the consumers. This does not seem to happen when using opentelemetry-instrumentation-pika.
Describe the solution you'd like
The _decorate_basic_publish should take care of automatically adding links.
Describe alternatives you've considered
I tried to manually implement creation of links, but since the decorator function is not public, I did not understand how this could be done.
Additional Context
No response
Would you like to implement a fix?
None
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 with instrumentation/opentelemetry-instrumentation-pika/src/opentelemetry/instrumentation/pika/utils.py, especially _decorate_basic_publish, and compare its behavior with the messaging-spans specification linked in the issue. Trace how publishing spans are created and verify the relevant instrumentation tests, if present. Done means publishing a message automatically adds the expected link to the previous trace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems, observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100