Skip to content

Commit

Permalink
prefix AWS.SDK to the RemoteService from v1 (#756)
Browse files Browse the repository at this point in the history
  • Loading branch information
srprash authored Feb 22, 2024
1 parent 7fdbf21 commit 6d41a16
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,22 @@ protected String getKinesisSpanNamePrefix() {

@Override
protected String getS3ServiceName() {
return "Amazon S3";
return "AWS.SDK.Amazon S3";
}

@Override
protected String getDynamoDbServiceName() {
return "AmazonDynamoDBv2";
return "AWS.SDK.AmazonDynamoDBv2";
}

@Override
protected String getSqsServiceName() {
return "AmazonSQS";
return "AWS.SDK.AmazonSQS";
}

@Override
protected String getKinesisServiceName() {
return "AmazonKinesis";
return "AWS.SDK.AmazonKinesis";
}

protected String getS3RpcServiceName() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,7 @@ private static void setEgressOperation(SpanData span, AttributesBuilder builder)
// add `AWS.SDK.` as prefix to indicate the metrics resulted from current span is from AWS SDK
private static String normalizeServiceName(SpanData span, String serviceName) {
if (AwsSpanProcessingUtil.isAwsSDKSpan(span)) {
String scopeName = span.getInstrumentationScopeInfo().getName();
if (scopeName.contains("aws-sdk-2.")) {
return "AWS.SDK." + serviceName;
}
return "AWS.SDK." + serviceName;
}
return serviceName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ public void testNormalizeServiceNameAwsSdkV1Span() {

Attributes actualAttributes =
GENERATOR.generateMetricAttributeMapFromSpan(spanDataMock, resource).get(DEPENDENCY_METRIC);
assertThat(actualAttributes.get(AWS_REMOTE_SERVICE)).isEqualTo("Amazon S3");
assertThat(actualAttributes.get(AWS_REMOTE_SERVICE)).isEqualTo("AWS.SDK.Amazon S3");
}

@Test
Expand Down

0 comments on commit 6d41a16

Please sign in to comment.