-
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
Custom logging level to Application Insight does not work as expected #33980
Comments
@yli02 thanks for your issue, the library owners will take a look soon and respond. |
OTEL_LOG_LEVEL is not implemented yet by opentelemetry-python due to a spec dispute I think I understand your confusion, though. In opentelemetry-python, the OTel logging is built on native python logging which is hierarchical. Take the following example:
Because no logger_name was passed in, the root logger is instrumented. This means all logs are captured if they pass their respective logger's levels. So,
In this case, only |
@jeremydvoss thanks a lot for your explanations. We actually configured the monitoring to be the 2nd case you mentioned. But I was thinking that during development time, I could set |
I am not sure I understand. The link here does not mention OTEL_LOG_LEVEL, which I explained does not currently do anything. Could you explain what your desired behavior is? |
Hi @yli02. 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. |
@jeremydvoss sorry for the delay in replying. I think the example you have given should be fine for our use case, I will close this bug report. |
Describe the bug
The documentation at [1] in footnote 4 told that we could use the reference link to setup logging level to send to Application Insight. I have tried to set
APPLICATIONINSIGHTS_INSTRUMENTATION_LOGGING_LEVEL="INFO"
to environment variable, however, it still sends debug log to Application Insights, as the instrument logger is set with logging levelDEBUG
. I also tried to setOTEL_LOG_LEVEL
toINFO
, which also don't work, debug logs are still sent to Application Insights.To Reproduce
Steps to reproduce the behavior:
DEBUG
configure_azure_monitor
function to bind to the logger created in 1st stepdebug
method from 1st step created logger to be sent to Application Insights.Expected behavior
Log level specified to send to Application Insights should be effective.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
The
python:3.8.18-slim
is a docker image.[1] https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-add-modify?tabs=python%2Cpython-1%2Cpython-2%2Cpython-3%2Cpython-4%2Cpython-5%2Cpython-6%2Cpython-8%2Cpython-9%2Cpython-10%2Cpython-11%2Cpython-12%2Cpython-13%2Cpython-14%2Cpython-15#included-instrumentation-libraries
[2] https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/#general-sdk-configuration
The text was updated successfully, but these errors were encountered: