Skip to content
AI Skills Central

Type to search Agent Skills, workflows, tutorials, tools and the glossary.

Agent Skill

Trace root cause analysis (Datadog)

Finds why an LLM app fails in production: samples failing spans in Datadog, groups them into failure modes, then walks each trace from symptom to root cause.

name: agent-observability-trace-rcaBy DatadogChecked
View source on GitHub
Bookmark

Bookmarks are kept in your free account, so you can find this page again on any device.

Sign in to bookmark

Install

Commands are pinned to commit 08f6988, the version we read, wherever the install method supports it.

npx skills

Terminal
npx skills add datadog-labs/agent-skills@08f698841e0dfbba09832296f20f13faa44680eb --skill agent-observability-trace-rca -a claude-code

Copies the skill into .claude/skills/ in this project, pinned to the reviewed commit.

Plugin marketplace

Claude Code prompt
/plugin marketplace add datadog-labs/agent-skills
/plugin install agent-skills@datadog-labs

Run inside Claude Code. Installs the whole Datadog agent-skills plugin (all of its skills) from its default branch, not the pinned commit.

What it does

It answers “what is wrong with my LLM app?” from production traces rather than from guesses. The agent first picks a backend: Datadog’s MCP server if its LLM Observability tools are loaded, otherwise the pup CLI, otherwise it stops and tells you how to connect one. It then chooses one of three modes without asking: eval signal when LLM-judge evaluators are configured for the app, error signal for runtime errors, and a generic mode that looks for structural problems such as latency outliers, agent loops and retrieval misses.

The method is the error-analysis approach from evals work, applied to traces. It samples failing spans, reads them, writes free-form notes on each (“open coding”), merges those into a small set of failure modes (“axial coding”), and only then walks the span tree for the top three to five modes. A bad LLM answer is treated as a symptom: the cause is often a parent agent’s instructions, a sibling retrieval step or a tool that returned bad data. The report gives counts and percentages, links every claim to a trace, proposes concrete fixes with before-and-after text, and marks anything based on fewer than five examples as tentative.

When to use it

Your LLM app or agent already sends traces to Datadog LLM Observability, an eval score has dropped or errors have appeared, and you want a diagnosis grounded in real spans rather than a hunch. It suits the moment after “something is wrong” and before “let’s change the prompt”: you get a failure taxonomy with counts, the trace that shows each failure best, and the span where it started. With your codebase open, it searches for the system prompt, tool definitions or routing code it blames and proposes diffs, asking before it edits.

When to skip it

If you are not on Datadog LLM Observability, the skill has nothing to read; the same method works by hand on any tracing tool, as our guide to evaluating an LLM app with error analysis shows. Skip it when the app has no traces yet (LLM Observability instrumentation is the first step) and for a single failing request you can already open and read. The skill is long: about 41 KB of instructions that load in full each time it triggers, and a run makes many tool calls, so expect it to use a good share of your context and quota.

Try it

What's wrong with support-bot over the last 7 days? The
answer_correctness eval pass rate dropped from 92% to 78% after
Tuesday's prompt change.

What it can touch

Bundles scripts
Yes
Pre-approved tools
See source
Needs
Datadog account with LLM Observability and traces from your app; Datadog MCP server (llmobs toolset) or the pup CLI, logged in
Client-specific fields
None, spec fields only

Its scripts run with your permissions, and it may have changed since the commit we read. How to check a skill.

  • Datadog, read access: through the MCP server’s LLM Observability tools or pup llm-obs, it searches spans, reads span content (system prompts, full conversations, retrieved documents, metadata) and evaluator configs. That content can include your users’ messages; the skill tells the agent to anonymise names and emails in the report.
  • Shell: in pup mode it runs pup commands through Bash, and it may write small parsing scripts for MCP results.
  • Datadog, write access, only if you choose: after the report it offers to save a Markdown file, export a Datadog notebook (via MCP or pup notebooks create, writing a JSON payload to /tmp first), or apply fixes to your code. It is told to take none of these actions automatically.
  • Setup commands it suggests: claude mcp add --scope user --transport http datadog-llmo-mcp pointing at mcp.datadoghq.com, or pup auth login. Both give the agent your Datadog permissions.
  • Every MCP call is tagged with a telemetry.intent string naming the skill and an invocation ID, so Datadog can see the skill’s activity.
  • evals/ contains Python files (hence “has scripts”); the skill does not run them.

At commit 08f6988 the SKILL.md is 784 lines long. Alongside it:

  • evals/ (8 entries): Datadog’s own test harness for the skill: executor.py (builds a /agent-observability-trace-rca prompt and invokes the skill), evaluator.py, a judge rubric, an example config and an empty dataset. The executor imports helper modules from elsewhere in the repository, so it does not run from this folder alone, and the skill never calls it.

Outline of the SKILL.md

We have not reproduced this SKILL.md because it is 784 lines and about 41 KB, too large to show usefully here; it is MIT-licensed, so you are free to read and copy it at the source. Its main sections at the reviewed commit:

  • Backend (MCP or pup detection, invocation ID, intent tagging)
  • Methodology, Usage and Inputs (ml_app, eval_name, timeframe, mode, failure_filter)
  • Available Tools (eval discovery, trace and span exploration, parallelisation rules)
  • Analysis Workflow: Phase 0 (resolve inputs and infer mode), Phase 1 (find problematic spans, per mode), Phase 1.5 (app profile and where the root cause lives), Phase 2 (open coding), Phase 3 (axial coding), Phase 4 (navigate from symptom to root cause), Phase 5 (recommendations), Phase 6 (RCA report), Phase 7 (post-analysis actions and notebook export)
  • Output Format, Operating Rules and the pup Tool Reference

Alternatives

Read AI agent observability for what to trace before you need a root cause. LLM Observability instrumentation from the same repository gets traces into Datadog in the first place. For bugs in ordinary code rather than LLM behaviour, systematic debugging applies the same symptom-to-cause discipline.

SKILL.md

We have not reproduced this file here; the outline above lists its sections. Read the SKILL.md on GitHub.

  • LLM Observability instrumentation (Datadog)

    Adds Datadog LLM Observability to a Python or Node.js app that calls LLMs: detects the stack, adds SDK setup and checks session IDs flow through.

    Checked at c9195f8

  • Systematic debugging

    obra's root-cause-first debugging process from Superpowers: investigate, compare against working code, test one hypothesis at a time, and only then fix.

    Engineering workflowJesse Vincent (obra)Bundles scriptsChecked at 22f0b46

  • MCP server builder

    A four-phase guide to designing, building, testing and evaluating MCP servers in Python (FastMCP) or TypeScript, with reference docs and an eval harness.

    AnthropicBundles scriptsChecked at e4bb5d9