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

Add xray.AWSSession to install handlers on session #97

Merged
merged 1 commit into from
Jul 3, 2019

Conversation

logan
Copy link
Contributor

@logan logan commented Apr 1, 2019

An application has to call xray.AWS for each AWS client it constructs.
This creates opportunities for blind spots if someone forgets to
configure a new client.

The xray.AWSSession installs the same handlers at the Session level.
Clients inherit handlers from the session they're created with. As long
as the application systematically reuses the same session to create
clients, it only needs to install X-Ray handlers once.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@logan logan force-pushed the aws-session branch 4 times, most recently from 4c1130b to 2f04984 Compare April 4, 2019 23:55
@logan logan force-pushed the aws-session branch 3 times, most recently from 0b43af7 to 0c0e329 Compare April 11, 2019 19:56
@logan logan force-pushed the aws-session branch 2 times, most recently from 85ad8d0 to 68c6f24 Compare April 30, 2019 23:23
@luluzhao
Copy link
Contributor

luluzhao commented May 7, 2019

Hey @logan , sorry for the delay. I will review it recently.

xray/aws.go Outdated Show resolved Hide resolved
@awssandra
Copy link

Hey Logan, we'd be happy to merge this in with a few edits. Or, we can pick it up. Thanks!

An application has to call xray.AWS for each AWS client it constructs.
This creates opportunities for blind spots if someone forgets to
configure a new client.

The xray.AWSSession installs the same handlers at the Session level.
Clients inherit handlers from the session they're created with. As long
as the application systematically reuses the same session to create
clients, it only needs to install X-Ray handlers once.
@logan
Copy link
Contributor Author

logan commented Jul 2, 2019

I've added tests for the two new functions, plus the existing AWSWithWhitelist. The whitelist variants do not test whitelist behavior, they just pass in the path to the default whitelist.

Travis doesn't seem to be enqueueing the test runs for this PR. but tests pass locally for me in go 1.12.

@luluzhao
Copy link
Contributor

luluzhao commented Jul 3, 2019

@logan Thank you so much for your contribution. Merged it.

@luluzhao luluzhao merged commit 9e635ca into aws:master Jul 3, 2019
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.

None yet

3 participants