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
#2272)

* Fixed issue #2260 where attributes for DynamoDB were not added because of a wrong name in the servicemap.

* ran make precommit

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
  • Loading branch information
noliva and MrAlias committed May 24, 2022
1 parent 5a67dfa commit f8c1f00
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -26,6 +26,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
This makes `4xx` response codes to not be an error anymore. (#1973)
- Fixed jaegerremote sampler not behaving properly with per operation strategy set. (#2137)
- Stopped injecting propagation context into response headers in otelhttp. (#2180)
- Fix issue where attributes for DynamoDB were not added because of a string miss match. (#2272)

## [1.6.0/0.31.0] - 2022-03-28

Expand Down
Expand Up @@ -17,6 +17,8 @@ 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 +34,7 @@ const (
)

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

// OperationAttr returns the AWS operation attribute.
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 f8c1f00

Please sign in to comment.