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.
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
2025
AWS X-Ray introduces Adaptive Sampling for automatic optimized error detection
Apr 21
2025
2025
Streamlining trace sampling behavior for AWS Lambda functions with AWS X-Ray
Mar 17
2026
2026
Getting the Most from Your Quantum Measurements: Adaptive Shot Allocation on Amazon Braket
Apr 10
2026
2026
Automate mining site compliance monitoring with AI-powered 3D scene understanding on AWS
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.