X-Ray Trace Cost Calculator
Price AWS X-Ray from request volume and sampling rate, and find the sampling percentage that fits a tracing budget.
About X-Ray Trace Cost Calculator
X-Ray bills per trace recorded, not per segment, so a trace crossing eight services costs the same as one crossing two — the variable you control is the sampling rate. Retrieval is a second, much cheaper meter that counts every trace the console or Trace Map loads, which is why an always-open service map on a busy account is not free. Inverting the arithmetic gives the sampling rate a fixed budget can afford. Confirm current prices for your region. Sampling is the only real lever on tracing cost, and choosing it blind means either paying to record traces nobody will look at or sampling so thinly that the one failing request is never captured.
Formulas
X-Ray Trace Cost
traces recorded = requests × sampling rate; cost = (recorded − free tier) ÷ 1 M × record price + (retrieved − free tier) ÷ 1 M × retrieval price.
- sampling rate
- Share of requests that produce a trace — the default rule is 1 request/s plus 5%
- trace recorded
- One complete trace written, however many segments it contains
- trace retrieved
- One trace read by the console, Trace Map or the API
Budget-driven sampling
budget sampling rate = (budget ÷ cost per trace + free traces) ÷ requests, where cost per trace = record price + retrieval share × retrieval price, both per trace.
Worked example
With the default values below, X-Ray Trace Cost Calculator returns Estimated Monthly Cost of $24.50. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Requests per monthminimum 0 requests
- 100,000,000 requests
- Sampling rateaccepts 0–100 %
- 5 %
- Share of traces retrieved or scannedaccepts 0–1,000 %
- 10 %
- Tracing budget per monthminimum 0 USD
- 100 USD
- Price per million traces recordedminimum 0 USD
- 5 USD
- Price per million traces retrieved or scannedminimum 0 USD
- 0.5 USD
- Apply the monthly free tier
- Yes
Results
- Estimated Monthly Cost
- $24.50
- Traces Recorded per Month
- 5,000,000
- Trace Recording Cost
- $24.50
- Trace Retrieval Cost
- $0.00
- Sampling Rate That Fits the Budget
- 19.90%
- Cost per Million Requests
- $0.25
Step by step
- 1Values used
- 2X-Ray Trace Cost
- 3Budget-driven sampling
- 4Estimated Monthly Cost= 24.50
- 5Traces Recorded per Month= 5,000,000
- 6Trace Recording Cost= 24.50
- 7Trace Retrieval Cost= 0.00
- 8Sampling Rate That Fits the Budget= 19.90
- 9Cost per Million Requests= 0.25
Assumptions and limits
- The result is derived only from the 7 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 2 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
How is X-Ray Trace Cost calculated?
traces recorded = requests × sampling rate; cost = (recorded − free tier) ÷ 1 M × record price + (retrieved − free tier) ÷ 1 M × retrieval price. X-Ray bills per trace recorded, not per segment, so a trace crossing eight services costs the same as one crossing two — the variable you control is the sampling rate. Retrieval is a second, much cheaper meter that counts every trace the console or Trace Map loads, which is why an always-open service map on a busy account is not free. Inverting the arithmetic gives the sampling rate a fixed budget can afford. Confirm current prices for your region.
Why does X-Ray Trace Cost matter?
Sampling is the only real lever on tracing cost, and choosing it blind means either paying to record traces nobody will look at or sampling so thinly that the one failing request is never captured.
What values do I need to enter?
This calculator takes 7 inputs: Requests per month, Sampling rate, Share of traces retrieved or scanned, Tracing budget per month, Price per million traces recorded, Price per million traces retrieved or scanned, Apply the monthly free tier. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.
What sampling rate should I use?
The X-Ray default reservoir of one request per second per rule plus 5% of the remainder works well for most services: it guarantees continuous coverage on quiet endpoints and caps cost on busy ones. Raise it temporarily during an incident, and add a dedicated high-rate rule for a low-traffic critical path.
Does a trace with more services cost more?
No. The charge is per trace recorded, so fan-out across services and Lambda functions does not multiply the cost — which makes X-Ray comparatively cheap for deep serverless call chains where each hop would otherwise be a separate billed item.
Related Calculators
You might also need
- Serverless Health Score CalculatorCommonly used together
- CloudTrail Storage CalculatorCommonly used together
- CloudWatch Log Cost CalculatorCommonly used together
- CloudWatch Metrics CalculatorCommonly used together
- Lambda Cost CalculatorAlso in AWS Serverless
- API Gateway Cost CalculatorAlso in AWS Serverless
