diff --git a/service/dynamodb/api.go b/service/dynamodb/api.go index 727a8181267..495da4f8f71 100644 --- a/service/dynamodb/api.go +++ b/service/dynamodb/api.go @@ -13,6 +13,8 @@ import ( "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" + opentracing "github.com/opentracing/opentracing-go" + "github.com/opentracing/opentracing-go/log" ) const opBatchGetItem = "BatchGetItem" @@ -180,6 +182,10 @@ func (c *DynamoDB) BatchGetItem(input *BatchGetItemInput) (*BatchGetItemOutput, // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *DynamoDB) BatchGetItemWithContext(ctx aws.Context, input *BatchGetItemInput, opts ...request.Option) (*BatchGetItemOutput, error) { + span, ctx := opentracing.StartSpanFromContext(ctx, "BatchGetItemWithContext") + defer span.Finish() + span.LogFields(log.Object("request:", input)) + req, out := c.BatchGetItemRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) @@ -2319,6 +2325,10 @@ func (c *DynamoDB) GetItem(input *GetItemInput) (*GetItemOutput, error) { // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *DynamoDB) GetItemWithContext(ctx aws.Context, input *GetItemInput, opts ...request.Option) (*GetItemOutput, error) { + span, ctx := opentracing.StartSpanFromContext(ctx, "GetItemWithContext") + defer span.Finish() + span.LogFields(log.Object("request:", input)) + req, out := c.GetItemRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) @@ -4829,6 +4839,10 @@ func (c *DynamoDB) UpdateItem(input *UpdateItemInput) (*UpdateItemOutput, error) // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *DynamoDB) UpdateItemWithContext(ctx aws.Context, input *UpdateItemInput, opts ...request.Option) (*UpdateItemOutput, error) { + span, ctx := opentracing.StartSpanFromContext(ctx, "UpdateItemWithContext") + defer span.Finish() + span.LogFields(log.Object("request:", input)) + req, out := c.UpdateItemRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...)