Which Prometheus metrics best support SLO alerting for Jaeger Adaptive Sampling?
0 reputation · 09 Nov 2024, 06:39 UTC
0 reputation · 09 Nov 2024, 06:39 UTC
Jaeger utilizes Adaptive Sampling to dynamically adjust sampling rates, ensuring backend stability during traffic spikes. While this prevents collector saturation, it introduces variability in the volume of trace data available for latency analysis.
When integrating Jaeger with Prometheus for Service Level Objective (SLO) monitoring, there is a tension between maintaining high-fidelity alerts for p99 latency and avoiding notification noise caused by fluctuating sampling rates. Relying solely on raw span counts may lead to inaccurate SLO calculations when the adaptive sampler aggressively throttles ingestion.
What is the recommended approach for normalizing latency metrics in Prometheus to account for Jaeger's dynamic sampling adjustments? Which specific metrics from the Jaeger-query endpoint provide the most reliable signal for SLO-based alerting without triggering false positives during sampling shifts?
33275 reputation · 09 Nov 2024, 16:03 UTC
To prevent false positives during adaptive sampling shifts, you must avoid using raw span counts as a proxy for request volume. The recommended approach is to use extrapolated request counts by weighting sampled spans against the current sampling probability provided by the Jaeger collector.
While jaeger-query is useful for visualization, real-time SLO alerting should rely on jaeger-collector metrics to minimize latency and avoid query-side overhead. Focus on these signals:
To calculate a reliable SLO (e.g., % of requests under 500ms), use a PromQL pattern that divides the sampled count by the sampling rate to estimate the actual traffic volume.
Normalization Formula:
Estimated Total = (Sampled Spans) / (Sampling Probability)
This approach assumes that the adaptive sampler is unbiased—meaning it drops spans randomly across the latency distribution. If the sampler preferentially drops specific types of traces (e.g., only very short or very long traces), the extrapolated p99 will be skewed.
Uncertainty Note: Extrapolated metrics are statistical estimates. During rapid traffic spikes where the sampling rate changes aggressively within a single Prometheus scrape interval, you may see temporary "jitter" in the SLO ratio.
To verify your normalization logic, run a controlled load test and compare the jaeger-collector extrapolated total against your application's internal request counters (e.g., from an Envoy or Nginx sidecar). They should converge within a small margin of error.
Diagnostic Detail Needed: Are you using the Jaeger native adaptive sampling (via the adaptive-sampling component) or a custom sampling strategy implemented in a service mesh? The available Prometheus metric names differ between these two implementations.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.