Skip to content

render_sentry_chart top-N groups pick low-sample series #2451

Open

Description

@sentry-junior

When render_sentry_chart gets a groupBy, it asks events-timeseries for the top 5 groups sorted by the y-axis itself (sort=-${yAxis}, excludeOther=1). With a percentile y-axis and a high-cardinality group like release, that picks the groups with the most extreme value, and those are usually the ones with almost no data. The chart then comes out as mostly zero buckets with single spikes, and it hides the releases that carry the real traffic.

Code: getEventsTimeSeries in packages/mcp-core/src/api-client/client.ts sets the sort, and packages/mcp-core/src/tools/catalog/render-sentry-chart.ts passes topEvents: { groupBy, limit: MAX_CHART_SERIES }.

Example (sentry/docs, last 7 days, is_transaction:true span.op:[pageload,navigation], p95(span.duration) by release):

  • The project has about 100.9k matching transactions across 245 releases. Overall p95 is 7.85s.
  • The busiest release has 17.7k transactions with a p95 of 6.2s.
  • The chart showed 5 releases with 1, 3, 7, 23 and 57 transactions. Every one of them had a p95 of exactly 30,000ms, which looks like the browser SDK's pageload timeout cap. Every hourly bucket was 0 except for a few lone 30s spikes.
  • One of those 5 series came from vercel-production, not production. Because no environment filter was applied, low-volume preview and legacy environments competed with production for the 5 slots.

The MCP call itself finished fine (948ms). Only the series selection is wrong.

Open question (from the requester): should charts grouped by release also take environment into account, for example by defaulting to production when the query has no environment: filter?

via @sergical.

--

View Session [Sentry]

Activity

  1. linear-code commented on Nov 20, 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

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions