Home icon

Adaptive sampling with AWS X-Ray to capture critical spans

AWS Cloud Operations Blog



This article explains AWS X-Ray's adaptive sampling feature, which dynamically adjusts trace sampling based on runtime conditions to balance observability and cost.

  • Adaptive sampling combines Sampling Boost and Anomaly Span Capture mechanisms
  • Sampling Boost automatically increases sampling rates when anomalies detected
  • Anomaly Span Capture records critical spans independently of sampling rules
  • Root services make sampling decisions; downstream services cannot override
  • Configure local SDK settings via YAML for anomaly conditions and capture limits
  • Sampling rules define baseline rates, reservoir sizes, and maximum boost rates
  • Use low baseline rates for maximum adaptive sampling benefit
  • Cooldown windows prevent continuous elevated sampling during incidents
  • Multi-account/region: boost triggers only in same account/region as root service
  • Monitor SamplingRate metrics to track boost activation and cost impact

Adaptive sampling enables cost-effective capture of critical diagnostic data during failures and latency spikes without increasing steady-state trace volume.



Go to article

The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.

Related articles

Sep 25
2025
AWS X-Ray introduces Adaptive Sampling for automatic optimized error detection
Apr 21
2025
Streamlining trace sampling behavior for AWS Lambda functions with AWS X-Ray
Nov 11
2024
Get x-ray vision into AWS CloudFormation deployments with a timeline view
Apr 26
2024
Using the unified CloudWatch Agent to send traces to AWS X-Ray

The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.