OpenTelemetry Tail Sampling Strategy Prompt
Design a tail-based sampling strategy in the OpenTelemetry Collector that keeps errors and slow traces while cutting cost, including decision-wait tuning and trace-ID-aware load balancing across Collector replicas.
- Target user
- Observability engineers controlling trace volume and cost
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT, Cursor
The prompt
You are a senior observability engineer who designs cost-effective trace sampling without losing signal on incidents. I will provide: - Current trace volume (spans/sec, traces/sec), retention target, and backend cost per span/trace - The services involved and which are latency- or error-sensitive - Current sampling approach (head, none, vendor default) and the pain (cost, missing errors, blind spots) - Collector deployment mode and replica count Your job: 1. **Head vs tail** — decide what belongs at head (cheap, per-request, e.g. debug/health filtering) vs tail (error/latency/rare-path retention) and justify the split. 2. **Load balancing** — specify the loadbalancing exporter routed by traceID in front of a gateway tier so every span of a trace lands on one instance; show the two-tier config. 3. **Policy design** — build an ordered tail_sampling policy set: status_code=ERROR, latency threshold, specific attribute matches (tenant, route), rate_limiting, and a low probabilistic base rate as the catch-all. 4. **Decision tuning** — set decision_wait, num_traces, and expected_new_traces_per_sec against my volume, and explain the memory implication of each. 5. **Guardrails** — ensure error and high-latency traces are always kept (100%) regardless of the base probabilistic rate, and add a rate limit so a storm can't blow the budget. 6. **Cost model** — estimate retained spans/sec and monthly cost after the policy, versus today. 7. **Validation** — describe how to confirm sampling behaves as intended (synthetic error/slow requests, checking they survive) before full rollout. Output as: (a) two-tier Collector YAML (LB tier + sampling tier), (b) the ordered policy table with rationale, (c) memory/decision_wait sizing math, (d) a cost-before/after estimate, (e) a validation checklist. Flag any policy ordering or topology gap that would cause errors or slow traces to be dropped.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
OpenTelemetry Log Correlation and Trace Linking Prompt
Wire application logs into the OpenTelemetry logs signal and correlate them with traces by injecting trace_id and span_id, so a single click moves between a slow trace and its exact log lines across services.
-
OpenTelemetry Metrics Cardinality Control Prompt
Diagnose and cut runaway metric cardinality in an OpenTelemetry pipeline: find the offending attributes, apply SDK views and Collector transform/filter processors to bound them, and enforce a per-metric series budget before the backend bill explodes.
-
OpenTelemetry Collector Gateway Scaling & HA Prompt
Design a horizontally scalable, highly available OpenTelemetry Collector gateway tier — autoscaling, load balancing, queue persistence, and zero-loss rolling upgrades — so telemetry survives replica churn and traffic spikes.
-
OpenTelemetry Collector Routing & Multi-Backend Fan-out Prompt
Design a routing-connector-based OpenTelemetry Collector topology that fans telemetry out to multiple backends or tenants by attribute — with per-route processors, failover, and cost tiers — without duplicating data or dropping unmatched signals.
More OpenTelemetry prompts & error guides
Browse every OpenTelemetry prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.