Try it free

Amazon ECS container workloads

  • Latest Dynatrace
  • How-to guide
  • 4-min read
  • Published Nov 15, 2026

License your Amazon ECS tasks per container-hour with Container Application Monitoring. This works with OneAgent and OpenTelemetry, on both AWS Fargate and Amazon EC2.

Before you begin

  • Container application workloads. Instrument your tasks with OpenTelemetry or with OneAgent code modules inside the task, for example, with the Fargate runtime integration or build-time injection. The OneAgent daemon service on EC2 monitors the host instead. It's licensed through host monitoring, never as Container Application Monitoring.
  • ECS container agent 1.45.0+ on EC2. On EC2, you need ECS container agent version 1.45.0 or later. Earlier versions don't return the container ARN from the task metadata endpoint. Fargate always returns it.

Opt in OneAgent tasks

OneAgent version 1.345+

Both options require OneAgent version 1.345+. Use one of these options:

  • Tenant-wide setting: Enable builtin:billing.container-application-monitoring.optin to opt in all eligible OneAgent containers on ECS and Kubernetes at once. A container is eligible if its telemetry carries the container identity attributes. The setting is enabled by default for new customers and needs no task definition changes. Once you enable it, you can't disable it.
  • Per task-definition family: Add dt.has_container_application_monitoring=true to OTEL_RESOURCE_ATTRIBUTES on your application containers. OneAgent reads this variable. To revert, remove it and deploy a new revision.
{
"name": "OTEL_RESOURCE_ATTRIBUTES",
"value": "dt.has_container_application_monitoring=true"
}

Set the variable on every application container in the task definition, not on the container that provides the OneAgent code modules. If you already set OTEL_RESOURCE_ATTRIBUTES, append the attribute to the comma-separated list.

OneAgent adds the container ARN to its telemetry automatically.

Opt in OpenTelemetry tasks

OpenTelemetry always requires an opt-in

The tenant-wide setting applies to OneAgent only. OpenTelemetry tasks are licensed as Container Application Monitoring only if their telemetry carries dt.has_container_application_monitoring=true.

Your telemetry needs two resource attributes:

  • dt.has_container_application_monitoring=true
  • aws.ecs.container.arn, the ARN of the container the telemetry comes from

Most OpenTelemetry SDKs and the Collector include the AWS ECS resource detector, which sets aws.ecs.container.arn automatically. Enable the detector, and add the opt-in attribute to OTEL_RESOURCE_ATTRIBUTES:

{
"name": "OTEL_RESOURCE_ATTRIBUTES",
"value": "dt.has_container_application_monitoring=true"
}

If you can't use the resource detector, read the container ARN at startup, for example, in an entrypoint script. Get ContainerARN from the task metadata endpoint (${ECS_CONTAINER_METADATA_URI_V4}) and add it to OTEL_RESOURCE_ATTRIBUTES as aws.ecs.container.arn=<ARN>.

Without aws.ecs.container.arn, Dynatrace can't attribute telemetry to a container. That telemetry is licensed as Traces and Metrics - Ingest & Process instead.

Avoid double licensing on EC2

Don't opt in OpenTelemetry tasks on EC2 instances that also run the OneAgent daemon service. These instances are already licensed through host monitoring. Opting their containers in would license them twice.

Roll out the change

Opt in whole task-definition families

All containers from the same cluster and task-definition family must be opted in together. Partial opt-in within a family isn't supported and can result in incorrect licensing.

  1. Update every container definition in the task definition.
  2. Register a new revision of the task definition.
  3. Update your ECS service to use the new revision.

Verify

In Account Management, go to Subscription > Overview > Cost and usage details, select Container Application Monitoring, and check that consumption increases. You can also query billing usage events, as described in Migrate to Container Application Monitoring.

Related topics

  • Monitor container workloads
  • Monitor AWS Fargate
  • Container Application Monitoring consumption