AWSAWS X-RayObservability

aws_xray_group cost estimation

Distributed tracing billed per trace recorded plus per trace retrieved/scanned. 10M traces recorded + 1M scanned is ~$50.50.

An aws_xray_group defines a filter for grouping distributed traces in AWS X-Ray, which traces requests across microservices. X-Ray cost is usage: ~$5.00 per million traces recorded, plus ~$0.50 per million traces retrieved or scanned (for queries and the service map), with a free tier each month. 10M traces recorded and 1M scanned is ~$50 + $0.50 = $50.50/month.

The cost driver is traces recorded, which scales with request volume and your sampling rate. X-Ray samples traces (by default a small percentage plus a per-second baseline) rather than recording every request — so the sampling configuration is the primary lever. Recording 100% of traces on a high-traffic service multiplies cost; a representative sample captures the picture for a fraction.

The levers: tune the sampling rate to capture enough traces for insight without recording everything, scope sampling rules so high-volume low-value endpoints (health checks) aren't traced, and be mindful that heavy console/API querying adds retrieval cost. The group resource itself is free; the tracing usage is what bills.

c3x prices X-Ray from traces recorded and scanned as usage, so projected tracing cost can be modelled.

Terraform example

A minimal but realistic configuration that C3X can estimate.

resource "aws_xray_group" "errors" {
  group_name        = "high-latency"
  filter_expression = "responsetime > 2"
}

Pricing dimensions

What you actually pay for when you provision aws_xray_group.

DimensionUnitWhat's being charged
Traces recordedper millionTraces sampled and recorded — the main cost, scaling with request volume × sampling rate.
$5.00/million → 10M = $50/month
Traces retrieved/scannedper millionTraces scanned for queries and the service map.
$0.50/million → 1M = $0.50/month

Sample C3X output

10M traces recorded + 1M scanned in a month:

aws_xray_group.errors
├─ Traces recorded    10M   $50.00
└─ Traces scanned     1M     $0.50
                      Monthly $50.50

Optimization tips

Common ways to reduce aws_xray_group cost without changing the workload.

Tune the sampling rate

Proportional to sample rate

Traces recorded is the cost driver, and X-Ray samples rather than recording every request. A representative sample (the default is a small percentage plus a per-second baseline) captures the picture for a fraction of the cost of 100% tracing.

Exclude low-value endpoints from sampling

Per trace not recorded

Use sampling rules to skip high-volume, low-value paths (health checks, static assets) so you're not recording traces that add no debugging value.

Limit heavy querying

Retrieval cost at scale

Traces scanned for queries and the service map add retrieval cost. It's small next to recording, but avoid automated tools hammering the X-Ray API over wide time ranges.

FAQ

How is AWS X-Ray billed?

Per trace recorded (~$5/million) plus per trace retrieved/scanned (~$0.50/million for queries and the service map), with a monthly free tier. 10M recorded + 1M scanned is ~$50.50/month. The group resource itself is free; tracing usage is what bills.

How do I reduce X-Ray cost?

Tune the sampling rate — X-Ray samples traces rather than recording every request, so a representative sample captures insight at a fraction of full-tracing cost. Also exclude high-volume low-value endpoints (health checks) from sampling rules.

How does c3x estimate the cost?

It's usage-driven, so c3x models X-Ray from traces recorded and scanned in c3x-usage.yml. There's no standing fee for the group.

Related resources

Estimate this resource in your own Terraform

Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including aws_xray_group.