getsentry / getsentry/sentry

Cron Monitor `name` through API not reflected in the Sentry UI

Open
#116,095 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Crons Product Area: Crons
Dominant language
Python
Stars
44.8k
Forks
4.9k
Avg merge
21h 23m
Merged PRs (30d)
607

Description

Environment

SaaS (https://sentry.io/)

Steps to Reproduce
  1. Create a new cron monitor using the PHP SDK DSN {"tag": "my-monitor"} by
$checkInId = SentrySdk::getCurrentHub()->captureCheckIn(
    $slug,
    CheckInStatus::error(),
    null,
    $resolvedConfig,
    $trackingId,
);
  1. Patch the monitor according to the docs with {"tag": "my-monitor", "name": "My Monitor"}
$response = $this->httpClient->request('PUT', sprintf(
    'https://sentry.io/api/0/organizations/%s/monitors/%s/',
    $this->orgSlug,
    $slug,
), [
    'auth_bearer' => $this->authToken,
    'json' => [
        'name' => $label,
        'config' => $this->monitorConfigToApiPayload($monitorConfig),
    ],
    'timeout' => 5,
]);
  1. Confirm the patch through the API worked by asserting response status code 200 and by pulling the data back from the API returns the patched name field (it does).
  2. Go to the Sentry frontend and navigate to the created monitor.

I can see the configuration is managed programmatically:

This monitor is managed in code and updates automatically with each check-in.

Expected Result

I can see the updates concerning name and configuration through the API reflected in the frontend, the monitor has the name My Monitor in the frontend. The breadcrumbs print

Monitors - Cron - My Monitor

Actual Result

I can see the updates concerning name and configuration through the API reflected in the frontend, except the monitor has the name my-monitor in the frontend. The breadcrumbs print

Monitors - Cron - my-monitor

Other information is reflected correctly in the frontend: threshold configuration, interval,... all correct.

I suspect a regression here because I'm rather confident it had worked in the past with the name properly showing up in the frontend. Whilst the data is set correctly in the backend.

Product Area

Crons

Link

No response

DSN

No response

Version

No response

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 monitor update API at /api/0/organizations/{org}/monitors/{slug}/ and the frontend monitor page that renders the breadcrumb name. Reproduce the PUT with a distinct name, then compare the API response and the value used by the UI. Done means the patched monitor name, rather than its slug, appears in the frontend and breadcrumbs.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, python
Domain
api, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.