Agent Skillslangfuse/langfuse › debug-issue-with-datadog

debug-issue-with-datadog

GitHub

用于生产环境故障排查的调试技能。通过结合Datadog遥测数据与代码仓库,分析用户报告、Issue或告警,定位根本原因并输出结构化分析报告,而非直接提供修复补丁。

.agents/skills/debug-issue-with-datadog/SKILL.md langfuse/langfuse

Trigger Scenarios

调查用户反馈的生产错误 处理Linear或GitHub上的故障Issue 响应监控告警以理解异常原因 对粘贴的生产错误日志进行分诊

Install

npx skills add langfuse/langfuse --skill debug-issue-with-datadog -g -y
More Options

Non-standard path

npx skills add https://github.com/langfuse/langfuse/tree/main/.agents/skills/debug-issue-with-datadog -g -y

Use without installing

npx skills use langfuse/langfuse@debug-issue-with-datadog

指定 Agent (Claude Code)

npx skills add langfuse/langfuse --skill debug-issue-with-datadog -a claude-code -g -y

安装 repo 全部 skill

npx skills add langfuse/langfuse --all -g -y

预览 repo 内 skill

npx skills add langfuse/langfuse --list

SKILL.md

Frontmatter
{
    "name": "debug-issue-with-datadog",
    "description": "Establish root cause by combining Datadog telemetry with the Langfuse repo.\nUse when investigating or triaging a user report, Linear or GitHub issue,\nincident, or pasted production error."
}

Debug Issue with Datadog

Use this skill whenever the task is investigative rather than implementational: a user, customer, or oncall has surfaced a problem and you need to figure out what is actually happening in production and where in the code it lives. The deliverable is an analysis, not a patch — though the analysis should make the right patch obvious.

When to Apply

  • A Linear issue (typically with an LFE-XXXX ID) describes a production failure, error spike, or customer report.
  • A GitHub issue or pasted incident/error report needs triage.
  • A monitor alerted and you need to understand why before deciding what to fix.
  • Existing tickets under the "Make monitoring useful again" project (parent LFE-8837) and similar — these expect the structured analysis output below.

If the task is "implement this fix" rather than "figure out what's broken", this is the wrong skill — go to backend-dev-guidelines or the relevant package guide.

Workflow

Read the inputs first, then plan the Datadog sweep, then read the code, then write the analysis. Do not skip ahead to suggested patches before the data supports them.

  1. Intake. Pull every signal already available in the report. See references/intake.md. For a Linear URL/ID, fetch the issue and its comments via the Linear MCP — the description is often updated inline as triage proceeds. For a GitHub issue, use gh issue view. For pasted text, treat it as the description. If intake contains an alert identity (a Datadog monitor ID or title, an incident.io alert/INC reference, or an on-call page), first apply incident-alert-tickets — a documented cause section may resolve the investigation before any sweep.

  2. Scope the sweep. From the intake, pick the affected subsystem and time window. Use references/repo-debug-map.md to translate "PostHog integration", "ingestion failures", "evals stuck", etc. into the Datadog filters and source files you should be looking at.

  3. Run the broad Datadog sweep. Default to the full sweep in references/datadog-playbook.md: APM spans, error logs, metrics, and monitors — split across prod-eu and prod-us (and prod-hipaa / prod-jp when relevant). Always check regional disparity first; it usually rules whole hypotheses in or out. Use datadog-query-recipes for reusable tenant, public API, queue consumer, and cross-environment query shapes.

  4. Cluster the errors. Group by (projectId, error.message) or (error.type, error.message). Treat each distinct cluster as its own hypothesis — Langfuse incidents commonly have multiple coexisting root causes, not one.

  5. Map clusters to code. For each cluster, open the relevant handler file from the repo-debug map and read enough of it to confirm or refute the hypothesis. Cite specific files and line ranges in the output.

  6. Write the analysis using references/output-template.md.

  7. Deliver. Default: print the analysis in chat. If the user asked for it, also save under the workflow they specified (file, Linear comment via, etc.). If the investigation was anchored to an alert identity, also offer the human-gated write-back from incident-alert-tickets: append the established root cause as a dated cause section, or create the monitor's ticket.

Datadog MCP Usage Notes

Two Datadog MCP servers are typically available — one bound to the EU site (datadoghq.eu) and one to the US site (datadoghq.com). Always run region-relevant queries against both unless intake clearly localizes the incident. The prod-eu / prod-us env tags live on each side respectively.

  • Span search filter pattern: service:worker resource_name:"process posthog-integration-project" status:error
  • Log search filter pattern: service:worker env:prod-eu @langfuse.project.id:cm1r6u… status:error
  • For high-volume queries, prefer aggregate_spans / aggregate_events grouped by (error.message, projectId) over fetching individual traces.
  • Always link to the Datadog UI for the queries you ran (final section of the output template).

See references/datadog-playbook.md for the full set of starter queries and parameter shapes.

Output Expectations

From the output template:

  • Header: data source, time window, region split (EU vs US table).
  • Hotspots: per-projectId (or per-cluster) error counts.
  • Root cause by error class: each cluster gets a short hypothesis with reasoning, distinguishing primary causes from symptoms.
  • Suggested patches: P0/P1/P2 grouped, with concrete file paths and short code sketches. Reference the actual handler in worker/src/features/** or web/src/**.
  • Dashboards: paste the Datadog query URLs at the end.

Findings come first, recommendations last. If the data is thin, say so explicitly and propose what would need to be true to confirm each hypothesis — do not invent root causes.

Cross-References

  • Per-monitor knowledge base — look up documented causes before the sweep, record new ones after (human-gated): incident-alert-tickets
  • Production telemetry query recipes, tenant/public API usage, and queue consumer measurements: datadog-query-recipes
  • Backend layout, queue contracts, instrumentation patterns: backend-dev-guidelines
  • ClickHouse-related findings (memory ceilings, JOIN spills, slow queries): clickhouse-best-practices
  • Once a fix is identified and you switch to implementation, hand off to the package AGENTS.md for the affected directory.

Version History

  • f7e3c26 Current 2026-08-20 17:47

Same Skill Collection

.agents/skills/add-model-price/SKILL.md
.agents/skills/agent-setup-maintenance/SKILL.md
.agents/skills/analyze-cloud-costs/SKILL.md
.agents/skills/backend-dev-guidelines/SKILL.md
.agents/skills/changelog-writing/SKILL.md
.agents/skills/clickhouse-best-practices/SKILL.md
.agents/skills/code-review/SKILL.md
.agents/skills/create-repo-agent/SKILL.md
.agents/skills/cursor-agents-workflow/SKILL.md
.agents/skills/datadog-query-recipes/SKILL.md
.agents/skills/frontend-browser-review/SKILL.md
.agents/skills/frontend-large-feature-architecture/SKILL.md
.agents/skills/git-workflow/SKILL.md
.agents/skills/grill-me/SKILL.md
.agents/skills/housekeeping/SKILL.md
.agents/skills/incident-alert-tickets/SKILL.md
.agents/skills/infra-scaling/SKILL.md
.agents/skills/langfuse-codebase-navigator/SKILL.md
.agents/skills/langfuse-previews/SKILL.md
.agents/skills/linear-bug-triage/SKILL.md
.agents/skills/pnpm-upgrade-package/SKILL.md
.agents/skills/posthog-instrumentation/SKILL.md
.agents/skills/react-component-cleaner/SKILL.md
.agents/skills/react-component-guidelines/SKILL.md
.agents/skills/refactor-react-effects/SKILL.md
.agents/skills/security-review/SKILL.md
.agents/skills/seed-test-data/SKILL.md
.agents/skills/sentry-instrumentation/SKILL.md
.agents/skills/skill-creator/SKILL.md
.agents/skills/turborepo/SKILL.md
.agents/skills/weekly-production-review/SKILL.md
web/.agents/skills/vercel-composition-patterns/SKILL.md
web/.agents/skills/vercel-react-best-practices/SKILL.md
.agents/skills/storybook/SKILL.md

Metadata

Files
0
Version
f6e56cb
Hash
f0b7f5f7
Indexed
2026-08-20 17:47

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-30 04:06
浙ICP备14020137号-1 $Гость$