Skip to content

No MCP tool counts performance/generic issue events in a time window #2280

Open

Description

@sentry-junior

No MCP tool can count events for performance or other generic issues (N+1 queries, slow DB queries, etc.) over a fixed time window. Callers fall back to search_errors or search_traces, and both give an empty or failed answer.

From user feedback MCP-SERVER-GQH (2026-11-15, Linear's agent, server 0.42.0). MCP-SERVER-GP2 (2026-11-12, also Linear's agent, a different user) reported the same gap as a side note.

What happened

The caller wanted exact per-issue event counts in [start, end) for a list of issues, some of them performance issues.

  1. get_sentry_resource resolved the issues fine.
  2. search_errors with issue.id:[…] timestamp:>=… timestamp:<… and fields=["issue.id","count()"] ran on dataset=errors with the absolute window kept (traces 2f32e101, 52dc19b9). It returned counts for some IDs and no rows for the rest (9 of 9 in the second call). That is expected for performance issues: the errors dataset has no performance/generic occurrences.
  3. search_traces with issue.id:7833063087 inside a prose request failed validation with INVALID issue.id — Unknown attribute (trace c13c8fc3). Spans don't carry the issue ID, so a clean query can't do this either. The prose part of that call is the toolkit#2263 pattern; commented there separately.
  4. search_issue_events lists events for one issue, but it has no count(), caps at 100 events, and has no cursor (toolkit#2143), so it can't give an exact count.

Cause

  • PUBLIC_EVENTS_DATASETS is spans, errors, logs, metrics, profiles (packages/mcp-core/src/utils/events-datasets.ts:1-7 at cfd76ae). No search tool reaches the issue platform dataset.
  • Sentry's events endpoint already supports it: DATASET_OPTIONS["issuePlatform"] in getsentry/sentry src/sentry/snuba/utils.py:48 (0af5f8184). Checked live: GET /api/0/organizations/{org}/events/?dataset=issuePlatform&field=issue.id&field=count()&sort=-count() returns 200 with per-issue counts. The same map also has an occurrences trace item type (EAP), which may be the longer-term target.

Options

  • Let search_issue_events (or search_issues) return an exact count() for one or more issues over an absolute start/end, backed by dataset=issuePlatform for non-error issues and errors for error issues.
  • Or let the search_errors runner switch to issuePlatform when the issue.id filters point at non-error issues, and say so in the result.
  • At minimum: when search_errors gets issue.id filters and returns no rows, add a note that performance/generic issue events are not in the errors dataset, and name the tool that can count them.

Reports

2: MCP-SERVER-GQH, MCP-SERVER-GP2 (part 3).

Not checked: the type of every issue in the caller's list (I relied on the caller's own query text), and start/end on dataset=issuePlatform (only statsPeriod was tried live).

via automation evt_905b9c478746fd9deeb853f85ad7441b · Run ID dispatch_bbbfefbbb6caae96f29cedd9ba376bcf.

--

View Session [Sentry]

Activity

  1. linear-code commented on Nov 15, 2026

    @linear-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions