Skip to content

Commit 6d41a16

Browse files
authored
prefix AWS.SDK to the RemoteService from v1 (#756)
1 parent 7fdbf21 commit 6d41a16

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

appsignals-tests/contract-tests/src/test/java/software/amazon/opentelemetry/appsignals/test/awssdk/v1/AwsSdkV1Test.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,22 @@ protected String getKinesisSpanNamePrefix() {
5959

6060
@Override
6161
protected String getS3ServiceName() {
62-
return "Amazon S3";
62+
return "AWS.SDK.Amazon S3";
6363
}
6464

6565
@Override
6666
protected String getDynamoDbServiceName() {
67-
return "AmazonDynamoDBv2";
67+
return "AWS.SDK.AmazonDynamoDBv2";
6868
}
6969

7070
@Override
7171
protected String getSqsServiceName() {
72-
return "AmazonSQS";
72+
return "AWS.SDK.AmazonSQS";
7373
}
7474

7575
@Override
7676
protected String getKinesisServiceName() {
77-
return "AmazonKinesis";
77+
return "AWS.SDK.AmazonKinesis";
7878
}
7979

8080
protected String getS3RpcServiceName() {

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,7 @@ private static void setEgressOperation(SpanData span, AttributesBuilder builder)
216216
// add `AWS.SDK.` as prefix to indicate the metrics resulted from current span is from AWS SDK
217217
private static String normalizeServiceName(SpanData span, String serviceName) {
218218
if (AwsSpanProcessingUtil.isAwsSDKSpan(span)) {
219-
String scopeName = span.getInstrumentationScopeInfo().getName();
220-
if (scopeName.contains("aws-sdk-2.")) {
221-
return "AWS.SDK." + serviceName;
222-
}
219+
return "AWS.SDK." + serviceName;
223220
}
224221
return serviceName;
225222
}

awsagentprovider/src/test/java/software/amazon/opentelemetry/javaagent/providers/AwsMetricAttributeGeneratorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ public void testNormalizeServiceNameAwsSdkV1Span() {
969969

970970
Attributes actualAttributes =
971971
GENERATOR.generateMetricAttributeMapFromSpan(spanDataMock, resource).get(DEPENDENCY_METRIC);
972-
assertThat(actualAttributes.get(AWS_REMOTE_SERVICE)).isEqualTo("Amazon S3");
972+
assertThat(actualAttributes.get(AWS_REMOTE_SERVICE)).isEqualTo("AWS.SDK.Amazon S3");
973973
}
974974

975975
@Test

0 commit comments

Comments
 (0)