opentelemetry-java-instrumentation icon indicating copy to clipboard operation
opentelemetry-java-instrumentation copied to clipboard

Adding additional AWS fields (region, accountId, and partition)

Open atshaw43 opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe.

Our users can tell the table name for Dynamo DB, queue name for SQS, bucket name for S3, and stream name for Kinesis. This data is useful for narrowing down which resource is having an issue. The span attributes for this data are 'aws.table.name', 'aws.queue.name', 'aws.bucket.name', and 'aws.stream.name'.

Our users cannot always tell the account id or the region of the AWS resource they are targeting. This is an issue when users are doing cross-account and/or cross-region requests.

It is not uncommon for the same queue name to be used in different regions. This can make it difficult for users to pinpoint the resource that is experiencing an issue.

Describe the solution you'd like

I propose we add 3 new fields that will help round out this data: 'aws.region', 'aws.accountId', and 'aws.partition'. These fields will provide enough data to construct an ARN in the services above which is how AWS uniquely identifies a resource. This will allow users to use the data in the span to identify the resource experiencing issues.

We will keep the span attribute key AWS specific. This change needs to occur in the AWS SDK 1.11 and 2.2 auto-instrumentations.

aws.region This field will hold the AWS region for the target resource. We can provide this data for the SQS and Kinesis implementations. Example values: 'us-east-1', 'eu-central-1', and 'ap-south-1'.

aws.accountId This field will hold the account id for the target account. We can provide this data for the SQS and Kinesis implementations. Example values: '123456789012', and '210987654321'.

aws.partition This field will hold the partition for the target resource. We can provide this data for the SQS and Kinesis implementations. Example values: 'aws', 'aws-cn', and 'aws-us-gov'.

Describe alternatives you've considered

We discussed constructing an ARN from the data and adding a field for that, but we cannot always create an ARN given the data in the AWS SDK request object. We do not have access to the region in DynamoDB request objects for example. We will provide these fields on a best effort basis.

We also did not want to change the pre-existing implementation. A new field with the ARN would render aws.table.name and others redundant.

Additional context

No response

atshaw43 avatar Jan 29 '24 18:01 atshaw43

What is the ETA for the same?

Archish27 avatar May 15 '24 10:05 Archish27