Skip to content

feat: add alert silence - #7630

Open
mabed-fr wants to merge 7 commits into
louislam:masterfrom
mabed-fr:feat/alert-silence
Open

feat: add alert silence#7630
mabed-fr wants to merge 7 commits into
louislam:masterfrom
mabed-fr:feat/alert-silence

Conversation

@mabed-fr

@mabed-fr mabed-fr commented Jul 25, 2026

Copy link
Copy Markdown

Summary

This pull request adds Alert Silence (alert acknowledgment) to Uptime Kuma — a feature long requested by users coming from tools like Nagios, Zabbix, and Centreon.

The core idea: when an on-call engineer is already aware of a DOWN incident, Uptime Kuma keeps firing repeated notifications with no operational value. There was no way to say "I know, I'm on it" without either pausing the monitor (which stops checks and corrupts uptime metrics) or disabling notifications entirely (which affects all monitors).

This is my first contribution to the Uptime Kuma project. I did my best to follow the project's coding standards and conventions, and I welcome any feedback or suggestions for improvement.

AI assistance was used to help generate and refine the documentation, as well as to update the translated language files. All AI-assisted modifications were carefully reviewed, validated, and approved before being committed. The feature implementation, validation, and integration testing were performed manually. Extensive testing was carried out to verify the new functionality and to ensure it does not introduce regressions or impact existing features.

Changes made:

  • New silenceMonitor / unsilenceMonitor socket events — validated server-side: requires a non-empty reason, monitor must be DOWN, user must own the monitor.
  • Notification suppression — while silenced, all notifications are blocked including resend intervals. Checks continue normally; uptime % is unaffected.
  • Auto-clear on recovery — when the monitor comes back UP, the silence is automatically lifted so the next DOWN event notifies normally.
  • Event history — silencing is recorded as an important heartbeat entry with a distinct violet "Silenced" badge; only the user's reason is displayed.
  • Single monitor UI — Silence / Unsilence buttons on the detail page, info banner with message and timestamp, violet badge next to monitor name.
  • Bulk action — Silence added to the multi-select Actions dropdown; blocked with an error if any selected monitor is not DOWN.
  • List filter — Silenced monitors hidden by default; a Silenced toggle added to the Status filter (between Maintenance and Pending), visible only when relevant.
  • DB migration — 4 new columns on monitor: silenced, silence_message, silenced_at, silenced_by.
  • i18n — 17 new keys in en.json, propagated with English fallback to all 69 other language files.
  • Color — Violet #8b5cf6, the conventional ACK color in monitoring tools, distinct from all existing status colors.

Resolves #7628

Please follow this checklist to avoid unnecessary back and forth (click to expand)
  • ⚠️ If there are Breaking change (a fix or feature that alters existing functionality in a way that could cause issues) I have called them out
  • 🧠 I have disclosed any use of LLMs/AI in this contribution and reviewed all generated content.
    I understand that I am responsible for and able to explain every line of code I submit.
  • 🔍 Any UI changes adhere to visual style of this project.
  • 🛠️ I have self-reviewed and self-tested my code to ensure it works as expected.
  • 📝 I have commented my code, especially in hard-to-understand areas (e.g., using JSDoc for methods).
  • [] 🤖 I added or updated automated tests where appropriate.
  • 📄 Documentation updates are included (if applicable).
  • 🧰 Dependency updates are listed and explained.
  • ⚠️ CI passes and is green.

Screenshots for Visual Changes

Monitor Status Menu

menu-status

Bulk Actions Menu

menu-bulk-actions

Error When One or More Selected Monitors Are Not Down

bulk-silence-control-status

Silence Button

silence-button

Silence Dialog for a Single Monitor

single-silence-monitor

History Entry

history-print-silence

Silenced Monitor Information Banner

silenced-info

Availability Status Colors

availibility_color_status

