Skip to content
Calcrivo

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.

Inputs

requests
%
%

Console views, Trace Map and API queries all count as retrievals.

USD
USD
USD

100,000 traces recorded and 1,000,000 retrieved each month.

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

  1. Values used

    Requests per month = 100,000,000 requests; Sampling rate = 5 %; Share of traces retrieved or scanned = 10 %; Tracing budget per month = 100 USD; Price per million traces recorded = 5 USD; Price per million traces retrieved or scanned = 0.5000 USD; Apply the monthly free tier = Yes

  2. X-Ray Trace Cost

    traces recorded = requests × sampling rate; cost = (recorded − free tier) ÷ 1 M × record price + (retrieved − free tier) ÷ 1 M × retrieval price.

  3. 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.

  4. Estimated Monthly Cost

    = 24.50

  5. Traces Recorded per Month

    = 5,000,000

  6. Trace Recording Cost

    = 24.50

  7. Trace Retrieval Cost

    = 0.00

  8. Sampling Rate That Fits the Budget

    = 19.90

  9. Cost per Million Requests

    = 0.25

How it works

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.

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.

You might also need