ref(skills): replace sentry-create-alert with sentry-create-monitor - #323
Open
evanpurkhiser wants to merge 2 commits into
Open
Conversation
The old skill only covered the response half of Sentry's model, so it had no answer for "alert me when latency crosses 800ms" -- that needs a monitor to open the issue before an alert can act on it. It also froze a copy of the workflow-engine payload schema into the skill, which had already drifted: the condition table was missing several filter types and every trigger type real orgs use. The replacement points at the live API reference instead, which Sentry serves as Markdown at docs.sentry.io/api/monitors/<slug>.md. The alert condition catalog alone is ~20k characters and changes without notice, so a frozen copy is a liability rather than a convenience. The skill now carries the procedure and the traps; the reference carries the fields. Both are needed because the reference alone is misleading. It documents `metric_issue` as though it were the only monitor type, when the endpoint accepts anything registered with a detector validator -- uptime, cron and mobile-builds monitors are all creatable. It also implies PUT replaces an object when detector updates run partial, and lists `frequency`'s UI presets in a way that reads as an enum when the schema takes any integer. Uptime monitors skip the API entirely: the MCP has create, update and delete tools for them, needing neither a token nor a hand-built payload. Two facts that cost real debugging time are stated up front. An organization auth token authenticates as an anonymous user, and the detector endpoints reject anonymous callers while the workflow endpoints accept them -- so an org token creates alerts fine and 401s on listing monitors, which looks arbitrary rather than like a bad token. And while PUT merges at the top level, any array in the body is authoritative, so sending `actionFilters: []` deletes every filter and action under it. The monitors/alerts concept doc picks up the naming mismatch that makes this API hard to navigate -- monitors are `detectors` in the URL, alerts are `workflows`, and `/monitors/` is the legacy Crons API that shouldn't be used at all.
saponifi3d
approved these changes
Aug 5, 2026
saponifi3d
left a comment
There was a problem hiding this comment.
lgtm - def moves the ball forward and improves creating alerts, thanks for updating all this!! 🙏 (s/o to the plans and troubleshooting table in the skill.md, i feel like that will be a great way to steer the LLMs too)
| | Metric | `metric_issue` | The reference page — `dataSources` (query), `config` (detection type), `conditionGroup` (thresholds) | | ||
| | Uptime | `uptime_domain_failure` | **The MCP, not this API** — see Playbook B | | ||
| | Cron | `monitor_check_in_failure` | One `dataSources` entry holding the monitor’s `name`/`slug`, `owner`, and cron `config` (schedule, timezone, checkinMargin, maxRuntime, thresholds). The detector `config` is empty | | ||
| | Mobile builds | `preprod_size_analysis` | `dataSources` and `config` per its own validator | |
There was a problem hiding this comment.
just a heads up that this detector doesn't use datasources; it's storing everything in the config as well.
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.
sentry-create-alertonly covered the response half of Sentry's monitors-and-alerts model. A request like "alert me when p95 latency crosses 800ms" has no answer there — a monitor has to open the issue before an alert can act on it. This replaces it withsentry-create-monitor, covering both stages.Why it points at the live schema
The old skill froze a copy of the workflow-engine payload schema into itself, and it had already drifted — the condition table was missing
event_attribute,latest_releaseandpercent_sessions_*, plus the trigger types real orgs actually use (new_high_priority_issue,seer_activity_trigger).Sentry serves its API reference as Markdown (
docs.sentry.io/api/monitors/<slug>.md), so the skill fetches the endpoint page before building any payload. The alert condition catalog alone is ~20k characters and ships new types without notice; a frozen copy is a liability. The skill carries the procedure and the traps, the reference carries the fields.Why the reference isn't enough on its own
Verified against
getsentry/sentry, several things the reference implies are wrong or incomplete:metric_issueis the only creatable monitor typeuptime_domain_failure), cron (monitor_check_in_failure) and mobile builds (preprod_size_analysis) are all creatablePUTneeds the full payloadpartial=True;PUT {"enabled": false}is complete. But any array you send is authoritative —"actionFilters": []deletes every filter and actionconfig.frequencyis one of a list of values{"type": "integer", "minimum": 0}. The list is the UI's presets50is "Low"supported_condition_resultsis{75, 50, 0}—25is rejected outrightThe skill also documents four endpoints absent from the reference:
/detector-types/,/available-actions/(the only source for a PagerDuty servicetargetIdentifier),/test-fire-actions/for proving a notification route before committing to it, and the legacy-alert-rule ID mappers.The auth-token trap
OrgAuthTokenAuthenticationresolves toAnonymousUser, andorganization_detector_index.pyguards every method withif not request.user.is_authenticatedwhileorganization_workflow_index.pyhas no such guard. So an organization token creates alerts fine but 401s on listing monitors — which reads as a scope problem and isn't. The skill calls for a user token and spells out that 401 means wrong token type, 403 means missing scope.Uptime monitors bypass the API
The MCP has
create_uptime_monitor/update_uptime_monitor/delete_uptime_monitor, so uptime needs neither a token nor a hand-assembled payload. The skill routes there and only falls back to/detectors/if the tools are absent.Also in here
references/concepts/monitors.mdgains the naming mismatch that makes this API hard to navigate: monitors aredetectorsin the URL, alerts areworkflows, and/organizations/{org}/monitors/is the legacy Crons API that shouldn't be used. Its coverage and MCP claims are corrected too.sentry-get-started's menu claimed monitors/alerts and OTel weren't built as skills; both now route properly.Verified with
scripts/lint.sh, includingbuilt-linksagainst the hydrated tree.