Skip to content

Commit

Permalink
Fixed issue #2260 where attributes for DynamoDB were not added becaus…
Browse files Browse the repository at this point in the history
…e of a wrong name in the servicemap.
  • Loading branch information
noliva committed May 13, 2022
1 parent 6feda83 commit 736e539
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Expand Up @@ -16,6 +16,7 @@ package otelaws // import "go.opentelemetry.io/contrib/instrumentation/github.co

import (
"context"
"github.com/aws/aws-sdk-go-v2/service/dynamodb"

v2Middleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/smithy-go/middleware"
Expand All @@ -32,7 +33,7 @@ const (
)

var servicemap = map[string]AttributeSetter{
"dynamodb": DynamoDBAttributeSetter,
dynamodb.ServiceID: DynamoDBAttributeSetter,
}

func OperationAttr(operation string) attribute.KeyValue {
Expand Down
Expand Up @@ -25,7 +25,7 @@ import (
semconv "go.opentelemetry.io/otel/semconv/v1.10.0"
)

// DynamoDBAttributeSetter sets DynamoDB specific attributes depending on the the DynamoDB operation being performed.
// DynamoDBAttributeSetter sets DynamoDB specific attributes depending on the DynamoDB operation being performed.
func DynamoDBAttributeSetter(ctx context.Context, in middleware.InitializeInput) []attribute.KeyValue {

dynamodbAttributes := []attribute.KeyValue{semconv.DBSystemKey.String("dynamodb")}
Expand Down

0 comments on commit 736e539

Please sign in to comment.