Skip to content
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

bugfix(auto-instrumentation): attach OTLPHandler to root logger #2450

Merged
merged 9 commits into from
Feb 10, 2022

Conversation

srikanthccv
Copy link
Member

Description

Fixes #2448

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

@srikanthccv srikanthccv requested a review from a team February 8, 2022 10:55
@srikanthccv srikanthccv added the Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary label Feb 9, 2022
@lzchen lzchen merged commit e0a4f31 into open-telemetry:main Feb 10, 2022
@srikanthccv srikanthccv deleted the issue-2448 branch February 10, 2022 16:58
@moriyoshi
Copy link

moriyoshi commented May 26, 2022

I don't think this patch is good for everyone. This forces the root logger to have the SDK's LogHandler instance no matter if auto instrumentation is applied for logging, more specifically even if it's explicitly disabled through OTEL_PYTHON_DISABLED_INSTRUMENTATIONS, _init_logging() just leaves the uncalled-for log handler set and hence the logger won't be reset by logging.basicConfig() because the logger initialization is done implicitly within the first call to logging.getLogger(). I strongly recommend this patch should be reverted and reconsider how to handle this situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approve Public API check This label shows that the public symbols added or changed in a PR are strictly necessary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot set the OTLP log exporter with auto instrumentation.
4 participants