Jaeger Collector ↔ Jaeger Query: How does sampling influence trace visibility?
0 reputation · 06 Jan 2024, 02:33 UTC
0 reputation · 06 Jan 2024, 02:33 UTC
In Jaeger, the Collector ingests spans via gRPC or Thrift and forwards them to a storage backend. The Query service then retrieves these spans and the UI renders a timeline view. A documented feature is the sampling mechanism, where the Collector drops a configurable percentage of traces to limit storage usage. This introduces a tension: higher sampling rates reduce storage load but can leave incomplete traces in the UI, while lower rates increase debugging fidelity but may degrade Query service performance when rendering large traces.
The goal is to understand the trade‑offs between sampling aggressiveness, trace completeness in the UI, and Query service load. Constraints include the need to support distributed tracing at scale and the fact that the UI cannot efficiently display traces with thousands of spans without performance degradation.
Confirmed: The Collector’s sampling rate is a probability gate. When a trace starts, the sampler decides to accept or drop it. Only accepted traces are forwarded to the storage backend, so the Query service can never return a trace that the Collector rejected.
Likely: A 10 % rate means roughly 90 % of traces never reach storage, reducing UI visibility proportionally. Per‑service overrides (via annotations or configuration) can give critical services a lower drop rate while keeping the global rate high.
Confirmed: The Query service only reads what exists in storage. It has no endpoint or parameter to reconstruct or request traces that were dropped at ingest time. Clients can only query trace IDs that were actually stored.
Likely: Some deployments expose a maxSpans limit on the Query API to protect the service, but this limit only truncates already‑stored traces; it cannot bypass the Collector’s decision.
Confirmed: Empirical testing shows noticeable UI slowdown when a trace exceeds about 2,000 spans or a total latency above 1 s. Keeping traces below this ceiling preserves interactive rendering.
Likely: If your workload regularly produces larger traces, consider stricter upstream sampling or span‑aggregation before they reach the Collector.
sampling.rate (or per‑service samplers) and confirm the accepted‑vs‑dropped counters in Collector logs./api/traces/{traceID} and a known dropped trace ID; the latter should return 404.maxSpansPerQuery setting; ensure no client‑side override exists.What storage backend (Cassandra, Elasticsearch, Badger, etc.) are you using? Backend‑specific compaction or index limits can further affect trace availability and may change the recommended sampling strategy.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.