Related Problems?
Child of #94
Description
Add an ECS resource detector that populates resource attributes for services running in ECS containers.
What component are you working with?
opentelemetry-aws
Describe the solution you'd like:
Read ECS_CONTAINER_METADATA_URI_V4 env var, then call that HTTP endpoint to retrieve components like:
cloud.provider → aws
cloud.platform → aws_ecs
cloud.region (parsed from task ARN)
cloud.account.id (parsed from task ARN)
cloud.availability_zone
cloud.resource_id (container ARN)
container.name
container.id
aws.ecs.container.arn
aws.ecs.cluster.arn
aws.ecs.launchtype
aws.ecs.task.arn
aws.ecs.task.family
aws.ecs.task.revision
aws.log.group.names / aws.log.group.arns (if awslogs driver)
aws.log.stream.names / aws.log.stream.arns (if awslogs driver)
Note: The metadata may return short names (e.g., cluster name instead of full ARN). The detector should construct full ARNs from the base ARN when needed (Go implementation does this from task/ container ARN parts)
Should return empty resource if neither ECS_CONTAINER_METADATA_URI nor ECS_CONTAINER_METADATA_URI_V4 env vars are set
Additional Context
Design constraint
ResourceDetector::detect() is sync. This detector will need a blocking HTTP client (can discuss on the approach in #510
Reference
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Related Problems?
Child of #94
Description
Add an ECS resource detector that populates resource attributes for services running in ECS containers.
What component are you working with?
opentelemetry-aws
Describe the solution you'd like:
Read
ECS_CONTAINER_METADATA_URI_V4env var, then call that HTTP endpoint to retrieve components like:cloud.provider→awscloud.platform→aws_ecscloud.region(parsed from task ARN)cloud.account.id(parsed from task ARN)cloud.availability_zonecloud.resource_id(container ARN)container.namecontainer.idaws.ecs.container.arnaws.ecs.cluster.arnaws.ecs.launchtypeaws.ecs.task.arnaws.ecs.task.familyaws.ecs.task.revisionaws.log.group.names/aws.log.group.arns(if awslogs driver)aws.log.stream.names/aws.log.stream.arns(if awslogs driver)Note: The metadata may return short names (e.g., cluster name instead of full ARN). The detector should construct full ARNs from the base ARN when needed (Go implementation does this from task/ container ARN parts)
Should return empty resource if neither
ECS_CONTAINER_METADATA_URInorECS_CONTAINER_METADATA_URI_V4env vars are setAdditional Context
Design constraint
ResourceDetector::detect()is sync. This detector will need a blocking HTTP client (can discuss on the approach in #510Reference
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.