Skip to content

[Feature]: AWS ECS resource detector #706

Description

@chinmaychahar

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.provideraws
  • cloud.platformaws_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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions