-
Notifications
You must be signed in to change notification settings - Fork 156
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
Discard otel errors #5193
Discard otel errors #5193
Conversation
Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
// if control plane's flag monitoring.enabled is false, otel provider logs errors. | ||
// it's no problem but we don't want to see it. | ||
// so we discard the errors and the logs. | ||
otel.SetErrorHandler(otel.ErrorHandlerFunc(func(err error) {})) | ||
otel.SetLogger(logr.Discard()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have to set global ErrorHandler and Logger before we create the tracer providers.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5193 +/- ##
==========================================
- Coverage 22.86% 22.84% -0.02%
==========================================
Files 420 420
Lines 45247 45245 -2
==========================================
- Hits 10344 10338 -6
- Misses 34108 34112 +4
Partials 795 795 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
What this PR does / why we need it:
This PR discards all errors and logs from the otel library.
Without this PR, we will see error logs when an error occurs, like the one below.
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?: