/platform-extras-skills:incident-investigation-using-metrics-logs-tracesfrom platform-extras-skills
Guides correlating Prometheus metrics, log queries, and distributed traces during live incident investigation to narrow from aggregate symptoms to specific root cause.
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.
Metrics, logs, and traces each answer a different question well and a different question poorly: metrics tell you that something is wrong and roughly when it started, across an aggregate, cheaply and at scale, but not why for any single request. Logs tell you the specific detail of what happened for a request or a component, but only if you already know roughly where to look. Traces tell you exactly where time went across a distributed call chain for one specific request, but only for requests that were actually sampled/captured. Used in isolation, each signal either gives you an aggregate trend with no concrete cause, or a needle-in-a-haystack detail search with no starting point. This skill covers the investigative workflow of moving between the three deliberately — metrics to scope and localize, traces to find the specific slow/failing span, logs to get the concrete error detail at that span — as distinct from the setup and query-authoring skills for each signal individually (see prometheus-and-grafana-monitoring-stack, promql-query-authoring, and logql-query-authoring), which this skill assumes are already in place and doesn't repeat.
trace_id/request_id propagated through
request headers and included in structured log lines and (ideally) as
an exemplar or label on relevant metrics. Without a shared
correlation key, cross-signal pivoting degrades to time-window
guessing instead of a precise join.Start from metrics to scope and localize, not to root-cause directly. Metrics answer "what changed, when, and how broadly" — use them to narrow the blast radius before touching logs or traces:
sum by (service) (rate(http_requests_total{status_code=~"5.."}[5m]))
histogram_quantile(0.95, sum by (le, service) (rate(http_request_duration_seconds_bucket[5m])))
Identify: which specific service(s) show the anomaly, exactly when it started, and whether it's isolated to one service or shared across several (a shared regression across unrelated services points upstream — a shared dependency, a network path, an infra layer — rather than one service's own bug).
Use the metrics timeline to pick a precise time window, then pivot to that window specifically in logs/traces rather than searching an arbitrarily wide range — a narrow, metrics-derived window is both faster to query and less likely to return noise from unrelated events:
metric shows error rate step-change at 14:32 UTC
→ logs/trace queries scoped to 14:25-14:40 UTC, not "today"
Pivot to traces next when the request path spans multiple services — a trace shows exactly which span in the call chain consumed the time or produced the error, which is often not the service that surfaced the symptom at the edge:
# find a representative slow/failing trace in the scoped window
trace search: service=edge-gateway, duration>2s, time=[14:25,14:40]
Read the trace's span breakdown, not just its total duration — the specific span with the outsized duration or the error status is the actual localized cause; a slow edge-facing span is frequently just waiting on a slow downstream span, not itself the bottleneck.
Extract the correlation ID from the implicated trace/span
(trace_id, request_id) and pivot to logs using that exact ID**,
not a broad keyword/time-range search — this turns "search for
something relevant" into "get every log line for this exact
request":
{service="payments-processing"} | json | trace_id="4bf92f3577b34da6a3ce929d0e0e4736"
This is the highest-precision pivot available: a trace ID match returns exactly the log lines for the one request under investigation, filtering out everything from concurrent unrelated traffic in the same time window.
When no shared trace ID is available (traces not instrumented for the implicated service, or tracing not in place at all), fall back to a metrics-scoped log search — narrower than a raw keyword search, but the next best thing:
{service="payments-processing", env="production"}
|= "error"
| json
| status_code >= 500
scoped to the precise time window from step 2, using the specific service(s) identified in step 1 — see logql-query-authoring for writing this query efficiently and avoiding an unbounded scan.
Read the actual log line/trace span content for the concrete
error, not just its count. A log line's exception message, stack
trace, or a span's error.message tag is what turns "requests to
this service are failing" into "this service is failing because its
downstream database connection pool is exhausted" — the specific,
actionable detail metrics alone cannot provide.
Correlate back against a change log/deploy timeline once a specific failing component is identified — a recent deploy, config change, or dependency version bump to that exact component in the window from step 2 is the most common actual root cause, and this correlation is what turns "we found where it's failing" into "we know why and what to revert":
14:30 UTC: payments-processing deployed v2.14.0
14:32 UTC: error rate step-change begins
→ strong correlation; treat as the primary suspect
State a working hypothesis explicitly and look for evidence that would disprove it, not just evidence that confirms it — during a live incident it's easy to stop investigating the moment a plausible story emerges; deliberately check whether the timeline, the specific error content, and the affected scope are all consistent with the hypothesis before acting on it, especially before a rollback that itself carries risk.
Document the cross-signal trail as you go (the PromQL query and result, the trace ID and its span breakdown, the specific log lines, the change-log correlation) — this becomes the evidence base for the postmortem (see blameless-postmortem-and-root-cause-analysis) and saves the next responder from re-deriving the same trail from scratch during a recurrence.
After the incident, check whether the cross-signal pivot was actually possible cleanly — if trace IDs weren't propagated into logs, if the affected service had no tracing instrumentation, or if metrics weren't segmented finely enough to localize quickly, treat closing that gap as a concrete action item, not just "investigate faster next time."
trace_id/
request_id) extracted from a trace over a broad keyword search —
treat the absence of a propagated correlation ID as a gap to fix, not
a permanent limitation to work around every time.Symptom: An investigation starts by grepping logs broadly across "everything from the last hour" the moment an alert fires, before checking which specific service or time window the metrics actually implicate. Fix: Start with a metrics query (step 1-2) to scope the blast radius and precise time window first — a targeted log/trace query scoped by that result is both faster to write and far more likely to return the relevant lines instead of noise from unrelated concurrent traffic.
Symptom: The edge-facing service shows elevated latency, gets identified as "the problem," and its team spends time investigating its own code with no findings. Fix: The edge service's elevated latency is a symptom, not necessarily the cause — pull a representative trace (step 3) and read the span breakdown; the edge service is very often just waiting on a genuinely slow downstream span, and the investigation should follow the trace to whichever span actually shows the outsized duration.
Symptom: A log search for the specific failing request returns
hundreds of lines from concurrent, unrelated traffic in the same
window, making it hard to find the actual relevant lines.
Fix: No correlation ID was used to scope the search — pivot using
the exact trace_id/request_id from a representative trace (step
4) instead of a broad keyword/time-range search; if no correlation ID
is available because the implicated service isn't instrumented for
tracing, treat that as a gap to close, not a permanent limitation.
Symptom: The investigation settles on a plausible-sounding root cause quickly, a fix/rollback is applied, and the actual symptom doesn't improve. Fix: The hypothesis was accepted on the first piece of confirming evidence without checking for disconfirming evidence (step 8) — re-verify that the timeline, the specific error content, and the affected scope are all actually consistent with the hypothesis before declaring root cause found, especially before taking an action that itself carries risk.
Symptom: The same class of incident recurs weeks later, and the investigation has to be redone almost entirely from scratch because no one recorded what was checked or found the first time. Fix: The cross-signal trail (queries run, trace IDs pulled, specific log lines found, change-log correlation) wasn't documented during the original investigation. Record it as you go (step 9) so it feeds directly into the postmortem and is available to whoever responds to the recurrence.
Symptom: An ad hoc, broad log query run directly against production during an active incident makes the log backend itself slow, compounding the incident for everyone. Fix: This is the unbounded-query risk covered in logql-query-authoring — scope by every known label, keep the time range as narrow as the metrics-derived window allows, and add a result limit; treat "just grep everything" as a red flag during a live incident, not a shortcut.
Scenario: A PaymentsAPIHighErrorRate alert fires. The on-call
engineer needs to find root cause quickly, and multiple services sit
between the edge gateway and the actual payments-processing backend.
Metrics — scope and localize:
sum by (service, status_code) (rate(http_requests_total{status_code=~"5.."}[5m]))
Shows the error rate is isolated to payments-processing, not the
edge-gateway or payments-api services in front of it, with a
clear step-change starting at 14:32 UTC.
Narrow the window: subsequent queries scoped to
14:25-14:40 UTC specifically, not the full alert-to-now range.
Traces — find the specific failing span: a trace search for
service=payments-processing, error=true, time=[14:25,14:40]
returns a representative trace whose span breakdown shows the
payments-processing span itself failing (not a downstream call) —
confirming the earlier metrics localization at the span level.
Logs — exact pivot via trace ID:
{service="payments-processing", env="production"}
| json
| trace_id="4bf92f3577b34da6a3ce929d0e0e4736"
Returns the exact log lines for that one failing request, showing:
"error": "connection pool exhausted: max_connections=20 reached".
Correlate against the change log: a deploy log shows
payments-processing v2.14.0 deployed at 14:30 UTC, two minutes
before the error rate step-change — the new version's diff shows its
database connection pool size was reduced from 50 to 20 as part of
an unrelated resource-tuning change.
Disconfirm before acting: the hypothesis ("the new pool size is too small for actual concurrent load") is checked against concurrent-connections metrics for the same window, which show usage consistently exceeding 20 — consistent with the hypothesis, not just superficially plausible.
Action: payments-processing is rolled back to the previous
version (matching the rollback discipline in
agent-cost-and-latency-spike-investigation
for a comparable "revert the specific correlated change" pattern);
error rate returns to baseline within minutes.
Document: the PromQL query, the trace ID, the specific log line, and the deploy correlation are all recorded in the incident channel as the investigation happens, feeding directly into the blameless-postmortem-and-root-cause-analysis writeup without needing to be reconstructed afterward.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin platform-extras-skills16 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."
/distributed-tracing-with-tempo-and-jaegerGuides configuring Grafana Tempo or Jaeger as the distributed tracing backend — trace storage backend selection and retention, sampling strategy at the backend/collector level (head-based vs. tail-based), and trace-to-metrics/trace-to-logs correlation so a trace ID can pivot directly into a log line or a metrics exemplar. Use when the user asks to "set up Tempo," "configure Jaeger storage," "set trace retention," "configure trace-to-logs correlation in Grafana," "design a sampling strategy for traces," or "query traces with TraceQL." This is the tracing *backend/storage* layer — instrumenting applications and configuring the OpenTelemetry Collector that feeds this backend is covered separately in opentelemetry-instrumentation-and-collector-configuration.
/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."
/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."
Other plugins' skills for the same job