-
Notifications
You must be signed in to change notification settings - Fork 97
sentry plugin: CLI confusion and span aggregation gaps #854
Description
Summary
The sentry CLI at cli.sentry.dev (v0.16.0) is a fully capable tool with trace, span, issue, log commands — but it is easy to confuse with sentry-cli (the classic release/artifact tool), and its span querying capabilities have meaningful gaps that should be addressed in the plugin.
Background
When an agent attempted to count unique organizations with MCP tool call activity over a 30-day window, it bypassed the CLI and went straight to raw Sentry API calls. Two root causes:
-
Name collision with
sentry-cli— The CLI atcli.sentry.devis unrelated to thesentry-clinpm/binary tool that developers commonly know. Nothing in the plugin or documentation disambiguates these clearly. -
sentry span listrequires a trace ID — The command signature issentry span list <org>/<project>/<trace-id>. There is no way to query spans across traces using attribute filters (e.g.has:mcp.tool.name) or to do aggregations (count distinct values, group-by). This is the primary reason the agent fell back to the raw EAP API endpoint. -
sentry-mcp.mdagent prompt does not reference the CLI — The sentry-mcp plugin's agent system prompt (plugins/sentry-mcp/agents/sentry-mcp.md) has no mention of thesentryCLI tool. Agents using the plugin have no signal that a CLI is available and what it can/cannot do. -
Junior's CLI reference (
cli-commands.md) is incomplete — The internal skill reference only documentsissue,org, and common flags. Commands fortrace,span,log, andeventare absent, so the agent had no reason to try them.
Scope
- Disambiguate the
sentryCLI fromsentry-cliin docs/README — at minimum a callout box or note - Add
trace,span,log, andeventcommand shapes to internal agent references - Add span aggregation / cross-trace attribute search capability to the CLI (or document clearly that this must go through the raw EAP API)
- Consider adding a
sentry span searchsubcommand that accepts arbitrary span attribute filters without requiring a trace ID, analogous tosentry issue list
Dependencies
The EAP spans API endpoint (/api/0/organizations/{org}/spans/) supports the aggregation query needed. The CLI would need to expose that surface, or the plugin docs should direct agents to the raw API for this class of query.
Action taken on behalf of David Cramer.