Skip to content

Commit 656bda2

Browse files
committed
Rename Application terminology to Service terminology.
1 parent 7b02d7d commit 656bda2

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

aws-xray/src/main/java/io/opentelemetry/contrib/awsxray/AwsAttributePropagatingSpanProcessor.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
/**
1717
* AwsAttributePropagatingSpanProcessor handles the creation of the aws.local.operation attribute,
1818
* and the inheritance of the {@link AwsAttributeKeys#AWS_LOCAL_OPERATION}, {@link
19-
* AwsAttributeKeys#AWS_REMOTE_APPLICATION} and {@link AwsAttributeKeys#AWS_REMOTE_OPERATION}.
19+
* AwsAttributeKeys#AWS_REMOTE_SERVICE} and {@link AwsAttributeKeys#AWS_REMOTE_OPERATION}.
2020
*
2121
* <p>The {@link AwsAttributeKeys#AWS_LOCAL_OPERATION} is created when a local root span of SERVER
2222
* or CONSUMER type is found. The span name will be used as the attribute value. The {@link
23-
* AwsAttributeKeys#AWS_REMOTE_APPLICATION} and {@link AwsAttributeKeys#AWS_REMOTE_OPERATION}
24-
* attributes must be created by manual instrumentation. These attributes will be copied from the
25-
* parent span to children after receiving them, and later be used in SpanMetricsProcessor to help
26-
* generate metric attributes.
23+
* AwsAttributeKeys#AWS_REMOTE_SERVICE} and {@link AwsAttributeKeys#AWS_REMOTE_OPERATION} attributes
24+
* must be created by manual instrumentation. These attributes will be copied from the parent span
25+
* to children after receiving them, and later be used in SpanMetricsProcessor to help generate
26+
* metric attributes.
2727
*/
2828
public final class AwsAttributePropagatingSpanProcessor implements SpanProcessor {
2929

@@ -52,10 +52,9 @@ && isServerOrConsumer(parentReadableSpan)) {
5252
span.setAttribute(AwsAttributeKeys.AWS_LOCAL_OPERATION, localOperation);
5353
}
5454

55-
String remoteApplication =
56-
parentReadableSpan.getAttribute(AwsAttributeKeys.AWS_REMOTE_APPLICATION);
57-
if (remoteApplication != null) {
58-
span.setAttribute(AwsAttributeKeys.AWS_REMOTE_APPLICATION, remoteApplication);
55+
String remoteService = parentReadableSpan.getAttribute(AwsAttributeKeys.AWS_REMOTE_SERVICE);
56+
if (remoteService != null) {
57+
span.setAttribute(AwsAttributeKeys.AWS_REMOTE_SERVICE, remoteService);
5958
}
6059

6160
String remoteOperation = parentReadableSpan.getAttribute(AwsAttributeKeys.AWS_REMOTE_OPERATION);

aws-xray/src/test/java/io/opentelemetry/contrib/awsxray/AwsAttributePropagatingSpanProcessorTest.java

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,23 @@ public void setup() {
3434
@Test
3535
public void testRemoteAttributesInheritance() {
3636
Span spanWithAppOnly = tracer.spanBuilder("parent").startSpan();
37-
spanWithAppOnly.setAttribute(AwsAttributeKeys.AWS_REMOTE_APPLICATION, "testApplication");
38-
validateSpanAttributesInheritance(spanWithAppOnly, null, "testApplication", null);
37+
spanWithAppOnly.setAttribute(AwsAttributeKeys.AWS_REMOTE_SERVICE, "testService");
38+
validateSpanAttributesInheritance(spanWithAppOnly, null, "testService", null);
3939

4040
Span spanWithOpOnly = tracer.spanBuilder("parent").startSpan();
4141
spanWithOpOnly.setAttribute(AwsAttributeKeys.AWS_REMOTE_OPERATION, "testOperation");
4242
validateSpanAttributesInheritance(spanWithOpOnly, null, null, "testOperation");
4343

4444
Span spanWithAppAndOp = tracer.spanBuilder("parent").startSpan();
45-
spanWithAppAndOp.setAttribute(AwsAttributeKeys.AWS_REMOTE_APPLICATION, "testApplication");
45+
spanWithAppAndOp.setAttribute(AwsAttributeKeys.AWS_REMOTE_SERVICE, "testService");
4646
spanWithAppAndOp.setAttribute(AwsAttributeKeys.AWS_REMOTE_OPERATION, "testOperation");
47-
validateSpanAttributesInheritance(spanWithAppAndOp, null, "testApplication", "testOperation");
47+
validateSpanAttributesInheritance(spanWithAppAndOp, null, "testService", "testOperation");
4848
}
4949

5050
@Test
5151
public void testOverrideRemoteAttributes() {
5252
Span parentSpan = tracer.spanBuilder("parent").startSpan();
53-
parentSpan.setAttribute(AwsAttributeKeys.AWS_REMOTE_APPLICATION, "testApplication");
53+
parentSpan.setAttribute(AwsAttributeKeys.AWS_REMOTE_SERVICE, "testService");
5454
parentSpan.setAttribute(AwsAttributeKeys.AWS_REMOTE_OPERATION, "testOperation");
5555

5656
Span transmitSpans1 = createNestedSpan(parentSpan, 2);
@@ -120,11 +120,8 @@ private Span createNestedSpan(Span parentSpan, int depth) {
120120
}
121121

122122
private void validateSpanAttributesInheritance(
123-
Span spanWithAppOnly,
124-
String localOperation,
125-
String remoteApplication,
126-
String remoteOperation) {
127-
ReadableSpan leafSpan = (ReadableSpan) createNestedSpan(spanWithAppOnly, 10);
123+
Span parentSpan, String localOperation, String remoteService, String remoteOperation) {
124+
ReadableSpan leafSpan = (ReadableSpan) createNestedSpan(parentSpan, 10);
128125

129126
assertThat(leafSpan.getParentSpanContext()).isNotNull();
130127
assertThat(leafSpan.getName()).isEqualTo("child:1");
@@ -134,11 +131,11 @@ private void validateSpanAttributesInheritance(
134131
} else {
135132
assertThat(leafSpan.getAttribute(AwsAttributeKeys.AWS_LOCAL_OPERATION)).isNull();
136133
}
137-
if (remoteApplication != null) {
138-
assertThat(leafSpan.getAttribute(AwsAttributeKeys.AWS_REMOTE_APPLICATION))
139-
.isEqualTo(remoteApplication);
134+
if (remoteService != null) {
135+
assertThat(leafSpan.getAttribute(AwsAttributeKeys.AWS_REMOTE_SERVICE))
136+
.isEqualTo(remoteService);
140137
} else {
141-
assertThat(leafSpan.getAttribute(AwsAttributeKeys.AWS_REMOTE_APPLICATION)).isNull();
138+
assertThat(leafSpan.getAttribute(AwsAttributeKeys.AWS_REMOTE_SERVICE)).isNull();
142139
}
143140
if (remoteOperation != null) {
144141
assertThat(leafSpan.getAttribute(AwsAttributeKeys.AWS_REMOTE_OPERATION))

0 commit comments

Comments
 (0)