Add metrics/observability support for AsyncAppenderBase#1006
Open
guizmaii wants to merge 8 commits intoqos-ch:masterfrom
Open
Add metrics/observability support for AsyncAppenderBase#1006guizmaii wants to merge 8 commits intoqos-ch:masterfrom
guizmaii wants to merge 8 commits intoqos-ch:masterfrom
Conversation
05712ff to
546c703
Compare
147895c to
0518f23
Compare
Signed-off-by: Jules Ivanic <jules.ivanic@gmail.com>
0518f23 to
0cd1af8
Compare
Signed-off-by: Jules Ivanic <jules.ivanic@gmail.com>
Signed-off-by: Jules Ivanic <jules.ivanic@gmail.com>
Signed-off-by: Jules Ivanic <jules.ivanic@gmail.com>
Signed-off-by: Jules Ivanic <jules.ivanic@gmail.com>
cf65ef3 to
5b29efe
Compare
Signed-off-by: Jules Ivanic <jules.ivanic@gmail.com>
Signed-off-by: Jules Ivanic <jules.ivanic@gmail.com>
Signed-off-by: Jules Ivanic <jules.ivanic@gmail.com>
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.
Summary
This PR adds observability/metrics support for the
AsyncAppenderBaseclass, addressing the request in issue #754.New public methods:
getTotalAppendedCount()- Returns the total number of events submitted to append()getDiscardedByThresholdCount()- Returns events discarded because the queue was nearly full and the event was deemed discardablegetDiscardedByQueueFullCount()- Returns events discarded when the queue was completely full (neverBlock=true mode)getTotalDiscardedCount()- Returns the sum of all discarded eventsgetDispatchedCount()- Returns the number of events successfully dispatched to the attached appendergetFailedDispatchCount()- Returns the number of events that failed during dispatch (uncaught exceptions)resetMetrics()- Resets all counters to zeroDesign decisions:
LongAdderinstead ofAtomicLongfor better performance under high contention from multiple threads.Use cases:
These metrics enable users to:
Test plan
getTotalAppendedCount()getDiscardedByThresholdCount()getDiscardedByQueueFullCount()getDispatchedCount()getFailedDispatchCount()resetMetrics()mvn test -pl logback-core -Dtest=AsyncAppenderBaseTestCloses #754