-
Notifications
You must be signed in to change notification settings - Fork 1k
Remove experimental flag requirement for spec'd AWS SDK attributes #14888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Response attributes defined in AwsSdkRequestType (like aws.secretsmanager.secret.arn, aws.sns.topic.arn, etc.) are documented in semantic-conventions as incubating attributes and should always be extracted, regardless of the experimental flag setting. Co-authored-by: trask <[email protected]>
The captureExperimentalSpanAttributes field is kept for future use when we want to differentiate between spec'd and experimental attributes, but is currently unused after removing the conditional check for response attribute extraction. Co-authored-by: trask <[email protected]>
@copilot provide links to locations where all of these are emitted so I can confirm that they are not behind experimental flag |
All these attributes are emitted through the TracingExecutionInterceptor.java:406-409 The attribute definitions and extraction points: Lambda attributes:
Secrets Manager:
SNS:
DynamoDB (all response attributes):
The |
.../java/io/opentelemetry/instrumentation/awssdk/v2_2/internal/TracingExecutionInterceptor.java
Outdated
Show resolved
Hide resolved
Removed the captureExperimentalSpanAttributes field and constructor parameter from TracingExecutionInterceptor as it's no longer used after the conditional check for response attribute extraction was removed. Co-authored-by: trask <[email protected]>
I suspect that this might be a bit too much for copilot. As far as I can tell some of the attributes in https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/internal/AwsSdkRequest.java are spced while others seem to have a slightly different name in the spec. Not sure whether there are any that aren't present in spec at all. |
Fix: Ensure spec'd AWS attributes don't require experimental flag
Changes Made
Summary
Response attributes defined in
AwsSdkRequestType
andAwsSdkRequest
are documented in OpenTelemetry semantic-conventions as incubating attributes. These should always be extracted regardless of thecaptureExperimentalSpanAttributes
flag setting.Root Cause: In
TracingExecutionInterceptor.java
, response attribute extraction viaFieldMapper
was wrapped in a conditional check:if (captureExperimentalSpanAttributes)
. This prevented spec'd attributes from being emitted unless the experimental flag was explicitly enabled.Fix: Removed the conditional check so that response attributes are always extracted, matching the behavior of request attributes. Subsequently removed the now-unused
captureExperimentalSpanAttributes
parameter fromTracingExecutionInterceptor
.Affected Attributes (now always extracted from responses):
aws.lambda.function.arn
(spec'd in semconv)aws.lambda.resource_mapping.id
(spec'd in semconv)aws.secretsmanager.secret.arn
(spec'd in semconv - this was the example in the issue)aws.sns.topic.arn
(spec'd in semconv)aws.dynamodb.consumed_capacity
(spec'd in semconv)aws.dynamodb.item_collection_metrics
(spec'd in semconv)aws.dynamodb.table_count
(spec'd in semconv)aws.dynamodb.count
(spec'd in semconv)aws.dynamodb.scanned_count
(spec'd in semconv)All these attributes are documented in the OpenTelemetry semantic-conventions AWS registry as incubating attributes.
Testing: All library tests pass (84 tests with 0 failures and 0 errors).
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.