Skip to content

Add compact format to LoggingMetricPublisher - #7451

Open
Dricmoy wants to merge 1 commit into
aws:masterfrom
Dricmoy:feature/compact-metric-logging
Open

Dricmoy wants to merge 1 commit into
aws:masterfrom
Dricmoy:feature/compact-metric-logging

Conversation

@Dricmoy

@Dricmoy Dricmoy commented Oct 16, 2026 •

Copy link
Copy Markdown

Motivation and Context

Closes #6840. LoggingMetricPublisher currently offers PLAIN and PRETTY, 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

  • Add LoggingMetricPublisher.Format.COMPACT, producing output such as Metrics published: ApiCall{RetryCount=0,ApiCallAttempt{HttpStatusCode=200}}.
  • Document the new public format and cover nested, sibling, and empty collections in unit tests.
  • Add a release note generated with scripts/new-change.

Testing

Validated commit 5bb7fc1b00f478173830175c2c686bb48c5a12e3 on macOS arm64 with JDK 21.0.11 and Maven wrapper 3.9.5:

./mvnw -B -ntp -pl :metrics-spi -am clean install

The run used isolated -s and -gs settings for a public Maven Central mirror.

  • Clean install of metrics-spi and its required reactor modules passed, including packaging, Javadoc, dependency analysis, and the configured API compatibility check.
  • All 25 metrics-spi tests passed, including the compact logging cases.
  • Dependency tests passed: utils reported 939 tests with 156 skipped and no failures/errors; test-utils passed all 50 tests.
  • Checkstyle passed with zero violations in the selected Java modules.
  • SpotBugs reported zero findings and zero analysis errors in metrics-spi, annotations, and utils. The earlier annotations failure did not reproduce in this clean run; no code changes or command-line quality-check skips were needed.

The full repository suite and AWS integration tests were not run. Hosted CI has not reported checks on this PR.

Screenshots (if appropriate)

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local scoped run of ./mvnw -pl :metrics-spi -am clean install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed (focused reactor tests passed; full repository suite was not run)
  • I have added a changelog entry using scripts/new-change
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

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.
@Dricmoy
Dricmoy marked this pull request as ready for review November 24, 2026 15:44
@Dricmoy
Dricmoy requested a review from a team as a code owner November 24, 2026 15:44

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compact logging format for LoggingMetricPublisher

1 participant