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

contrib/aws: add aws-sdk-go-v2 support package #923

Merged
merged 9 commits into from
Jun 29, 2021

Conversation

speza
Copy link
Contributor

@speza speza commented May 12, 2021

Introduce tracing contrib for the aws-sdk-go-v2. This uses the new aws-sdk-go-v2 middleware to hook into the lifecycle of the request built and sent to AWS.

Fixes #869

@speza speza changed the title contrib/aws: Introduce tracing middleware for aws-sdk-go-v2 contrib/aws: add aws-sdk-go-v2 support package May 12, 2021
@knusbaum knusbaum added this to the 1.32.0 milestone May 26, 2021
Copy link
Contributor

@knusbaum knusbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@speza Thank you for this.
I have a few nitpicks about the code.

contrib/aws/aws-sdk-go-v2/aws/example_test.go Outdated Show resolved Hide resolved
contrib/aws/aws-sdk-go-v2/aws/aws.go Outdated Show resolved Hide resolved
contrib/aws/aws-sdk-go-v2/aws/aws.go Outdated Show resolved Hide resolved
contrib/aws/aws-sdk-go-v2/aws/aws.go Outdated Show resolved Hide resolved
contrib/aws/aws-sdk-go-v2/aws/aws_test.go Outdated Show resolved Hide resolved
Introduce tracing contrib for the aws-sdk-go-v2. This uses the new aws-sdk-go-v2 middleware to hook into the lifecycle of the request built and sent to AWS.

Fixes DataDog#869
@speza speza force-pushed the feat/#869_contrib_aws_sdk_go_v2_b branch from 2dd6a84 to b23c3e5 Compare May 28, 2021 07:23
@speza
Copy link
Contributor Author

speza commented May 28, 2021

@knusbaum I have made the changes. I think the test is failing due to a tagging issue for release?

Copy link
Contributor

@knusbaum knusbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good now.
If you could add a couple more tests to improve the test coverage (https://app.codecov.io/gh/DataDog/dd-trace-go/compare/923/diff) I think we'll be good.
It might not be feasible to get to 100% coverage, but we would like it as high as we can reasonably get.

* More coverage in core middleware

* Removed the use of SpanFromContext bool as we will always have a span if the middleware has been added. Otherwise, using a no-op is ok anyway. This simplifies the logic.

* More coverage on options.

Fixes DataDog#869
@speza
Copy link
Contributor Author

speza commented Jun 10, 2021

@knusbaum I think this should be good now? The only line not tested is for the environment variable options. But this seems to be the same throughout all the contrib package.

}

return out, metadata, err
}), middleware.Before)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this to Before. Actually missed test coverage on GetRequestIDMetadata and there was a bug. The AWS middleware for setting the request ID was happening after our middleware.

Copy link
Contributor

@knusbaum knusbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Glad we caught that bug.

@speza
Copy link
Contributor Author

speza commented Jun 22, 2021

Thanks @knusbaum. Not sure why its failing on codecov/patch...

@knusbaum
Copy link
Contributor

@speza Current coverage requirement is 100%.
I'm working on lowering that to 90% here: #954

@knusbaum knusbaum merged commit 74f84d7 into DataDog:v1 Jun 29, 2021
@speza speza deleted the feat/#869_contrib_aws_sdk_go_v2_b branch June 30, 2021 07:17
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.

proposal: support aws-sdk-go-v2
2 participants