Sampling in a distributed OpenTelemetry system requires coordination between services to ensure consistent sampling decisions across your entire application. In a microservice architecture, every service needs to use the same sampling method to maintain trace consistency. Without this coordination, you might end up with incomplete traces where some spans are sampled while others are not.Documentation Index
Fetch the complete documentation index at: https://docs.atla-ai.com/llms.txt
Use this file to discover all available pages before exploring further.
Recommended Approach
Main Orchestrating Application
Set the sampling method in your primary service that initiates requests:All Other Microservices
Configure downstream services to inherit the sampling decision from the main application:How This Works
- Parent-based sampling: The
ParentBased(ALWAYS_ON)sampler checks if there’s a parent span from another service - Inheritance: If a parent span exists and was sampled, the child service will also sample
- Consistency: This ensures that either the entire distributed trace is sampled or none of it is