Skip to main content

AWS Fargate

Required AWS Fargate Attributes

The following cost calculation tags are required for traces originating from AWS Fargate tasks.

Always Required Fields

These fields are always required for AWS Fargate cost calculation:

Attribute NameExample ValueAllowed Values
cloud.platformaws_ecsaws_ecs
aws.ecs.launchtypefargatefargate
aws.ecs.task.arnarn:aws:ecs:us-east-1:123456789:task/cluster/taskidValid ECS task ARN
aws.ecs.task.cpu1024CPU units (1024 = 1 vCPU)
aws.ecs.task.memory2048Memory in MiB

Optional Fields

These fields are extracted if present but are not required for cost calculation:

Attribute NameExample ValueAllowed ValuesDefault
os.typelinuxlinux, windowslinux
aws.ecs.task.cpu_architectureX86_64X86_64, ARM64X86_64
aws.ecs.task.capacity_providerFARGATEFARGATE, FARGATE_SPOTFARGATE

Required for CUR Cost Finalization

Costs calculated from the tags above are provisional — estimated from list prices. When you connect your AWS Cost and Usage Report (CUR), Beakpoint Insights replaces provisional costs with your actual billed costs by matching spans to CUR line items. That matching requires one additional tag:

Attribute NameExample ValueAllowed Values
cloud.resource_idarn:aws:ecs:us-east-1:123456789012:task/my-cluster/abc123The full ECS task ARN
Must be a resource attribute

cloud.resource_id should be set as an OpenTelemetry resource attribute. Spans sent directly via OTLP will not match your CUR data if the tag only appears at the span level, and their costs will remain provisional indefinitely. (Traces imported from AWS X-Ray have span-level values promoted automatically, but do not rely on this.)

Cost Calculation

Fargate charges separately for vCPU and memory. Beakpoint calculates cost based on span duration:

cost = (cpu_units / 1024) × vCPU_hourly_rate × duration_hours
+ (memory_MiB / 1024) × memory_hourly_rate × duration_hours

The region is extracted from the task ARN. When multiple spans overlap on the same task (identified by aws.ecs.task.arn), costs are proportionally shared using a time-sharing algorithm. Spans on different tasks are priced independently.

Example Configuration

Set these as OpenTelemetry resource attributes in your application:

OTEL_RESOURCE_ATTRIBUTES: "cloud.platform=aws_ecs,aws.ecs.launchtype=fargate,aws.ecs.task.arn=arn:aws:ecs:us-east-1:123456789:task/my-cluster/abc123,aws.ecs.task.cpu=1024,aws.ecs.task.memory=2048,os.type=linux,aws.ecs.task.cpu_architecture=X86_64,aws.ecs.task.capacity_provider=FARGATE"