-
Notifications
You must be signed in to change notification settings - Fork 916
Support core metrics for async non-streaming and streaming operations #1889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
9b29c03
to
661077a
Compare
core/metrics-spi/src/main/java/software/amazon/awssdk/metrics/NoOpMetricCollector.java
Show resolved
Hide resolved
test/codegen-generated-classes-test/src/test/resources/jetty-logging.properties
Show resolved
Hide resolved
...classes-test/src/test/java/software/amazon/awssdk/services/metrics/AsyncCoreMetricsTest.java
Outdated
Show resolved
Hide resolved
core/sdk-core/src/test/java/software/amazon/awssdk/core/util/MetricUtilsTest.java
Outdated
Show resolved
Hide resolved
core/sdk-core/src/test/java/software/amazon/awssdk/core/util/MetricUtilsTest.java
Show resolved
Hide resolved
04ea3a0
to
a26d4aa
Compare
a26d4aa
to
bfbea76
Compare
bfbea76
to
df636f1
Compare
.metricPublisher(new MetricPublisher() { | ||
@Override | ||
public void publish(MetricCollection metricCollection) { | ||
System.out.println(metricCollection); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: remove print
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in #1895
httpClientFuture.whenCompleteAsync((r, t) -> { | ||
long duration = System.nanoTime() - callStart; | ||
metricCollector.reportMetric(CoreMetric.HTTP_REQUEST_ROUND_TRIP_TIME, Duration.ofNanos(duration)); | ||
}, futureCompletionExecutor); | ||
return httpClientFuture; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this account for errors that result in no HTTP request being sent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems there's no way to tell if the cause of the error is http request not being sent or http response not being received. I can update it to not report HTTP_REQUEST_ROUND_TRIP_TIME
if there's an error, WDUT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think that's more reasonable. Having this metric in there if the request didn't get fully sent or we didn't receive a response might be misleading.
Kudos, SonarCloud Quality Gate passed!
|
…97b8497d6 Pull request: release <- staging/b8382d15-ae8a-46fe-808a-c0897b8497d6
Description
Support core metrics for async non-streaming and streaming operations
This might or might not be the last part depending on my findings in even streaming signingEventstreaming core metrics support will be in another PR
License