-
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
[SB][pyamqp][OTEL] pyamqp tracing is missing values for amqpLink
and amqpSession
#32190
Comments
Hi @macieyng - Thanks for opening an issue! We'll take a look asap! Can you also provide the following info?
|
Hi @macieyng. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue. |
|
Ah this is very interesting - thanks for reporting @macieyng! It should be a simple update - though it would be a relatively extensive one. |
While there's probably other ways to resolve this, I think simply changing the log formatting might be the easiest. We will however need to test what this means for people logging with the existing parameters. |
Actually after some thought and re-reading the error message - this might simply be because we are defaulting So this might be a very simple fix - but needs some further testing. |
@annatisch - We don't have the logging parameters documented but have an issue here (#32220) to address the troubleshooting documentation during the upcoming MQ. @macieyng - Thanks for your logs! I see a few errors in there that look like: We're not passing |
Hi @macieyng. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue. |
I don't agree with that. This will result in sending empty strings to analytic tools (like Application Insights) which would add more noise and increase size of ingested data (not a lot for a single request, but quite a lot if you have a lot of traffic). If you think that it's crucial for users to know that
@swathipil yes, this is something we're sending. I was filtering logs with regex, so that's a leftover probably. Not something you should be concerned about. |
Hi @macieyng - Having "amqpLink"/"amqpSession" logged as either an empty string or None is useful for debugging scenarios to establish that they haven't been created yet or are being re-created. We're currently looking into whether this error might be an issue with either opentelemetry or the Azure Monitor otel exporter package. Will keep you updated.
For clarification, "amqpSession" and
For your purposes of tracking a Service Bus session, you should not be tracking the "amqpSession" logging parameter. The "amqpLink/Session/Connection" are for advanced usage & debugging. Thanks. |
@lzchen @jeremydvoss - Would you be able to take a look and see if this could be an issue with the Currently, we're passing in "amqpLink"/"amqpSession"=None as |
This error is generated by the upstream opentelemetry api library. This is because
|
Thanks for the info @lzchen! |
The only validation from the opentelemetry python sdk that is surfaced will be warning logs that you see above (they should never throw an exception). OpenTelemetry api uses _clean_attributes to validate OpenTelemetry attributes from a dictionary. Technically you can use that for any additional fields (specifically |
Yes, we're using
This is smart and when you said it it seems obvious! Should be a part of guidelines, recommendation or docs. And actually kind of aligns with the fact that we only recently have introduced our own namespace. But then, how I would be able to tell if some of my application issues are not related to other packages I'm using. If I attach to root logger then I have a big picture of the situation when error occur in one place (UI). Listing all packages I have in dictConfig doesn't make sense. Picking specific packages - that's still few of them, but doable.
I do agree with that! |
That is a good question. Ideally we have some way to suppress logging calls made with our exporter (this would be a feature in upstream opentelemetry). If you think this would be a useful feature, you could make a feature request to configure to ignore loggers in a logger tree that a handler is added to. Depending on your project, you can probably rearrange your folder structure to take advantage of python logger's hierarchy structure with namespace to capture only the logs you want. |
Hi @macieyng - Sorry for the delay on this. The fix will be included in the upcoming release. Thanks! |
Describe the bug
We get logs like
Looks like pyamqp distributed tracing is trying to add attributes to the span that are clearly empty.
To Reproduce
Use Azure SB with pyamqp and enable opentelemetry instrumentation. Try sending some messages.
Expected behavior
amqpLink
andamqpSession
is not an empty value or if it's an empty value then it's not added as attribute to the span.Screenshots
![Zrzut ekranu 2023-09-22 o 10 08 01](https://private-user-images.githubusercontent.com/82878433/269877541-c714c7fd-b597-4f97-8496-21d2d6ce96d6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA5OTA3NzAsIm5iZiI6MTcyMDk5MDQ3MCwicGF0aCI6Ii84Mjg3ODQzMy8yNjk4Nzc1NDEtYzcxNGM3ZmQtYjU5Ny00Zjk3LTg0OTYtMjFkMmQ2Y2U5NmQ2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTQlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE0VDIwNTQzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTgwYmJlNDM2YzRkYjg0NTg0MTNjNTc5YzE1MmRhNTc1YTg0NzM2NWYzNDA2ZDU4OWJhYzUxN2Q2YjBiOWJiZTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.1GIPpmj7NSpDHtBcDyY2eITQevjrB2w-p3HDBEpKmNY)
Additional context
As a library user I would like to know if there's an issue, but this logs would come up too often and would only increase our bill.
The text was updated successfully, but these errors were encountered: