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/aws-sdk-go: expose handler names as const #1524

Merged
merged 5 commits into from
Oct 21, 2022
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions contrib/aws/aws-sdk-go/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ const (
tagAWSRegion = "aws.region"
tagAWSRetryCount = "aws.retry_count"
tagAWSRequestID = "aws.request_id"
// SendHandlerName is the name of the Datadog NamedHandler for the Send phase of an awsv1 request
SendHandlerName = "gopkg.in/DataDog/dd-trace-go.v1/contrib/aws/aws-sdk-go/aws/handlers.Send"
// CompleteHandlerName is the name of the Datadog NamedHandler for the Complete phase of an awsv1 request
CompleteHandlerName = "gopkg.in/DataDog/dd-trace-go.v1/contrib/aws/aws-sdk-go/aws/handlers.Complete"
)

type handlers struct {
Expand All @@ -42,11 +46,11 @@ func WrapSession(s *session.Session, opts ...Option) *session.Session {
h := &handlers{cfg: cfg}
s = s.Copy()
s.Handlers.Send.PushFrontNamed(request.NamedHandler{
Name: "gopkg.in/DataDog/dd-trace-go.v1/contrib/aws/aws-sdk-go/aws/handlers.Send",
Name: SendHandlerName,
Fn: h.Send,
})
s.Handlers.Complete.PushBackNamed(request.NamedHandler{
Name: "gopkg.in/DataDog/dd-trace-go.v1/contrib/aws/aws-sdk-go/aws/handlers.Complete",
Name: CompleteHandlerName,
Fn: h.Complete,
})
return s
Expand Down