跳到正文
Skillpedia
部署与云(DevOps)17k · #10759

sentry-triage

它能做什么

这个技能帮助 AI 智能体调查在 Sentry 中报告的错误,无需手动复制堆栈跟踪。适合需要查找新警报或回归问题原因的开发者。

适用场景

  • ✓当新的 Sentry 警报出现,你希望智能体进行调查,而不只是重复标题时。
  • ✓当某个缺陷似乎在发布后出现,你希望找到可疑提交和文件时。
  • ✓当你希望获得未解决的主要错误摘要,并附带复现提示时。

技能链接

https://github.com/composio-community/awesome-codex-skills/blob/master/sentry-triage/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/composio-community/awesome-codex-skills/blob/master/sentry-triage/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“Sentry 上出现了结账页面的新警报。请帮我调查,并告诉我哪个文件可能是原因。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会通过 Composio 工具获取问题及其最新事件,包括堆栈跟踪和面包屑。然后它会把每个堆栈帧对应到你项目中的源文件,并提出修复方案。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Sentry Triage

Pull Sentry issues, events, and suspect commits straight into the agent via the Composio CLI. Skip the copy-paste-stack-trace dance.

When to Use

  • New Sentry alert and you want the agent to investigate, not just quote the subject line.
  • Diagnosing a regression: find the releases, suspect commit, and affected files.
  • Building a "top 10 unresolved issues" digest with reproduction hints.

Prereqs

curl -fsSL https://composio.dev/install | bash
composio login
composio link sentry        # auth token with event:read + project:read

Discover Tools

composio search "get sentry issue" --toolkits sentry
composio search "list events for issue" --toolkits sentry
composio tools list sentry

Common slugs (verify with --get-schema):

  • SENTRY_GET_AN_ISSUE
  • SENTRY_LIST_AN_ISSUES_EVENTS
  • SENTRY_RETRIEVE_AN_EVENT_FOR_A_PROJECT
  • SENTRY_LIST_A_PROJECTS_ISSUES
  • SENTRY_UPDATE_AN_ISSUE

Diagnose a Single Issue

  1. Fetch the issue (by short ID like PROJ-1F4 or numeric ID):
    composio execute SENTRY_GET_AN_ISSUE -d '{"issue_id":"PROJ-1F4"}'
    
  2. Grab the latest event with full stack + breadcrumbs:
    composio execute SENTRY_LIST_AN_ISSUES_EVENTS \
      -d '{"issue_id":"PROJ-1F4","full":true,"limit":1}'
    
  3. Map each frame to local source. For each filename + lineno in the stack, the agent opens the file and reads ±20 lines. No manual copy-paste.
  4. Check suspect commits (Sentry attaches these when release tracking is set up) — open them with git show <sha> locally.
  5. Propose a fix with a diff, run tests, and — once green — mark the issue resolved:
    composio execute SENTRY_UPDATE_AN_ISSUE \
      -d '{"issue_id":"PROJ-1F4","status":"resolved","statusDetails":{"inNextRelease":true}}'
    

Triage a Batch

composio execute SENTRY_LIST_A_PROJECTS_ISSUES -d '{
  "organization_slug":"acme",
  "project_slug":"api",
  "query":"is:unresolved age:-24h",
  "sort":"freq",
  "limit":20
}'

Pipe into jq for a ranked summary:

composio execute SENTRY_LIST_A_PROJECTS_ISSUES -d '{"organization_slug":"acme","project_slug":"api","query":"is:unresolved"}' \
  | jq -r '.[] | "\(.count)\t\(.shortId)\t\(.title)"' | sort -rn | head

Workflow File

scripts/sentry-diag.ts, run with composio run --file scripts/sentry-diag.ts -- --id PROJ-1F4:

const id = process.argv[process.argv.indexOf("--id") + 1];

const issue = await execute("SENTRY_GET_AN_ISSUE", { issue_id: id });
const [event] = await execute("SENTRY_LIST_AN_ISSUES_EVENTS", {
  issue_id: id, full: true, limit: 1
});

const frames = (event?.entries ?? [])
  .filter(e => e.type === "exception")
  .flatMap(e => e.data.values.flatMap(v => v.stacktrace?.frames ?? []))
  .filter(f => f.inApp)
  .map(f => ({ file: f.filename, line: f.lineno, fn: f.function }));

console.log(JSON.stringify({ title: issue.title, culprit: issue.culprit, frames }, null, 2));

The agent then reads each file at line ± 20 and drafts a patch.

Route to Linear / Slack

Chain tools to open a ticket for the top unresolved issue:

composio run '
  const [top] = await execute("SENTRY_LIST_A_PROJECTS_ISSUES", {
    organization_slug: "acme", project_slug: "api",
    query: "is:unresolved", sort: "freq", limit: 1
  });
  await execute("LINEAR_CREATE_ISSUE", {
    teamId: "TEAM_ID",
    title: `[Sentry] ${top.title}`,
    description: `Short ID: ${top.shortId}\nPermalink: ${top.permalink}\nCount: ${top.count}`
  });
'

Troubleshooting

  • 404 on issue_id → use the short ID (PROJ-1F4), not the URL slug.
  • Empty events → the issue was resolved/archived; query with query:"is:resolved" or bump limit.
  • Missing suspect commit → release tracking isn't configured in Sentry; set up sentry-cli releases in CI.
  • No inApp frames → source maps not uploaded; stack will only show vendor code.

Full CLI reference: docs.composio.dev/docs/cli

常见问题

连接 Sentry 需要什么?

你需要通过 Composio 工具连接 Sentry,使用一个可以读取事件和项目的令牌。

它能读取堆栈跟踪吗?

可以。它会获取包含完整堆栈跟踪和面包屑的最新事件。

它会修改 Sentry 中的问题吗?

该技能包含更新操作,因此当你要求时,它可以修改问题。

详情

作者的原始描述

Diagnose Sentry issues without copy-pasting stack traces. Uses the Composio CLI to pull issue details, events, breadcrumbs, and suspect commits, then maps the frames to local source so the agent can propose a fix directly.

repo: composio-community/awesome-codex-skills

热度

GitHub 星标
17k
排名
#10759
许可证
—
更新时间
2026/7/25

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能