Skip to content

Maintenance: avoid attaching two middlewares when appending UA to AWS SDK #1578

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

Closed
1 of 2 tasks
dreamorosi opened this issue Jul 5, 2023 · 2 comments · Fixed by #1583
Closed
1 of 2 tasks

Maintenance: avoid attaching two middlewares when appending UA to AWS SDK #1578

dreamorosi opened this issue Jul 5, 2023 · 2 comments · Fixed by #1583
Assignees
Labels
commons This item relates to the Commons Utility completed This item is complete and has been merged/shipped internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)

Comments

@dreamorosi
Copy link
Contributor

Summary

In #1577, #1575, and #1567 we have added logic that appends a user agent to AWS SDK requests by leveraging the middleware stack of the AWS SDK v3. The current setup however does not take in account the fact that customers might pass us the same client more than once (i.e. create a client > instrument it with Tracer > pass it to Parameters / Idempotency).

Why is this needed?

The current implementation will log a warning that informs the user that Powertools was not able to apply the middleware, this could be misleading.

Which area does this relate to?

Other

Solution

We should make sure that this case is handled correctly by either: 1/ making the operation idempotent (like the X-Ray SDK itself does when instrumenting), 2/ appending the second user agent (like suggested here), 3/ converting operation to a no-op if the middleware is already there.

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

@dreamorosi dreamorosi added internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.) discussing The issue needs to be discussed, elaborated, or refined commons This item relates to the Commons Utility labels Jul 5, 2023
@dreamorosi dreamorosi changed the title Maintenance: TITLE Maintenance: avoid attaching two middlewares when appending UA to AWS SDK Jul 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 5, 2023

⚠️ COMMENT VISIBILITY WARNING ⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions github-actions bot added pending-release This item has been merged and will be released soon and removed discussing The issue needs to be discussed, elaborated, or refined labels Jul 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 11, 2023

This is now released under v1.11.1 version!

@github-actions github-actions bot added completed This item is complete and has been merged/shipped and removed pending-release This item has been merged and will be released soon labels Jul 11, 2023
@dreamorosi dreamorosi moved this from Coming soon to Shipped in Powertools for AWS Lambda (TypeScript) Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commons This item relates to the Commons Utility completed This item is complete and has been merged/shipped internal PRs that introduce changes in governance, tech debt and chores (linting setup, baseline, etc.)
Projects
2 participants