-
Notifications
You must be signed in to change notification settings - Fork 914
Mutiple metrics fixes #1930
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
Mutiple metrics fixes #1930
Conversation
5343501
to
90dbadd
Compare
}); | ||
return executeFuture; | ||
} catch (Throwable t) { | ||
Optional<MetricPublisher> metricPublisher = MetricUtils.resolvePublisher(clientConfiguration, | ||
List<MetricPublisher> metricPublisher = resolveMetricPublishers(clientConfiguration, |
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.
metricPublishers
?
@@ -1070,6 +1061,21 @@ public void close() { | |||
.exceptionBuilderSupplier(InvalidInputException::builder).httpStatusCode(400).build()); | |||
} | |||
|
|||
private static List<MetricPublisher> resolveMetricPublishers(SdkClientConfiguration clientConfiguration, |
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.
Out of curiosity, why do we move this method out of MetricUtils
?
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.
Discussed this with @millems. MetricUtils
is @SdkInternal
, and we'd rather keep it that way than expose it as a protected API.
client = clientWithPublishers(publisher1, publisher2); | ||
|
||
try { | ||
client.allTypes().join(); |
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.
minor: missing fail("no exception thrown")
, same as other tests.
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.
Is this necessary? It doesn't really matter if an exception is thrown or not; the test is just just checking that the right publishers are being used based on configuration. It just happens to throw here because the mock isn't fully set up
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.
oh okay, I misread the test. We don't need it in this case
f8875ae
to
d0ec398
Compare
- Allow lists of publishers to be set. Allow setting of metric pubishers to be set on the client of request override rather than a single publisher, making using multiple MetricPublishers per client or request easier. - Remove any non-core usage of MetricUtils. - Fix metrics test in TranscribeStreamIntegrationTest. - Fix Async API call metric stage to add the duration in a separate CompletionStage.
d0ec398
to
db2a251
Compare
SonarCloud Quality Gate failed.
|
…f6b14e58c Pull request: release <- staging/992b5738-47e8-4c5c-a162-db9f6b14e58c
Description
Allow lists of publishers to be set.
Allow setting of metric pubishers to be set on the client of request override
rather than a single publisher, making using multiple MetricPublishers per
client or request easier.
Remove any non-core usage of MetricUtils.
Fix metrics test in TranscribeStreamIntegrationTest.
Motivation and Context
Testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsLicense