-
Notifications
You must be signed in to change notification settings - Fork 443
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
Disable internal otel logging #2611
Comments
You can add a custom log-handler, with custom processing that could be to ignore the error logs -
Though recommendation would be to fix the error :) |
The error happens when our collector is overloaded. Not much I can do about that, and it's not something clients can do anything about or should even know. And just dumping data to stdout from a library seems very problematic. A tracing library should NEVER impact functionality of an application no matter what, even if it's not able to export spans. Dumping random stuff to stdout is very likely to cause actual problems. At the very least it should go to stderr by default, but even then, having a library write logs without explicit configuration seems very questionable to me. |
For an application using opentelemetry-cpp, we (speaking for the app, not as a maintainer) decided to implement a custom handler, and implement an extra log level setting : SILENT, by printing nothing in the custom log handler. Having a SILENT log level supported in opentelemetry-cpp natively would help and make things simpler. The motivation for silencing errors entirely is in particular during tests, because errors printed from opentelemetry-cpp in stdout affect the test output, causing functional tests of the app to fail even when the app is working normally. Whether using a SILENT log level in production is desirable or not is up to the application, but at least I think (now speaking as a maintainer) that opentelemetry-cpp should support log level SILENT. For robustness reasons, assuming one day we discover a crashing bug in an error code path (say, crashing while printing more data in the error log), having the possibility to disable this crashing code path would also allow the application to survive in a degraded mode, at least as a work around: defense in depth. |
Can I suggest making silent the default? Like you said, content on stdout is bad for tests, but it's even worse for actual production code. Not everything using tracing is a daemon that just logs to stdout. My app has a small portion that can be used as part of a unix pipeline doing ETL work and having random stuff on stdout is not something I can even remotely deal with. |
The spec does not even enumerate possible values for
I think we can have a Note that opentelemetry-cpp does not support |
Indeed, having the default log handler print to |
Yes, it was me, probably writing this while feeling 😪 .
|
I think it is safe to:
@lalitb If this sounds good, I can make a PR for it. |
Yes, I think we should fix the code. Don't think it is feasible to do it withot breaking SDK ABI. Thanks :) |
Is it possible to disable the otel error logs? Specifically, the log messages such as
I can't seem to find any settings to set the log level of these or turn them off
The text was updated successfully, but these errors were encountered: