Skip to content

fix(kuma-config): add retries + lower timeout to stop false-down alerts - #21

Merged
gustavovalverde merged 6 commits into
mainfrom
fix/monitor-retries
Jul 15, 2026
Merged

fix(kuma-config): add retries + lower timeout to stop false-down alerts#21
gustavovalverde merged 6 commits into
mainfrom
fix/monitor-retries

Conversation

@andres-pcg

@andres-pcg andres-pcg commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Problem: intermittent false Down alerts (timeout of 48000ms exceeded, recovering ~1 min later). Root cause: the web-page and several DNS monitors had maxretries: 0 — a single transient timeout fired an instant Down + Slack, with no re-check.

Fix: tune the monitor thresholds and declare them explicitly per monitor in kuma.yaml (desired state lives in the file, not hidden in the applier defaults):

  • interval: 60, retryInterval: 20, maxretries: 3 on every monitor.
  • timeout: 15 on HTTP monitors only (prober + web pages). DNS monitors omit it — Kuma ignores the timeout field for DNS. Timeout is kept < retryInterval so each attempt finishes before the next retry.
  • MONITOR_DEFAULTS in apply.js keeps these as a fallback for new monitors.

A real sustained outage now needs several consecutive failures before alerting; a one-off blip is retried and ignored. Values are uniform for now (validated appropriate for both DNS and HTTP); per-monitor differentiation is easy since they're explicit.

Applied via the config-as-code pipeline on merge (or node apply.js).

Web-page and several DNS monitors had maxretries=0, so a single transient
timeout fired an immediate false Down + Slack. Set defaults to retries=3,
retryInterval=20, timeout=20 (was 48), and drop the now-redundant per-monitor
overrides. A real outage is confirmed over ~60s; a one-off blip is ignored.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts Uptime Kuma monitor reconciliation defaults so transient failures don’t immediately flip monitors to Down, reducing false-positive alerts and Slack noise in production. The change is applied via the existing declarative kuma.yaml + apply.js reconciliation workflow.

Changes:

  • Set monitor defaults in apply.js to maxretries=3, retryInterval=20, and timeout=20 (previously maxretries=0, retryInterval=60, timeout=48).
  • Remove per-monitor interval/retryInterval/maxretries overrides from kuma.yaml so monitors consistently inherit the centralized defaults.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
kuma-config/kuma.yaml Removes per-monitor retry/interval overrides so the declared monitors rely on a single shared set of defaults.
kuma-config/apply.js Updates reconciliation defaults to add retries and reduce timeout, aligning monitor behavior across the fleet.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread kuma-config/apply.js Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread kuma-config/apply.js Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread kuma-config/apply.js
Move interval/retryInterval/maxretries (and timeout for HTTP) back onto each
monitor in kuma.yaml so the desired state is explicit in the file, not implied
by apply.js defaults. Values are uniform for now (60/20/3, timeout 15 on HTTP;
DNS omits timeout since Kuma ignores it); the defaults stay as a fallback.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread kuma-config/kuma.yaml Outdated
Comment thread kuma-config/apply.js Outdated
…TP-only

Per review: MONITOR_DEFAULTS is merged into every monitor payload, so DNS
monitors are sent timeout=15 too (Kuma ignores it for DNS). Reword the comments
to say DNS monitors don't *declare* timeout (rather than 'omit' it).
@gustavovalverde
gustavovalverde merged commit 9943815 into main Jul 15, 2026
1 check passed
@gustavovalverde
gustavovalverde deleted the fix/monitor-retries branch July 15, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants