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

Service Bus Async with Opentelemetry: receiver._add_span_request_attributes never awaited #29199

Closed
erewok opened this issue Mar 7, 2023 · 8 comments
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Messaging Messaging crew question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus

Comments

@erewok
Copy link

erewok commented Mar 7, 2023

  • Package Name:

    • azure-servicebus = "^7.8.2"
    • azure-core-tracing-opentelemetry = "^1.0.0b9"
  • Operating System: OSX/Debian Container python:3.11-slim-bullseye

  • Python Version: 3.11.2

Describe the bug
Async service-bus receiver with opentelemetry enabled warns:

/my-app/.venv/lib/python3.11/site-packages/azure/servicebus/_common/utils.py:287: RuntimeWarning: coroutine 'BaseHandler._add_span_request_attributes' was never awaited
  receiver._add_span_request_attributes(receive_span)  # type: ignore  # pylint: disable=protected-access
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

To Reproduce
Steps to reproduce the behavior:

I made a gist which reproduces this: https://gist.github.com/erewok/7cf27c54673f0e6fa0265e5ef24df6ff

Expected behavior
No warnings: span-context is added as expected.

Additional context
It looks like this method is async but it's being called by this sync method.

Worth noting: the python opentelemetry implementation may be changed in the future to support async spans.

Also: sending a message does not show the same warning in the logs.

@ghost ghost added customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 7, 2023
@github-actions github-actions bot added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Mar 7, 2023
@kashifkhan
Copy link
Member

Hi there @erewok . Thank you for the feedback, I think we had a similar issue where we addressed it but looks like another one snuck in.

@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Mar 7, 2023
@kashifkhan
Copy link
Member

Looks like it will be taken care of by this PR #28761

@erewok
Copy link
Author

erewok commented Mar 7, 2023

Sounds good @kashifkhan. We can close this one and I'll look for that release. Thanks for the update.

@kashifkhan kashifkhan self-assigned this Mar 7, 2023
@kashifkhan
Copy link
Member

Ill close it once it goes out :)

@erewok
Copy link
Author

erewok commented Mar 7, 2023

Appreciate it. Apologies: I should have searched before opening this. I just had this feeling that the async-servicebus+otel users would be a smallish group at this point... 🤷

@kashifkhan
Copy link
Member

@erewok no worries about that at all :)

@kashifkhan
Copy link
Member

Hi @erewok , we released a new version of azure-servicebus yesterday with the fix for this. Thank you :)

@erewok
Copy link
Author

erewok commented Mar 10, 2023

Sounds good. Thanks for letting me know.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Messaging Messaging crew question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Bus
Projects
None yet
Development

No branches or pull requests

2 participants