-
Notifications
You must be signed in to change notification settings - Fork 652
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
OTEL_SDK_DISABLED=true combined with LogExporting causes: RecursionError: maximum recursion depth exceeded while calling a Python object #4255
Comments
This appears to have been caused by: #4208 |
I shortened the repro above and removed the dependency on opentelemetry-exporter-otlp. Original code copied here for reference:
import os
os.environ["OTEL_SDK_DISABLED"] = "true" import logging from opentelemetry import trace trace.set_tracer_provider(TracerProvider()) logger_provider = LoggerProvider( exporter = OTLPLogExporter(insecure=True) Attach OTLP handler to root loggerlogging.getLogger().addHandler(handler) Trace context correlationtracer = trace.get_tracer(name) |
Thanks for the bug report! We're hoping to fix it with a patch or reverting the culprit and make a patch release ASAP. More broadly, similar recursion issues have popped up a few times already. I think we need to carefully look at uses of stdlib logging and rework to make recursion impossible. |
Sounds good. We wrap otel configuration in a custom lib so I worked around it. |
Describe your environment
OS: Ubuntu 22.05
Python version: 3.10.12
SDK version: 1.28.0
API version: 1.28.0
What happened?
Trying to run the log exporter example code here: https://github.com/open-telemetry/opentelemetry-python/blob/06809f4e6a7084f7c79a1fd9e974fad9641a6b86/docs/examples/logs/example.py
with the environment variable: OTEL_SDK_DISABLED=true
raises a recursion error.
It looks like the act of trying to log the warning: "SDK is disabled." is causing a logger to be created, which is in then causing the warning: "SDK is disabled." to be logged, which is causing a logger to be created, repeat forever and ever.
Steps to Reproduce
pip install opentelemetry-sdk==1.28.0
Run the following code
Expected Result
No exception
Actual Result
Get the following exception:
Additional context
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: