Crons: Support updating monitor display name through SDK check-in upserts
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 21h 23m
- Merged PRs (30d)
- 607
Description
Problem Statement
Sentry SDKs can create and programmatically manage Cron Monitors through check-in upserts.
monitor_config currently supports properties such as the schedule, timezone, check-in margin, thresholds, and owner. However, it does not support the monitor's human-readable display name.
When a monitor is created through an SDK check-in, Sentry derives its name from the normalized monitor_slug. This couples two different concepts:
monitor_slug: a stable machine-readable identifiername: a human-readable display label
For example:
- slug:
daily-database-backup - display name:
Daily database backup
For monitors managed in code, changes to the schedule and other configuration are automatically propagated to Sentry. The display name should be managed in the same way. Otherwise, applications need a separate authenticated REST API request to keep the name synchronized.
Proposed Solution
Add an optional name field to the monitor configuration accepted by check-in upserts and expose it in SDK MonitorConfig types, similarly to the existing owner field.
Python example:
monitorConfig: MonitorConfig = {
"name": "Daily database backup",
"schedule": {
"type": "interval",
"value": 6,
"unit": "hour",
},
}
with sentry_sdk.monitor(
monitor_slug="daily-database-backup",
monitor_config=monitorConfig,
):
createBackup()
Suggested behavior:
- When creating a monitor through an upsert, use the supplied
name. - If
nameis not supplied during creation, continue using the slug as the fallback. - On subsequent check-ins containing
name, update the existing monitor when the name has changed, just like other code-managed configuration. - If
nameis omitted, do not overwrite the existing monitor name. - Preserve casing, spaces, and Unicode characters in
name; do not slugify it. - Keep
monitor_slugas the stable identity. Changingnamemust not create a new monitor. - Return and display the updated name consistently through the API and Sentry UI.
- Add the field to SDK types, validation, tests, and documentation.
This would allow the complete code-managed monitor definition, including its display name, to remain synchronized with the application.
Related Issues
- Initial check-in upsert design, where the name defaults to the slug: https://github.com/getsentry/sentry/issues/45295
- Support for updating
ownerthrough upserts: https://github.com/getsentry/sentry/issues/69500 - Existing issue concerning names updated through the REST API not being reflected in the UI: https://github.com/getsentry/sentry/issues/116095
Solution Brainstorm
No response
Product Area
Unknown
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the check-in upsert handling for monitor_config and the SDK MonitorConfig types. Find the existing monitor upsert tests and documentation for owner or related configuration fields, then verify the name behavior across creation, updates, omitted values, validation, API responses, and UI display.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100