Skip to content

Commit

Permalink
Add AwsAttributeKeys (#11)
Browse files Browse the repository at this point in the history
AwsAttributeKeys holds useful attribute keys needed by multiple other
classes. This is a roughly-carbon-copy file of
https://github.com/aws-observability/aws-otel-java-instrumentation/blob/main/awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsAttributeKeys.java

Callout:
open-telemetry/opentelemetry-java-instrumentation#8710
has been resolved, and a new issue needs to be opened. The larger
problem is that the `AWS_*_NAME` attributes only exist in Java. We will
either need to add these to Python or (more likely) move away from these
attributes and towards ones accepted in the [AWS service specific
attributes semantic
conventions](https://opentelemetry.io/docs/specs/semconv/cloud-providers/aws-sdk/#aws-service-specific-attributes).
I've cut a backlog item for this.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
  • Loading branch information
thpierce authored Jan 10, 2024
2 parents 51c9ec0 + 14f6180 commit a6c6061
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0


class AwsAttributeKeys:
"""Utility class holding attribute keys with special meaning to AWS components"""

AWS_SPAN_KIND: str = "aws.span.kind"
AWS_LOCAL_SERVICE: str = "aws.local.service"
AWS_LOCAL_OPERATION: str = "aws.local.operation"
AWS_REMOTE_SERVICE: str = "aws.remote.service"
AWS_REMOTE_OPERATION: str = "aws.remote.operation"
AWS_REMOTE_TARGET: str = "aws.remote.target"
AWS_SDK_DESCENDANT: str = "aws.sdk.descendant"
AWS_CONSUMER_PARENT_SPAN_KIND: str = "aws.consumer.parent.span.kind"

# Use the same AWS Resource attribute name defined by OTel java auto-instr for aws_sdk_v_1_1
# TODO: all AWS specific attributes should be defined in semconv package and reused cross all
# otel packages. Related sim - https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues/8710

AWS_BUCKET_NAME: str = "aws.bucket.name"
AWS_QUEUE_NAME: str = "aws.queue.name"
AWS_STREAM_NAME: str = "aws.stream.name"
AWS_TABLE_NAME: str = "aws.table.name"

0 comments on commit a6c6061

Please sign in to comment.