otelcol/grpclog: suppress benign gRPC client-disconnect warnings#15024
Open
kruthiwusirika5 wants to merge 1 commit intoopen-telemetry:mainfrom
Open
otelcol/grpclog: suppress benign gRPC client-disconnect warnings#15024kruthiwusirika5 wants to merge 1 commit intoopen-telemetry:mainfrom
kruthiwusirika5 wants to merge 1 commit intoopen-telemetry:mainfrom
Conversation
|
|
Author
|
recheck |
Author
|
/easycla |
When a gRPC client closes normally, the transport layer emits warnings like "HandleStreams failed to read frame: EOF" and "connection reset by peer". These are expected during graceful shutdown and create noise for operators monitoring production collector deployments. Add a benignFilterCore zapcore.Core wrapper that intercepts warn-level entries matching known client-disconnect patterns and drops them before they reach the output sink. Non-benign warnings are unaffected. Fixes open-telemetry#5169
20d0b54 to
665e053
Compare
Author
|
/easycla |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5169
Problem
When a gRPC client disconnects normally (e.g., a .NET app shutting down its
TracerProvider), the collector logs spuriousWARNmessages from the gRPC transport layer:These are expected during graceful client shutdown but appear alarming to operators and pollute production logs.
Solution
Add a
benignFilterCore— azapcore.Corewrapper — that intercepts warn-level log entries matching known client-disconnect patterns (HandleStreams failed to read frame,connection reset by peer) and drops them before they reach the output sink.This approach:
strings.Containson the already-formatted message)Testing
Added three new test cases:
TestBenignClientCloseWarningsSuppressed— verifies the known patterns are not logged at warn levelTestNonBenignWarningsPreserved— verifies unrelated warnings still pass throughTestIsBenignClientCloseMessage— unit tests for the pattern-matching helper