Skip to content

Commit

Permalink
Remove trailing ':*' suffic for log group ARN
Browse files Browse the repository at this point in the history
The AWS Distro of OpenTelemetry has issues relating Log Groups
with the trailing ':*' suffix (although they are valid ARNs).

A fix is in the works, but to ensure comopatibility with the
existing deployments, it is best to drop the trailing ':*'.
  • Loading branch information
Michele Mancioppi committed Sep 8, 2022
1 parent 49156c9 commit 838e75c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion detectors/aws/ecs/ecs.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func (detector *resourceDetector) getLogsAttributes(metadata *ecsmetadata.Contai

return []attribute.KeyValue{
semconv.AWSLogGroupNamesKey.StringSlice([]string{logsOptions.AwsLogsGroup}),
semconv.AWSLogGroupARNsKey.StringSlice([]string{fmt.Sprintf("arn:aws:logs:%s:%s:log-group:%s:*", logsRegion, awsAccount, logsOptions.AwsLogsGroup)}),
semconv.AWSLogGroupARNsKey.StringSlice([]string{fmt.Sprintf("arn:aws:logs:%s:%s:log-group:%s", logsRegion, awsAccount, logsOptions.AwsLogsGroup)}),
semconv.AWSLogStreamNamesKey.StringSlice([]string{logsOptions.AwsLogsStream}),
semconv.AWSLogStreamARNsKey.StringSlice([]string{fmt.Sprintf("arn:aws:logs:%s:%s:log-group:%s:log-stream:%s", logsRegion, awsAccount, logsOptions.AwsLogsGroup, logsOptions.AwsLogsStream)}),
}, nil
Expand Down
4 changes: 2 additions & 2 deletions detectors/aws/ecs/ecs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func TestDetectV4LaunchTypeEc2(t *testing.T) {
semconv.AWSECSTaskFamilyKey.String("curltest"),
semconv.AWSECSTaskRevisionKey.String("26"),
semconv.AWSLogGroupNamesKey.StringSlice([]string{"/ecs/metadata"}),
semconv.AWSLogGroupARNsKey.StringSlice([]string{"arn:aws:logs:us-west-2:111122223333:log-group:/ecs/metadata:*"}),
semconv.AWSLogGroupARNsKey.StringSlice([]string{"arn:aws:logs:us-west-2:111122223333:log-group:/ecs/metadata"}),
semconv.AWSLogStreamNamesKey.StringSlice([]string{"ecs/curl/8f03e41243824aea923aca126495f665"}),
semconv.AWSLogStreamARNsKey.StringSlice([]string{"arn:aws:logs:us-west-2:111122223333:log-group:/ecs/metadata:log-stream:ecs/curl/8f03e41243824aea923aca126495f665"}),
}
Expand Down Expand Up @@ -159,7 +159,7 @@ func TestDetectV4LaunchTypeFargate(t *testing.T) {
semconv.AWSECSTaskFamilyKey.String("curltest"),
semconv.AWSECSTaskRevisionKey.String("3"),
semconv.AWSLogGroupNamesKey.StringSlice([]string{"/ecs/containerlogs"}),
semconv.AWSLogGroupARNsKey.StringSlice([]string{"arn:aws:logs:us-west-2:111122223333:log-group:/ecs/containerlogs:*"}),
semconv.AWSLogGroupARNsKey.StringSlice([]string{"arn:aws:logs:us-west-2:111122223333:log-group:/ecs/containerlogs"}),
semconv.AWSLogStreamNamesKey.StringSlice([]string{"ecs/curl/cd189a933e5849daa93386466019ab50"}),
semconv.AWSLogStreamARNsKey.StringSlice([]string{"arn:aws:logs:us-west-2:111122223333:log-group:/ecs/containerlogs:log-stream:ecs/curl/cd189a933e5849daa93386466019ab50"}),
}
Expand Down

0 comments on commit 838e75c

Please sign in to comment.