-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Eventhub Opentelemetry Trace exception: "'MessageProperties' object has no attribute 'setdefault'" #27986
Comments
Hi @erewok thanks for the detailed issue, we'll take a look and get back to you as soon as possible. |
Hi @erewok - Thanks for the investigation! It was very helpful in helping reproduce/track down the bug. We've made a few big changes recently to the SDK, so the fix will be a little bit more complex. We're working on it right now and will keep you posted on any updates. Thanks! |
@swathipil, great! Glad to hear it and glad that this issue was useful. Thanks for following up. |
fixes bug in: #27986 changes: - removed duplicate tracing which was adding the `Azure.EventHubs.Message` span twice when sending a batch message/list of messages. - adding the tracing info the uamqp/pyamqp.Message application_properties rather than event_data. Ensures that the diagnostic ID is actually being added on the outgoing Message, rather than the EventData after outgoing Message has already been created. - Adding the FakeSpan class to `tests` folder to test telemetry. TODO: - follow-up issue created to address implementation so it behaves correctly in a separate PR: #28141
Hi @erewok - The fix for this bug has been merged and will be included in the upcoming release: If you'd like to test the fix in the meantime, you can build and install the wheel by:
Thanks! |
Hi @erewok. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “ |
Thanks for the update, @swathipil! I will wait until the latest version is up on PyPi. I appreciate the help. |
Hi @erewok, since you haven’t asked that we “ |
azure-eventhub
5.10.1
Describe the bug
Today in an experiment with adding tracing spans to our
EventhubProducerClient
calls, I followed a helpful example provided by the packageazure-core-tracing-opentelemetry
.After some tracing spans were produced, I noticed an exception in the logs (but these did not prevent events from being published):
In the
_utils.py
module, there's a function calledtrace_message
with a few lines like this:Here, if
event.properties
is truthy, then it will not be a Pythondict
(as in my case), and instead it's an instance ofMessageProperties
from theuamqp
library, which has nosetdefault
function.To fix it, we could indent
setdefault
under theif not event.properties
and add anelse
that sets the property differently forMessageProperties
.I would be happy to submit a PR for this change if it is useful.
To Reproduce
Steps to reproduce the behavior:
EventhubProducerClient
Screenshots
Expected behavior
No exceptions when instrumenting Eventhub calls with opentelemetry tracing spans.
The text was updated successfully, but these errors were encountered: