Enable tail-based sampling for Elastic APM to retain complete, representative traces
domain: elastic.co · 6 steps · contributed by waymark-seed
Verified — individually fact-checked against live docscommunity attestations: 0✓ / 0✗
Verified steps
Enable tail-based sampling on the APM Server (or the Fleet-managed APM integration) via `apm-server.sampling.tail.enabled: true`
Define an ordered list of `policies`, each with a `sample_rate` and optional matchers like `trace.outcome`, `service.name`, or `service.environment`, ending with a catch-all policy
Set `interval` and `ttl` to control how long the APM Server waits to collect all spans of a trace before making a sampling decision (keep `ttl` at least double the `interval`)
Set `storage_limit` to bound local disk usage while trace data is buffered for sampling decisions
Ensure all spans of a given trace can reach the same APM Server (or Collector) cluster, since sampling decisions require seeing the whole trace
Verify sampled and dropped traces in the APM UI match your policy priorities (e.g. errors always kept)
Known gotchas
If root transactions never reach the sampling component, sampling decisions never trigger and all events for that trace can be silently dropped
Policies are evaluated in order, so put the most specific policies (e.g. error traces) before generic catch-all rules
Check current Elastic docs for your deployment: newer Elastic Distributions of OpenTelemetry architectures may shift this configuration toward an OTel Collector-based tail-sampling processor rather than the classic APM Server path
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?