AWS Fargate
Required AWS Fargate Attributes
To calculate costs for AWS Fargate tasks, provide these tags as OpenTelemetry resource attributes.
Always Required Fields
These fields must be present for cost calculation:
| Attribute Name | Example Value | Allowed Values |
|---|---|---|
cloud.platform | aws_ecs | aws_ecs |
aws.ecs.launchtype | fargate | fargate |
aws.ecs.task.arn | arn:aws:ecs:us-east-1:123456789:task/cluster/taskid | Valid ECS task ARN |
aws.ecs.task.cpu | 1024 | CPU units (1024 = 1 vCPU) |
aws.ecs.task.memory | 2048 | Memory in MiB |
Optional Fields
Include these to refine cost calculations; they're not required:
| Attribute Name | Example Value | Allowed Values | Default |
|---|---|---|---|
os.type | linux | linux, windows | linux |
aws.ecs.task.cpu_architecture | X86_64 | X86_64, ARM64 | X86_64 |
aws.ecs.task.capacity_provider | FARGATE | FARGATE, FARGATE_SPOT | FARGATE |
Required for CUR Cost Finalization
Costs calculated from the tags above are provisional — estimated from list prices. To convert provisional costs to actual billed costs, connect your AWS Cost and Usage Report (CUR). Beakpoint matches spans to CUR line items using this additional tag:
| Attribute Name | Example Value | Allowed Values |
|---|---|---|
cloud.resource_id | arn:aws:ecs:us-east-1:123456789012:task/my-cluster/abc123 | The full ECS task ARN |
Set cloud.resource_id as an OpenTelemetry resource attribute, not a span-level attribute. Span-level values will not match CUR data and costs will remain provisional. AWS X-Ray traces have automatic promotion, but don't rely on it.
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 execute concurrently on the same task, Beakpoint allocates the task cost proportionally based on each span's duration. Each task's cost is computed 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"