Add client-level MetricPublisher support to the S3 CRT client - #7299
Merged
jencymaryjoseph merged 2 commits intoAug 22, 2026
Merged
Conversation
davidh44
reviewed
Aug 21, 2026
davidh44
approved these changes
Aug 21, 2026
jencymaryjoseph
merged commit Aug 22, 2026
ee5cadf
into
feature/master/S3CRTMetricPublisher
4 of 5 checks passed
|
This pull request has been closed and the conversation has been locked. Comments on closed PRs are hard for our team to see. If you need more assistance, please open a new issue that references this one. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
The S3 CRT-based client (
S3AsyncClient.crtBuilder()) currently has noMetricPublishersupport - unlike thestandard client, there's no way to collect metrics from it. CRT already emits per-request telemetry
(
S3RequestMetrics, via theonTelemetrycallback added in aws-crt-java#928); this change wires it to the SDK'sMetricPublisherAPI for publishers configured on the builder (client level). Request-level andcopyObjectsupport will follow separately.Modifications
metricPublishers(Collection<MetricPublisher>)andaddMetricPublisher(MetricPublisher)toS3CrtAsyncClientBuilder.stays a no-op and no empty
ApiCallis emitted — all metrics come from CRT telemetry.S3CrtResponseHandlerAdapter.onTelemetry(...)publishes each underlying CRT request as its ownApiCall → ApiCallAttempt → HttpClientcollection (ServiceId,OperationName,ApiCallSuccessful,RetryCount,durations, request IDs,
HttpClientName=s3crt); a fanned-out transfer (e.g. a multipartgetObject) publishesone collection per underlying request.
METRIC_PUBLISHERSexecution attribute; unavailablemetrics are skipped per-metric and
onTelemetrynever throws back into the native callback.Follow-ups will add request-level publisher overrides,
copyObjectparity, expanded integration tests, andmore metrics as CRT exposes them (HTTP status- aws-crt-java#1011, endpoint URL, TTFB/TTLB,
connection-pool).
Testing
S3CrtResponseHandlerAdapterMetricsTest): mapping correctness, unavailable-metric skip, failedattempt (
ApiCallSuccessful=false), empty-publisher no-op, N callbacks → N collections, and retry (per-attemptcollections with increasing
RetryCount).S3CrtResponseHandlerAdapterTestupdated for the new constructor.S3CrtClientMetricPublisherIntegrationTest): single-partgetObject, multipartgetObject(fan-out),
putObject, and a failedgetObject, verifying the published collections (ServiceId=S3,non-zero
ApiCallDuration,HttpClientName=s3crt).Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License