Mathieu BEDOS(mabed) added 4 commits July 25, 2026 15:43
Adds monitor silencing (alert acknowledgment) inspired by Nagios/Zabbix/Centreon ACK.

- New migration: 4 columns on monitor table (silenced, silence_message, silenced_at, silenced_by)
- New socket handler: silenceMonitor (validates DOWN state + non-empty reason) and unsilenceMonitor
- monitor.js: suppress notifications and resend intervals when silenced; auto-clear silence on UP recovery via R.exec to avoid runtime property conflicts with R.store
- uptime-kuma-server.js: add sendUpdateMonitorIntoListByUserID for background (no-socket) context
- All timestamps stored as UTC (dayjs.utc()) consistent with existing heartbeat handling

Resolves louislam#7628
- Details.vue: Silence/Unsilence buttons (Silence only when DOWN), mandatory reason modal, silenced info banner, violet badge, event history shows distinct Silenced badge (identified by msg prefix, user reason displayed without prefix)
- MonitorList.vue: filterState.showSilenced hides silenced monitors by default; bulk Silence action in Actions dropdown with DOWN-only validation (blocks entirely if any UP monitor selected)
- MonitorListFilter.vue: Silenced toggle in Status dropdown between Maintenance and Pending; numFiltersActive handles boolean filterState values correctly
- MonitorListItem.vue: violet silence-badge with bell-slash icon next to monitor name
- socket.js: stats.silenced counter; skip toast for heartbeat events with type:"silence"
- icon.js: register faBell and faBellSlash
- vars.scss: $silenced: #8b5cf6
- app.scss: .bg-silenced and .text-silenced utility classes
17 new keys in en.json (Silence, Unsilence, Silenced, silenceMonitor,
silenceMonitorDesc, silenceMessage, silenceMessagePlaceholder,
silencedMonitorMsg, silencedAt, successSilenced, successUnsilenced,
silenceMessageRequired, silenceOnlyDownMonitor, silencedMonitorsMsg,
noMonitorsSilencedMsg, bulkSilenceErrorMsg, silenceOnlyDownMonitorBulk).

English fallback values propagated to 69 language files.
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the PR! If anyone would like to help with testing, run: npx kuma-pr mabed-fr:feat/alert-silence (requires Node.js and Docker)

@mabed-fr mabed-fr changed the title Feat/alert silence Feat: alert silence Jul 25, 2026
@mabed-fr mabed-fr changed the title Feat: alert silence feat: alert silence Jul 25, 2026
Mathieu BEDOS(mabed) added 2 commits July 26, 2026 09:55
… lang files

Remove silence feature keys whose values were identical to the English
source strings — the app already falls back to en.json for missing keys,
so explicit English copies in other language files are redundant and
misleading.

- 13 languages had all 17 keys in English (fully untranslated): removed all
- 55 languages had 4 plural/bulk keys still in English: removed those 4
- fr-FR.json: kept "Silence" (correct French word), removed only the 4 bulk keys
- en.json and en_GB.json: untouched
- unsilenceMonitor socket handler now requires a reason message (same as silence)
- Inserts a heartbeat log entry prefixed with "Unsilenced:" on manual unsilence
- Emits heartbeat event with type:"silence" to skip toast notification
- Details.vue: Unsilence button opens a modal with mandatory reason field,
  identical UX and violet color scheme as the Silence modal
- History table: shows violet "Unsilenced" badge (bell icon) for unsilence entries,
  strips prefix from displayed message
- i18n: add unsilenceMonitor, unsilenceMonitorDesc, unsilenceMessage,
  unsilenceMessagePlaceholder, unsilenceMessageRequired, Unsilenced keys
@mabed-fr mabed-fr changed the title feat: alert silence feat: add alert silence Jul 26, 2026
@Ionys320

Ionys320 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Hi @mabed-fr! I didn't review the PR, but be cautious about translations: you musn't perform any translation within the files, except for english.

=> CONTRIBUTING.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alert Silence (Acknowledgment)

2 participants