Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError when extracting tags from pika BlockingChannel #354

Closed
ghost opened this issue Mar 13, 2022 · 0 comments · Fixed by #355
Closed

AttributeError when extracting tags from pika BlockingChannel #354

ghost opened this issue Mar 13, 2022 · 0 comments · Fixed by #355

Comments

@ghost
Copy link

ghost commented Mar 13, 2022

Typo in https://github.com/instana/python-sensor/blob/master/instana/instrumentation/pika.py#L121 causes AttributeError when setting span tags.

2022-03-10 15:47:48,593: 1 DEBUG instana: basic_consume_with_instana:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/instana/instrumentation/pika.py", line 121, in _cb_wrapper
    _extract_consumer_tags(scope.span,
  File "/usr/local/lib/python3.8/site-packages/instana/instrumentation/pika.py", line 33, in _extract_consumer_tags
    _extract_broker_tags(span, conn)
  File "/usr/local/lib/python3.8/site-packages/instana/instrumentation/pika.py", line 21, in _extract_broker_tags
    span.set_tag("address", "%s:%d" % (conn.params.host, conn.params.port))
AttributeError: 'BlockingConnection' object has no attribute 'params'

Pika's BlockingConnection uses composition instead of inheritance. Therefore, the params field is not available in its parent but rather in its _impl attribute. This is done for consume_with_instana wrapper but not for basic_consume_with_instana wrapper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants