diff --git a/detectors/aws/ecs/ecs.go b/detectors/aws/ecs/ecs.go index 153d952abcc..30fbbf01c3f 100644 --- a/detectors/aws/ecs/ecs.go +++ b/detectors/aws/ecs/ecs.go @@ -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), diff --git a/detectors/aws/ecs/ecs_test.go b/detectors/aws/ecs/ecs_test.go index 170619166a0..a83d7ad96d9 100644 --- a/detectors/aws/ecs/ecs_test.go +++ b/detectors/aws/ecs/ecs_test.go @@ -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() @@ -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) { @@ -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"),