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

Discard the otel logs #5146

Merged
merged 1 commit into from
Aug 27, 2024
Merged

Discard the otel logs #5146

merged 1 commit into from
Aug 27, 2024

Conversation

Warashi
Copy link
Contributor

@Warashi Warashi commented Aug 19, 2024

What this PR does / why we need it:

If the control plane disables the monitoring feature, piped's OTEL TracerProvider logs some errors because the otel collector does not exist.
It's not a problem, but we don't want to see error logs.
So we discard the otel logs.

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Copy link

codecov bot commented Aug 19, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 22.79%. Comparing base (71b46e0) to head (89cd6e8).
Report is 11 commits behind head on master.

Files Patch % Lines
pkg/app/piped/cmd/piped/piped.go 0.00% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5146   +/-   ##
=======================================
  Coverage   22.79%   22.79%           
=======================================
  Files         412      412           
  Lines       43827    43832    +5     
=======================================
+ Hits         9989     9992    +3     
- Misses      33050    33052    +2     
  Partials      788      788           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +245 to +249
// 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 logger.
otel.SetLogger(logr.Discard())

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 It's ok for now. However, if users want to investigate the otel behavior, it might be necessary.
If so, it would be nice to add the flag on whether to show the log.

Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, thanks 👍

@khanhtc1202 khanhtc1202 merged commit 30da3af into master Aug 27, 2024
17 checks passed
@khanhtc1202 khanhtc1202 deleted the otel-logger-discard branch August 27, 2024 13:39
This was referenced Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants