getsentry / getsentry/sentry

Crons: Support updating monitor display name through SDK check-in upserts

Open
#120,430 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Crons Improvement Product Area: Crons
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 identifier
  • name: 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:

  1. When creating a monitor through an upsert, use the supplied name.
  2. If name is not supplied during creation, continue using the slug as the fallback.
  3. On subsequent check-ins containing name, update the existing monitor when the name has changed, just like other code-managed configuration.
  4. If name is omitted, do not overwrite the existing monitor name.
  5. Preserve casing, spaces, and Unicode characters in name; do not slugify it.
  6. Keep monitor_slug as the stable identity. Changing name must not create a new monitor.
  7. Return and display the updated name consistently through the API and Sentry UI.
  8. 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

Solution Brainstorm

No response

Product Area

Unknown

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.