Repository navigation
Conversation
Introduce a single-line format that retains metric collection hierarchy while removing repeated class and field labels from logs. Cover nested and empty collections and document the new option. Resolves aws#6840.
This branch has not been deployed
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.
Motivation and Context
Closes #6840.
LoggingMetricPublishercurrently offersPLAINandPRETTY, both of which can produce verbose logs when metrics are emitted frequently. A single-line format reduces repeated labels while keeping the collection hierarchy readable.Modifications
LoggingMetricPublisher.Format.COMPACT, producing output such asMetrics published: ApiCall{RetryCount=0,ApiCallAttempt{HttpStatusCode=200}}.scripts/new-change.Testing
Environment: macOS arm64, JDK 21, Maven wrapper 3.9.5. These commands targeted
:metrics-spiand its required modules:./mvnw -pl :metrics-spi -am test -Dspotbugs.skip=true -Dcheckstyle.skip=true— passed; 25 metrics-spi tests, including the new cases../mvnw -pl :metrics-spi -am validate -Dspotbugs.skip=true— passed with zero Checkstyle violations../mvnw -pl :metrics-spi -am package -Dskip.unit.tests=true -Dspotbugs.skip=true— passed; unit tests were run in the separate test command above.SpotBugs was not verified locally: the initial run failed in the unchanged
annotationsmodule before reachingmetrics-spi.Screenshots (if appropriate)
N/A
Types of changes
Checklist
mvn installsucceedsscripts/new-changeLicense