Repository navigation
fix(uptime): configure uptime-checker API endpoint for Test Monitor and assertion validation - #4583
Merged
aldy505 merged 1 commit intoOct 25, 2026
Conversation
…nd assertion validation
aldy505
approved these changes
Oct 25, 2026
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.
Fixes #4582
Problem
"Test Monitor" fails when creating a new uptime monitor. The button shows "Uptime check failed" with no reason, for any URL (even
https://example.comwith a singlestatus code = 200assertion). The API call behind it returns HTTP 400 with an empty body:A second effect: invalid assertions (for example a broken JSONPath like
$.[[) are saved without any validation error. Scheduled uptime checks keep working.Root cause
The uptime-checker container exposes an HTTP API on port 12345, which Sentry uses to run the Test Monitor preview and to validate assertions. But Sentry's default uptime region has no API endpoint (
api_endpointdefaults to""), and the self-hosted config never sets it. So on self-hosted, those calls are silently skipped: Sentry never calls the checker, Test Monitor returns an empty 400, and assertion validation does nothing.api_endpointdefault:conf/types/uptime.py#L17uptime/checker_api.py#L41-L61Nonebecomes an empty 400:organization_uptime_alert_preview_check.py#L78-L81Noneis treated as "valid":validators.py#L176-L178The button became visible on self-hosted when the feature flag was removed in getsentry/sentry#110478.
Fix
Override
UPTIME_REGIONSinsentry/sentry.conf.example.pywith the same default region plusapi_endpoint="uptime-checker:12345": the uptime-checker service name on the Docker network and its default webserver port. Scheduled checks don't use this endpoint (they go through Redis and Kafka), so they're unaffected.How I tested it
I ran the latest self-hosted release (26.10.0, fresh install,
COMPOSE_PROFILES=feature-complete, no.env.custom) on an AWS EC2 instance (Ubuntu 24.04, Docker 29.9.2, Compose v5.6.1) and reproduced the error withhttps://example.combefore the fix, both through the API and the UI.Before the fix:
settings.UPTIME_REGIONS→[('default', 'Default Region', 'default', '')]400, empty body; the uptime-checker received no requestwebcontainer (POST http://uptime-checker:12345/execute_config) →200, so the API itself works$.[[→ saved (200), while the checker's own/validate_checkrejects it withcompilation_errorAfter adding the block and restarting
webandtaskworker:example.com, status = 200 →200,"status": "success"example.com, status = 201 →200,"status": "failure","Assertion failed"200,"status": "failure",dns_errorhttps://api.github.com(UI) → "Uptime check passed successfully"$.[[on create →400 {"assertion": {"error": "compilation_error", …}}, not savedsuccessevery minuteExisting installs
Fresh installs get the fix automatically. Existing installs don't:
install.shonly createssentry/sentry.conf.pywhen it's missing, so running it again changes nothing. Those users need to add the same block to theirsentry/sentry.conf.pyby hand and restart (docker compose restart web taskworker).Would you like a follow-up PR with a migration script (like
install/migrate-pgbouncer.sh) that detects a missingUPTIME_REGIONSand adds it, or is a release note enough?I'm a big fan of this project, and it helps me a lot in my daily work. Thanks for building it!
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.