# AWS X-Ray (Account)

> X-Ray meters traces three ways: per trace recorded, per trace retrieved, and per trace scanned by queries. Sampling rate is the multiplier, and a 100% sampling rule left on after debugging inflates all three. ZopNight tracks X-Ray cost at the account level and recommends sampling-rate corrections.

Source: https://zop.dev/integrations/aws/xray-account
Updated: 2026-08-19

---

AWS X-Ray traces requests through distributed applications, billed per trace recorded, retrieved, and scanned. Tracing cost scales with sampling rates and traffic, and full-sampling configurations left on after debugging inflate the bill.

## Three trace meters, one multiplier

X-Ray charges when a trace is recorded, again when traces are retrieved, and again when queries scan them. Those are three meters, all downstream of one decision: the sampling rule. The default samples the first request each second plus 5% of the remainder, which keeps recording costs modest at almost any traffic level. Raise sampling to 100% on a busy service and every meter scales with raw request volume; the recording charge alone starts tracking traffic linearly, and the console queries that made full sampling attractive now scan proportionally more.

## Account-level trend watching

ZopNight treats X-Ray as an account-level concern: a dedicated provider tracks tracing spend from Cost Explorer or CUR 2.0, and sampling-rate recommendations flag the signature of debugging sessions that never ended, a step change in trace-recording volume that persists for weeks after the incident that caused it. Because sampling rules are centrally stored and take effect across every instrumented service, one forgotten rule can inflate tracing cost estate-wide, and one correction can bring it back.

## How tracing bills balloon

The debugging ratchet is the classic: sampling raised to capture a rare failure, incident closed, rule forgotten. Instrumentation sprawl is subtler: sidecar-based service meshes and Lambda active tracing switch on trace emission per service, and each addition raises recorded volume at the current sampling rate. Retention-driven scanning completes the set: dashboards and cron-driven analytics that query broad time ranges pay the scanned meter continuously, even when sampling is sane.

## Verifying the sampling posture

Sampling rules live in the CloudWatch console's X-Ray settings, listing each rule's rate, reservoir, and priority. The audit is short: any rule at or near 100% needs a justification with a name attached, and the service map's trace volumes show which services generate the traces the account pays to record and scan.
