open-telemetry / open-telemetry/opentelemetry-python-contrib

opentelemetry-instrumentation-aio-pika compatibility issue

Open
#2,005 2 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
1.1k
Forks
1.1k
Avg merge
4d 15h
Merged PRs (30d)
16

Description

The opentelemetry-instrumentation-aio-pika module depends on aio-pika >= 7.2.0, < 10.0.0 but when I use it with aio-pika 9.3.0 it raises the following AttributeError error, because connection has changed to _connection at some point.

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <opentelemetry.instrumentation.aio_pika.span_builder.SpanBuilder object at 0x105aa5870>
channel = <aio_pika.robust_channel.RobustChannel object at 0x105aa65c0>

    def set_channel(self, channel: AbstractChannel):
>       connection = channel.connection
E       AttributeError: 'RobustChannel' object has no attribute 'connection'. Did you mean: '_connection'?

Python version: 3.10

Relevant library versions:
opentelemetry-api 1.20.0
opentelemetry-instrumentation 0.41b0
opentelemetry-instrumentation-aio-pika 0.41b0
opentelemetry-sdk 1.20.0
opentelemetry-semantic-conventions 0.41b0
pika 1.3.2
aio-pika 9.3.0

Steps to reproduce

  • Instrument an app that uses aio-pika version 9.3
  • Try to produce a message

What is the expected behavior?
Message produced

What is the actual behavior?
AttributeError is raised

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the aio-pika instrumentation's span_builder.py at set_channel, where the issue shows channel.connection raising AttributeError with aio-pika 9.3. Compare that access with the aio-pika 9.3 API and the dependency constraint in instrumentation/opentelemetry-instrumentation-aio-pika/pyproject.toml. Done means the reproduction can produce a message without this AttributeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.