Repository navigation
fix(mcp): Clamp find_dropped_events interval to what Sentry accepts - #1831
Open
sentry-junior[bot] wants to merge 2 commits into
Open
sentry-junior[bot] wants to merge 2 commits into
sentry-junior[bot] wants to merge 2 commits into
Conversation
The events-dropped endpoint rejects intervals longer than a day, ones that do not divide a day, and ones that create more than 1000 buckets. Keep accepted intervals, otherwise use the smallest valid interval that is at least as large and report the change in intervalNote. Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
BYK
requested changes
Nov 3, 2026
Move the stats period unit table, parser, and the minute interval ladder into @sentry/toolkit-core so find_dropped_events and the CLI use one implementation, per review feedback.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
find_dropped_eventspassedintervalstraight through. In the last 7 days insentry/mcp-server, about 1.3K calls (~360 direct, ~920 throughexecute_sentry_tool) failed with "The interval has to be less than one day". The most common values were7d,30d,14dand1w, usually the same value asstatsPeriod. A smaller tail failed with "should divide one day" (e.g.23h,13h) and "too many results" (e.g.1hover90d).I checked these limits against Sentry source.
organization_events_droppedruns an outcomes query, and that goes throughsessions_v2.get_constrained_date_rangeat one-minute resolution. The interval has to be a whole number of minutes, at most 1 day, divide 1 day evenly, and give at most 1000 buckets across the range.What changed:
intervalNotesaying what was used instead of what. A value that isn't a duration at all (e.g.hourly) is dropped with a note, and Sentry picks the interval.statsPeriodorstart/end. With no range, the tool doesn't guess Sentry's default window.intervaldescription now says the range is'1m'to'1d'.via @BYK.
--
View Session [Sentry]