-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Azure Monitor opentelemetry exporter uses deprecated locale.getdefaultlocale #32232
Comments
Thanks for the feedback, we’ll investigate asap. |
There's also another deprecation warning in similar code (opentelemetry):
|
@pamelafox Yes I actually reported that one over here open-telemetry/opentelemetry-python-contrib#1970 (this issue was fixed in opentelemetry sdk/api a few months ago but not in contrib/instrumentation yet |
Interesting that you are seeing the warning messages. DeprecationWarnings should be ignored for code that is not directly executed from main but this might come up possibly in CI runs. Regardless, it seems that |
I don't know about @jenshnielsen but I use pytest to test our app code, and pytest defaults to showing warnings like the deprecation warnings, so they add a lot of noise to pytest output. We can filter them out but it's always nicer when code is upgraded, where it makes sense. |
I indeed noticed it via our test suite and pytest too. |
There's a pr in upstream opentelemetry that will fix this issue |
Describe the bug
Using Azure Monitor Opentelemetry exporter triggers a deprecation warning
C:\Users\jenielse\Miniconda3\envs\myenv\Lib\site-packages\azure\monitor\opentelemetry\exporter_utils.py:57: DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
"ai.device.locale": locale.getdefaultlocale()[0],
To Reproduce
Steps to reproduce the behavior:
Or any other opteration that triggers an import of _utils.py from the package
Expected behavior
No deprecation warning.
Additional context
Afaik this only became deprecated in python 3.11
Note however that on windows the replacement has some issues python/cpython#82986
The text was updated successfully, but these errors were encountered: