/platform-extras-skills:distributed-tracing-with-tempo-and-jaegerfrom platform-extras-skills
Guides configuring Grafana Tempo or Jaeger as a distributed tracing backend: storage selection, retention, sampling strategies, and trace-to-metrics/logs correlation. Use for setting up trace storage or querying traces with TraceQL.
Ships in platform-extras-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
A distributed trace is only as useful as the backend that stores, retains, and lets you query it — and that backend has its own set of operational decisions distinct from how telemetry gets produced and routed to it. Grafana Tempo and Jaeger are the two dominant open-source tracing backends: Tempo is object-storage-native (S3/GCS/ Azure Blob, or local disk for small deployments) and designed to be cheap to run at scale by trading fast arbitrary search for ID-based lookup plus structural indexing via TraceQL; Jaeger supports a wider range of storage backends (Elasticsearch, Cassandra, Badger for local/dev) and has historically stronger built-in search-by-tag UX. Both solve the same core operational problems this skill covers: how long to retain traces and at what storage cost, how much of the total trace volume to actually keep (sampling), and how to make a trace ID pivotable into the logs and metrics for the same request rather than a dead-end visualization. This skill covers the backend/storage layer specifically — instrumenting applications and configuring the receiver → processor → exporter pipeline that feeds traces into Tempo/Jaeger is the OpenTelemetry Collector's job, covered in opentelemetry-instrumentation-and-collector-configuration, which this skill assumes is already in place and cross-references rather than repeats.
compactor,
ingester, querier, distributor components — deployable
monolithically for small setups or as separate microservices at
scale).Choose Tempo's storage backend deliberately for anything beyond a quick local trial — object storage is the intended production backend, trading some query latency for storage cost far below Elasticsearch/Cassandra at comparable trace volume:
# tempo.yaml
storage:
trace:
backend: s3
s3:
bucket: tempo-traces-prod
endpoint: s3.us-east-1.amazonaws.com
region: us-east-1
pool:
max_workers: 100
queue_depth: 10000
Set retention via the compactor, sized to an explicit investigation/compliance window rather than an unconsidered default — trace storage grows quickly at real production volume, so retention is a genuine cost/usefulness tradeoff, not a "keep everything" default:
compactor:
compaction:
block_retention: 336h # 14 days
A shorter retention (days, not weeks) is common for traces specifically, since traces are typically used for near-term incident investigation rather than long-term trend analysis (which metrics handle far more cheaply) — validate the actual retention need against how far back responders realistically need to pull a trace, not a copy-pasted value from an unrelated system.
For Jaeger, choose the storage backend based on query needs and existing operational expertise, not just default familiarity:
# jaeger-collector storage flags (Elasticsearch backend)
--es.server-urls=https://elasticsearch.observability.svc:9200
--es.index-prefix=jaeger
--es.num-shards=3
--es.num-replicas=1
Elasticsearch gives Jaeger rich ad hoc tag-based search out of the box, at the operational cost of running (and capacity-planning) an Elasticsearch cluster; Badger is fine for a single-node/development Jaeger instance but is not a multi-node/HA-capable production backend.
Set Jaeger's index rollover and retention via curator/ILM policy on the Elasticsearch side, mirroring the same deliberate-retention discipline as Tempo's compactor setting:
{
"policy": {
"phases": {
"hot": { "min_age": "0ms", "actions": { "rollover": { "max_age": "1d" } } },
"delete": { "min_age": "14d", "actions": { "delete": {} } }
}
}
}
Decide head-based vs. tail-based sampling deliberately — head-based (a probabilistic decision made once, at or near the start of a trace, usually in the SDK or the Collector) is cheap and simple but can miss rare, interesting traces (a specific slow or erroring request) purely by chance; tail-based (a decision made after the whole trace is assembled, keeping traces that match interesting criteria regardless of a random sample) catches those but requires every span of a trace to reach the same Collector instance before a decision can be made:
# head-based: simple probabilistic sampling at the SDK/Collector
processors:
probabilistic_sampler:
sampling_percentage: 10
# tail-based: keep all errors and all slow requests, sample the rest
# (this belongs in the OpenTelemetry Collector gateway tier — see
# opentelemetry-instrumentation-and-collector-configuration for the
# full pipeline this feeds into Tempo/Jaeger from)
processors:
tail_sampling:
decision_wait: 10s
policies:
- name: sample-errors
type: status_code
status_code: { status_codes: [ERROR] }
- name: sample-slow
type: latency
latency: { threshold_ms: 500 }
- name: sample-baseline
type: probabilistic
probabilistic: { sampling_percentage: 10 }
Tail-based sampling is the right default for production systems where the rare slow/erroring request is exactly what an investigation needs to find — but it only works correctly if every span for a given trace ID reaches the same Collector replica (see the load-balancing exporter note in opentelemetry-instrumentation-and-collector-configuration).
Set Jaeger's per-service sampling strategy if using Jaeger's own native sampling configuration rather than Collector-side sampling:
{
"service_strategies": [
{
"service": "checkout-service",
"type": "probabilistic",
"param": 0.1
},
{
"service": "payments-service",
"type": "probabilistic",
"param": 1.0
}
],
"default_strategy": { "type": "probabilistic", "param": 0.05 }
}
A higher-value or higher-risk service (payments) can warrant a much higher (or 100%) sampling rate than a high-volume, lower-risk service, trading storage cost for near-complete visibility where it matters most.
Configure trace-to-logs correlation in Grafana's Tempo datasource so a trace view links directly into the matching Loki log lines, scoped by the trace ID:
# Grafana datasource provisioning
apiVersion: 1
datasources:
- name: Tempo
type: tempo
url: http://tempo-query-frontend.observability.svc:3100
jsonData:
tracesToLogsV2:
datasourceUid: loki-datasource-uid
spanStartTimeShift: '-5m'
spanEndTimeShift: '5m'
filterByTraceID: true
filterBySpanID: false
customQuery: true
query: '{service_name="$__span.tags.service.name"} | json | trace_id="$__trace.traceId"'
This is the backend-side half of the correlation described in
incident-investigation-using-metrics-logs-traces;
it only works if the application/Collector layer actually puts the
trace_id into structured log lines in the first place, which is an
instrumentation concern covered in
opentelemetry-instrumentation-and-collector-configuration.
Configure trace-to-metrics correlation so a trace view can jump to the relevant service's request-rate/error-rate/latency dashboard, and so metrics exemplars (a specific trace ID attached to a histogram data point) link back into Tempo:
jsonData:
tracesToMetrics:
datasourceUid: prometheus-datasource-uid
queries:
- name: 'Request rate'
query: 'sum(rate(http_requests_total{service="$__span.tags.service.name"}[5m]))'
Exemplars require the metrics backend and instrumentation to actually
attach a trace ID to a metric sample at scrape/ingest time — confirm
Prometheus has --enable-feature=exemplar-storage enabled and the
application's metrics library is configured to attach exemplars, not
just that the Grafana panel is configured to display them.
Query traces with TraceQL (Tempo) for structural, multi-condition searches that go beyond a single tag match:
{ .service.name = "checkout-service" && duration > 500ms && status = error }
{ .service.name = "payments-service" } >> { .db.system = "postgresql" && duration > 200ms }
The second example finds traces where a payments-service span has a
descendant Postgres span slower than 200ms — a structural query no
single-tag search could express.
For Jaeger, search by service, operation, tags, and duration range via its query API/UI rather than pulling every trace and filtering client-side:
GET /api/traces?service=payments-service&tags={"error":"true"}&minDuration=200ms&lookback=1h
trace_id in a service's structured logs as a
platform gap to close, not an accepted limitation — correlation is
only as good as the weakest-instrumented service in a call chain.Symptom: A trace that should still be within the configured
retention window returns "trace not found" when queried.
Fix: Check the compactor's block_retention (Tempo) or the
Elasticsearch ILM delete phase (Jaeger) against the actual query time —
a retention value that looks generous in days can still be shorter
than expected if it was set relative to ingestion time rather than
span time, or if a recent compactor/ILM policy change hasn't fully
applied to already-written blocks/indices yet. Confirm the effective
retention with tempo-cli (or the Elasticsearch ILM explain API)
rather than assuming the configured value has already taken effect
everywhere.
Symptom: Tail-based sampling is configured, but a known slow/ erroring trace never shows up in Tempo/Jaeger. Fix: Tail sampling requires every span of a trace to reach the same Collector replica before the sampling decision fires — if multiple stateless Collector replicas sit behind a plain round-robin load balancer, a trace's spans scatter across replicas and no single replica ever sees the whole trace to make a keep/drop decision. Route by trace ID with a load-balancing exporter (see opentelemetry-instrumentation-and-collector-configuration) so tail sampling actually has complete traces to evaluate.
Symptom: Clicking "Logs for this span" in Grafana's trace view
returns no results, even though the corresponding log lines definitely
exist in Loki.
Fix: The tracesToLogsV2 correlation query's label selector or
the trace_id JSON field name doesn't match what the service actually
emits in its structured logs (e.g. the correlation config expects
trace_id but the application logs traceId or a different casing).
Pull a real log line for that trace ID directly in Loki's Explore view
to confirm the actual field name/format, then align the datasource's
correlation query to match exactly.
Symptom: A dashboard's metric panels never show exemplar dots,
even though tracing and metrics both appear to be working
independently.
Fix: Exemplars require explicit opt-in on both the metrics backend
(--enable-feature=exemplar-storage on Prometheus) and the
application's metrics instrumentation library — confirming traces
work and metrics work independently doesn't confirm the two are
actually being linked at the sample level. Enable exemplar storage and
confirm the client library version/config actually attaches a
trace_id exemplar to relevant histogram observations.
Symptom: Trace storage costs (or Elasticsearch/Cassandra cluster size for Jaeger) grow far faster than expected shortly after a service's traffic increases. Fix: Sampling is likely set too high (or absent — 100% head sampling) for the new traffic volume, or tail-based sampling's baseline probabilistic rate wasn't re-evaluated after the volume change. Revisit per-service sampling rates against current traffic and re-confirm retention is still set deliberately rather than drifting upward from a well-intentioned but unreviewed change.
Scenario: Standing up Tempo as the tracing backend for
checkout-service and payments-service (both already emitting OTLP
traces via the Collector gateway from
opentelemetry-instrumentation-and-collector-configuration),
with tail-based sampling, 14-day retention, and full trace-to-logs/
trace-to-metrics correlation in Grafana.
storage:
trace:
backend: s3
s3:
bucket: tempo-traces-prod
region: us-east-1
compactor:
compaction:
block_retention: 336h # 14 days, matching the platform team's agreed incident-investigation window
otlp/tempo, with a load-balancing
exporter routing by traceID so tail sampling sees complete traces.tracesToLogsV2
pointed at the Loki datasource, matching on trace_id in the same
structured-log field both services already emit, and
tracesToMetrics pointed at Prometheus for a per-service request-
rate/latency query.{ .service.name = "checkout-service" && duration > 1s } >> { .service.name = "payments-service" }
finding traces where checkout-service is slow specifically because
of a downstream payments-service span, then clicks "Logs for this
span" to land directly on payments-service's log lines for that
exact trace_id, closing the loop from trace to root-cause log
detail without a separate manual log search.trace_id correlation query.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
distributed-tracing, grafana-tempo, jaeger, trace-storage, sampling, traceql
16 skills in this plugin
/backstage-developer-portalGuides building an internal developer portal with Backstage — authoring catalog-info.yaml to register services in the software catalog, setting up TechDocs for docs-as-code, writing Software Templates to scaffold new services, and understanding the plugin architecture. Use when a user asks to "register a service in Backstage", "write a catalog- info.yaml", "set up TechDocs", "create a Backstage software template for scaffolding new repos", "add a Backstage plugin", or "build an internal developer portal."
/fluent-bit-configuration-validationValidates Fluent Bit pipeline configuration syntax and tests the INPUT/FILTER/OUTPUT pipeline against sample log lines before a production rollout — dry-run checks, parser testing, and route/Match verification. Use when a user asks to "validate this Fluent Bit config before deploying," "test my Fluent Bit parser against sample logs," "will this Fluent Bit change break log routing," "check this Fluent Bit config in CI," or reports logs silently missing/misrouted after a Fluent Bit config change.
/fluent-bit-log-forwarding-configurationConfigures Fluent Bit as a lightweight log forwarder — INPUT sources (`tail`, `systemd`, Kubernetes container logs), FILTER stages (`kubernetes` metadata enrichment, `parser`, `grep`, `modify`, `nest`/`lift`), and OUTPUT routing to Loki, Elasticsearch/OpenSearch, or S3, including multiple outputs via tags/`Match` and backpressure/ buffering settings. Use when the user asks to "set up Fluent Bit," "forward Kubernetes pod logs to Loki/Elasticsearch/S3," "write a Fluent Bit parser for my log format," "route different logs to different outputs," or "Fluent Bit is dropping logs / backing up."
/incident-investigation-using-metrics-logs-tracesGuides correlating Prometheus metrics, log queries, and distributed traces together during a live incident investigation — using each signal's strengths to narrow from "something is wrong" to a specific root cause faster than any single signal alone. Use when a user asks to "investigate this incident using our metrics and logs," "find the root cause across dashboards, logs, and traces," "correlate this latency spike with logs and a trace," "pivot from an alert to the actual failing request," or is actively triaging a live production issue and needs a systematic cross-signal approach rather than guessing which dashboard to check next.
/karpenter-cluster-autoscalingGuides configuring Karpenter for Kubernetes node autoscaling — NodePool and EC2NodeClass (or equivalent) provisioning, consolidation and bin-packing behavior, Spot/On-Demand mixing, and how Karpenter compares to and can replace the Kubernetes Cluster Autoscaler. Use when a user asks to "set up Karpenter", "write a NodePool spec", "reduce node cost via consolidation/bin-packing", "mix Spot and On-Demand nodes", "choose between Karpenter and Cluster Autoscaler", or "debug why pods are stuck Pending / a node won't scale down."
/kubecost-cost-visibilityGuides deploying Kubecost inside Kubernetes clusters to allocate cloud spend down to namespace, workload, and label, build showback/chargeback reports for platform stakeholders, and feed cost signals into cluster autoscaling and rightsizing decisions. Use when a user asks to "show cost per namespace/team/label in Kubernetes", "set up Kubecost", "build a Kubernetes showback or chargeback report", "find which workload is driving the cloud bill", "size resource requests based on cost", or "connect Kubernetes cost data to autoscaler decisions."
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin platform-extras-skillsOther plugins' skills for the same job