Skip to content

Commit fb5884c

Browse files
Propagate sampling decision as attribute (aws-observability#1161)
1 parent ed7e1c8 commit fb5884c

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AttributePropagatingSpanProcessor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ public void onStart(Context parentContext, ReadWriteSpan span) {
112112
if (propagationData != null) {
113113
span.setAttribute(propagationDataKey, propagationData);
114114
}
115+
span.setAttribute(AwsAttributeKeys.AWS_TRACE_FLAG_SAMPLED, span.getSpanContext().isSampled());
115116
}
116117

117118
private boolean isConsumerKind(ReadableSpan span) {

awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsAttributeKeys.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ private AwsAttributeKeys() {}
106106
static final AttributeKey<Boolean> AWS_TRACE_FLAG_SAMPLED =
107107
AttributeKey.booleanKey("aws.trace.flag.sampled");
108108

109-
static final AttributeKey<String> AWS_XRAY_SAMPLING_RULE =
110-
AttributeKey.stringKey("aws.xray.sampling_rule");
111-
112109
// use the same AWS Resource attribute name defined by OTel java auto-instr for aws_sdk_v_1_1
113110
// TODO: all AWS specific attributes should be defined in semconv package and reused cross all
114111
// otel packages. Related sim -

0 commit comments

Comments
 (0)