open-telemetry / open-telemetry/opentelemetry-python-contrib
opentelemetry-instrumentation-aio-pika to support QueueIterator
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 1.1k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 16
Description
Is your feature request related to a problem?
It was noticed that when using opentelemetry-instrumentation-aio-pika with QueueIterator (an example https://aio-pika.readthedocs.io/en/latest/apidoc.html#aio_pika.RobustQueue.iterator), trace context information carried by the message is ignored or not correctly parsed.
Describe the solution you'd like
It would be great to make it work with QueueIterator and use trace context from the message.
Describe alternatives you've considered
N/A
Additional context
As a temporary solution, this could be solved with the following code:
from opentelemetry.instrumentation.aio_pika.callback_decorator import CallbackDecorator
...
decorated_callback = CallbackDecorator(tracer, queue).decorate(self.on_message)
while True:
async with queue.iterator() as queue_iter:
async for message in queue_iter:
await decorated_callback(message) # type: ignore
await asyncio.sleep(0.1)
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 opentelemetry.instrumentation.aio_pika.callback_decorator.CallbackDecorator and compare its current callback path with the aio-pika QueueIterator example in the issue. Trace how messages are passed to the decorated callback, then verify that trace context carried by QueueIterator messages is parsed and used correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100