opentelemetry-go-contrib icon indicating copy to clipboard operation
opentelemetry-go-contrib copied to clipboard

otelaws created invalid request signatures in v0.36.4

Open jamestoyer opened this issue 2 years ago • 2 comments

It appears there is an issue with the go.opentelemetry.io/contrib/instrumentation/github.com/aws/aws-sdk-go-v2/otelaws in v0.36.4. After upgrading from v0.36.3 to v0.36.4 in one of our projects we have started to see the following error when accessing DynamoDB:

operation error DynamoDB: Query, https response error StatusCode: 400, RequestID: <request id>, api error InvalidSignatureException: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.

Comparing the versions, it appears that #2856 is the only change between the two versions.

Steps to repro

Create a new AWS DynamoDB client and attempt to get an item. In v.0.36.3 this works but in v.0.36.4 this will fail.

Example code:

configOptions := []func(*awsconfig.LoadOptions) error{
  awsconfig.WithRegion("us-east-1"),
}

awsConfig, err := awsconfig.LoadDefaultConfig(ctx, configOptions...)

if err != nil {
  panic(err)
}

otelaws.AppendMiddlewares(&awsConfig.APIOptions)
dynamoDBService = dynamodb.NewFromConfig(awsConfig)

key := make(map[string]types.AttributeValue)
key["partition_key_name"] = &types.AttributeValueMemberS{Value: "partition_key_value"}

input := &dynamodb.GetItemInput{
  TableName: aws.String(<table name>),
  Key:       key.getDynamoDBKey(),
}
result, err := dynamoDBService.GetItem(ctx, input)
if err != nil {
  panic(err)
}

Where partition_key_name is the partition key of a given tale and partition_key_value is the value of an entry for it.

jamestoyer avatar Nov 07 '22 12:11 jamestoyer

I'm seeing the same issue with v0.36.4 after upgrading from v0.36.2

andrewbenton avatar Nov 10 '22 18:11 andrewbenton

I having the same problem with v0.38.0 (#3368)

lgcmotta avatar Feb 07 '23 14:02 lgcmotta