-
Notifications
You must be signed in to change notification settings - Fork 853
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
Add SERVICE_ENDPOINT metric #4307
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cdeec3a
Implement SERVICE_ENDPOINT core metric
dave-fn 439e965
Create CollectionStages for SERVICE_ENDPOINT
dave-fn 8164d60
Remove erviceEndpointMetricCollectionStages since they're unnecessary
dagnir faa8de0
Move collection of SERVICE_ENDPOINT metric
dagnir bcee6c8
Remove unused import
dagnir 9335736
Update changelog entry
dagnir ba89f47
Fix test
dagnir 7eaa5d6
Remove unused class
dagnir 6f38088
Merge branch 'master' into dongie/service-endpoint-metric
dagnir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"category": "AWS SDK for Java v2", | ||
"contributor": "", | ||
"type": "bugfix", | ||
"description": "Add support for the `SERVICE_ENDPOINT` metric. This metric represents the endpoint (scheme and authority) that the request was sent to." | ||
} |
This file contains 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
This file contains 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
53 changes: 53 additions & 0 deletions
53
...wssdk/core/internal/http/pipeline/stages/ServiceEndpointAttemptMetricCollectionStage.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.awssdk.core.internal.http.pipeline.stages; | ||
|
||
import static software.amazon.awssdk.core.internal.util.MetricUtils.collectServiceEndpointMetrics; | ||
import static software.amazon.awssdk.core.internal.util.MetricUtils.createAttemptMetricsCollector; | ||
|
||
import software.amazon.awssdk.annotations.SdkInternalApi; | ||
import software.amazon.awssdk.core.Response; | ||
import software.amazon.awssdk.core.internal.http.RequestExecutionContext; | ||
import software.amazon.awssdk.core.internal.http.pipeline.RequestPipeline; | ||
import software.amazon.awssdk.core.internal.http.pipeline.RequestToResponsePipeline; | ||
import software.amazon.awssdk.http.SdkHttpFullRequest; | ||
import software.amazon.awssdk.metrics.MetricCollector; | ||
|
||
/** | ||
* Wrapper pipeline that initializes and tracks the API call attempt metric collection. This wrapper and any wrapped | ||
* stages will track API call attempt metrics. | ||
*/ | ||
@SdkInternalApi | ||
public final class ServiceEndpointAttemptMetricCollectionStage<OutputT> implements RequestToResponsePipeline<OutputT> { | ||
private final RequestPipeline<SdkHttpFullRequest, Response<OutputT>> wrapped; | ||
|
||
public ServiceEndpointAttemptMetricCollectionStage(RequestPipeline<SdkHttpFullRequest, Response<OutputT>> wrapped) { | ||
this.wrapped = wrapped; | ||
} | ||
|
||
@Override | ||
public Response<OutputT> execute(SdkHttpFullRequest input, RequestExecutionContext context) throws Exception { | ||
MetricCollector apiCallAttemptMetrics = createAttemptMetricsCollector(context); | ||
context.attemptMetricCollector(apiCallAttemptMetrics); | ||
|
||
Response<OutputT> response = wrapped.execute(input, context); | ||
|
||
collectServiceEndpointMetrics(apiCallAttemptMetrics, input); | ||
|
||
return response; | ||
} | ||
|
||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
I don't see this class being used anywhere?