Skip to content
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

feature: Invocation ID interceptor #2626

Merged
merged 4 commits into from
Apr 25, 2023
Merged

Conversation

Velfi
Copy link
Contributor

@Velfi Velfi commented Apr 24, 2023

Motivation and Context

part of #1793

Description

This adds an interceptor for AWS SDK requests. The interceptor is run just before the retry loop and adds a header with name amz-sdk-invocation-id and value that's a UUID. AWS services use this identifier to more efficiently process requests.

Testing

This change includes tests


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@Velfi Velfi requested a review from a team as a code owner April 24, 2023 19:47
@github-actions
Copy link

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

…/InvocationIdDecorator.kt

Co-authored-by: John DiSanti <jdisanti@amazon.com>
@Velfi Velfi added this pull request to the merge queue Apr 25, 2023
@github-actions
Copy link

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

Merged via the queue into main with commit f271da4 Apr 25, 2023
@Velfi Velfi deleted the add/invocation-id-interceptor branch April 25, 2023 15:17
david-perez pushed a commit that referenced this pull request May 18, 2023
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
part of #1793 

## Description
<!--- Describe your changes in detail -->
This adds an interceptor for AWS SDK requests. The interceptor is run
just before the retry loop and adds a header with name
`amz-sdk-invocation-id` and value that's a UUID. AWS services use this
identifier to more efficiently process requests.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
This change includes tests

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: John DiSanti <jdisanti@amazon.com>
david-perez pushed a commit that referenced this pull request May 22, 2023
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
part of #1793 

## Description
<!--- Describe your changes in detail -->
This adds an interceptor for AWS SDK requests. The interceptor is run
just before the retry loop and adds a header with name
`amz-sdk-invocation-id` and value that's a UUID. AWS services use this
identifier to more efficiently process requests.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
This change includes tests

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: John DiSanti <jdisanti@amazon.com>
david-perez pushed a commit that referenced this pull request May 22, 2023
## Motivation and Context
<!--- Why is this change required? What problem does it solve? -->
<!--- If it fixes an open issue, please link to the issue here -->
part of #1793 

## Description
<!--- Describe your changes in detail -->
This adds an interceptor for AWS SDK requests. The interceptor is run
just before the retry loop and adds a header with name
`amz-sdk-invocation-id` and value that's a UUID. AWS services use this
identifier to more efficiently process requests.

## Testing
<!--- Please describe in detail how you tested your changes -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->
This change includes tests

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: John DiSanti <jdisanti@amazon.com>
github-merge-queue bot pushed a commit that referenced this pull request May 30, 2024
## Motivation and Context
The `invoke` debug span now includes invocation IDs for operation
invocations. It is a random unique ID per client and shared across
retries for the same operation.
 
Example debug trace output with the changes in this PR:
```
2024-05-29T17:50:22.230526Z DEBUG invoke{service=s3 operation=ListObjectsV2 sdk_invocation_id=4652364}:try_op:try_attempt: aws_smithy_runtime_api::client::interceptors::context: entering 'before deserialization' phase
```

## Description
Note that this invocation ID is currently for internal use only to
improve debuggability when looking at logs (usually with customers).
Note also that the invocation ID is not related to [that used in
amz-sdk-invocation-id](#2626)
(we [attempted to make it
related](#3661) but decided
to go for this two-way door approach).

In sum, this PR is meant to be simple, and if we are to augment the
functionality (e.g. make the ID configurable or make it related to that
in `amz-sdk-invocation-id`), we can do so without breaking anything.

## Testing
Relies on the existing tests in CI

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
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.

3 participants