Skip to content

Commit

Permalink
fix: lower-case the value of aws.ecs.launchtype
Browse files Browse the repository at this point in the history
  • Loading branch information
Michele Mancioppi committed Aug 9, 2022
1 parent e5dc29a commit 08ebda3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion detectors/aws/ecs/ecs.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (detector *resourceDetector) Detect(ctx context.Context) (*resource.Resourc
attributes = append(
attributes,
semconv.AWSECSClusterARNKey.String(clusterArn),
semconv.AWSECSLaunchtypeKey.String(taskMetadata.LaunchType),
semconv.AWSECSLaunchtypeKey.String(strings.ToLower(taskMetadata.LaunchType)),
semconv.AWSECSTaskARNKey.String(taskMetadata.TaskARN),
semconv.AWSECSTaskFamilyKey.String(taskMetadata.Family),
semconv.AWSECSTaskRevisionKey.String(taskMetadata.Revision),
Expand Down
6 changes: 3 additions & 3 deletions detectors/aws/ecs/ecs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (detectorUtils *MockDetectorUtils) getContainerName() (string, error) {
return args.String(0), args.Error(1)
}

// succesfully returns resource when process is running on Amazon ECS environment
// succesfully returns resource when process is running on Amazon ECS environment
// with no Metadata v4.
func TestDetectV3(t *testing.T) {
os.Clearenv()
Expand All @@ -69,7 +69,7 @@ func TestDetectV3(t *testing.T) {
assert.Equal(t, expectedResource, res, "Resource returned is incorrect")
}

// succesfully returns resource when process is running on Amazon ECS environment
// succesfully returns resource when process is running on Amazon ECS environment
// with Metadata v4.
func TestDetectV4(t *testing.T) {
testServer := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) {
Expand Down Expand Up @@ -103,7 +103,7 @@ func TestDetectV4(t *testing.T) {
semconv.ContainerIDKey.String("0123456789A"),
semconv.AWSECSContainerARNKey.String("arn:aws:ecs:us-west-2:111122223333:container/0206b271-b33f-47ab-86c6-a0ba208a70a9"),
semconv.AWSECSClusterARNKey.String("arn:aws:ecs:us-west-2:111122223333:cluster/default"),
semconv.AWSECSLaunchtypeKey.String("EC2"),
semconv.AWSECSLaunchtypeKey.String("ec2"),
semconv.AWSECSTaskARNKey.String("arn:aws:ecs:us-west-2:111122223333:task/default/158d1c8083dd49d6b527399fd6414f5c"),
semconv.AWSECSTaskFamilyKey.String("curltest"),
semconv.AWSECSTaskRevisionKey.String("26"),
Expand Down

0 comments on commit 08ebda3

Please sign in to comment.