Merged
Conversation
Contributor
|
🔗 Redirect URIs Added to Logto The following redirect URIs have been automatically added to the Logto application configuration: Redirect URIs:
Post-logout redirect URIs:
These will be automatically removed when the PR is closed or merged. |
Contributor
🤖 My API structural change detectedStructural change detailsAdded (20)
Powered by Bump.sh |
8b5324c to
9ec5be6
Compare
b10c682 to
08c4b4c
Compare
Member
Author
|
update deploy |
Contributor
|
🚀 Build triggers updated! All |
backend: - add GetSystemAlertSilences handler (lists active/pending silences per system) - add GetSystemAlertSilence handler (get single silence with ownership check) - add UpdateSystemAlertSilence handler (PUT - preserves matchers, updates endsAt/comment) - add end_at field to CreateSystemAlertSilence (takes precedence over duration_minutes) - add GetSilences() to alerting client - register GET/PUT silence routes under /systems/:id/alerts/silences[/:silence_id] - update AlertmanagerSilence model with Status, UpdatedAt fields - add UpdateSystemAlertSilenceRequest, AlertmanagerSilenceStatus models - fix buildSystemAlertSilenceRequest parameter order (now before endsAt) - fix duplicate response keys in openapi.yaml - document new endpoints in openapi.yaml including AlertmanagerSilence schema frontend: - add AlertmanagerSilence, AlertmanagerMatcher, AlertmanagerSilenceStatus types - add getSystemAlertSilences() API function - update createSystemAlertSilence() to accept optional endAt param - add SYSTEM_ALERT_SILENCES_KEY constant - replace hardcoded 60-min notice in SilenceSystemAlertModal with datetime-local picker - add SystemAlertSilencesCard component (lists silences with delete action) - insert SystemAlertSilencesCard in SystemAlertHistoryPanel between active alerts and history - add i18n keys (en/it): silences card, silence_end_at, status labels, delete notifications Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- rename alertname from HostDown to LinkFailed in heartbeat monitor - rename internal functions: fireHostDownAlert -> fireLinkFailedAlert, resolveHostDownAlert -> resolveLinkFailedAlert, postHostDownAlert -> postLinkFailedAlert - update summary/description annotations to focus on missed heartbeat communication rather than host being down, avoiding alarm fatigue - update all log messages, comments, and variable names consistently - update backend and collect test fixtures from HostDown to LinkFailed - update AGENTS.md references Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
ProvisionDefaultConfig always sets MailEnabled and WebhookEnabled to false regardless of whether a default email is present. The email address is still stored in MailAddresses so it appears pre-filled in the UI, but the user must explicitly enable notifications after creation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… 4h default - wrap alert history table in NeCard to match active alerts and silences cards - gray out suppressed (silenced) alert rows in the active alerts table with opacity-50 - remove action button for suppressed alerts; silence management is in the silences card - add alertname column to silences card, derived from the alertname matcher value - change default silence end time from 1 hour to 4 hours Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add telegram_enabled / telegram_receivers to global settings table - Add telegram_enabled / telegram_receivers to per-severity and per-system override fields - Update example JSON to include Telegram receiver - Add 'Telegram notifications' section with 3-step setup guide: Step 1: create bot via @Botfather Step 2: obtain chat_id via getUpdates (private and group/channel) Step 3: configure JSON with telegram_enabled + telegram_receivers - Document 4096-char message limit caveat - Applied in both English and Italian Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
that appear in alert names, system keys, and annotations. Any unescaped reserved character causes Alertmanager to fail the notification with a 400 Bad Request from Telegram. HTML mode is simpler and reliable: only <, >, & require escaping, which Alertmanager handles automatically. Switch parse_mode to HTML and rewrite the telegram_en/it templates to use <b> and <code> tags instead of MarkdownV2 *bold* and `code` syntax. Fixes: ts=... err="telegram: Bad Request: can't parse entities: Character '-' is reserved and must be escaped" Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…tting - Use italics for severity labels (Critical, Warning, Info) - Add server emoji (🖥️) before system name - Separate severity info with pipe character for visual clarity - Use header/body/detail structure with blank lines between sections - Bolder alert name emphasis with visual hierarchy - Cleaner, more professional appearance while respecting 4096 char limit Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the diff-sync approach (list Alertmanager → fire missing → resolve orphaned) with a TTL-refresh model: every sync cycle, post alerts for ALL DB-inactive systems with a short TTL (3× sync interval = 15 min). Alertmanager deduplicates existing alerts. When a system becomes active, posting stops and the alert auto-expires. This eliminates the fire→resolve→fire oscillation caused by ~1700 systems whose heartbeats arrive near the timeout boundary, toggling their DB status every minute while the monitor snapshots every 5 minutes. HeartbeatMonitor: log individual system_key on every active↔inactive transition at debug level for troubleshooting. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…led monitor - Revert heartbeat_monitor.go to original (no per-system RETURNING logging) - Keep TTL-refresh model: post firing with 15min TTL for all inactive systems each sync cycle to prevent flapping - Re-add listAlerts: after posting refreshes, query Alertmanager for managed LinkFailed alerts and explicitly resolve any whose system is no longer inactive (rather than waiting up to 1h for Alertmanager to auto-resolve stale alerts) - Log each refresh and each resolve at debug level with system_key - Log summary at info level: alerts_refreshed + alerts_resolved counts Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
resolve_timeout: 1h in Alertmanager does not apply here — our alerts carry an explicit EndsAt (TTL = 15 min), which takes precedence. Active systems recover within one TTL window without any explicit resolve call, so the listAlerts round-trip and cloneStringMap helper are dead weight. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add a magnifier icon (info circle) button next to each alert in the system detail page, active alerts section. When clicked, the button opens a tooltip showing the full alert details including labels, annotations, fingerprint, and generator URL. The tooltip is styled with a dark background and breaks long lines for readability. - Add faCircleInfo icon import for the action button - Add formatAlertDetails() function to format alert properties - Modify summary cell to include the detail button and tooltip - Add NeTooltip component import - Add translations for view_alert_details in en/it locales Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
andre8244
reviewed
Apr 17, 2026
Collaborator
andre8244
left a comment
There was a problem hiding this comment.
IIUC pagination is missing in GET /api/alerts and GET /api/systems/:id/alerts
Dead code removal: - collect/alerting/mimir.go: drop unused ListAlerts plus its private alertAPIResponse/alertAPIStatus types, listAlertsBodySize constant and orphaned net/url import - collect/methods/mimir.go: drop injectLabels and processAnnotationTemplates wrappers that only forwarded to the shared alerting helpers; callers already use the shared helpers directly via collectalerting.EnrichAlertPayload Simplifications (no behavior change): - backend/methods/alerting.go: use slices.Contains for template language validation, replace repeated type-asserting severity counters with typed locals, drop unreachable dedupe map in buildSystemAlertSilenceRequest (map iteration already yields unique keys and the system_key append is guarded) - collect/alerting/mimir.go: drop else-after-return in PostAlerts Tests: - collect/methods/mimir_test.go: call collectalerting.InjectLabels and collectalerting.ProcessAnnotationTemplates directly so test coverage follows the deleted wrappers - collect/cron/linkfailed_monitor_test.go: align test with current linkFailedAlertTTL constant (the multiplier was changed from 3x to 2x in ccfe65a but the test still hard-coded 3x) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
🗑️ Redirect URIs Removed from Logto The following redirect URIs have been automatically removed from the Logto application configuration: Redirect URIs:
Post-logout redirect URIs:
Cleanup completed for PR #42. |
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.
📋 Description
This pull request adds Alertmanager integration based on Grafana Mimir, backend APIs for alert configuration and inspection, resolved-alert history persistence, automatic LinkFailed monitoring, Telegram notification support, and system-level silence actions for active alerts.
Backend API (
/api/alerts)GET /api/alerts/config— retrieve the current alerting configuration from Mimir as structured JSON or redacted YAMLPOST /api/alerts/config— apply a new alerting configurationDELETE /api/alerts/config— replace the tenant configuration with a blackhole-only config while keeping the built-in history webhook activeGET /api/alerts— list active alerts with optional filters (state,severity,system_key)GET /api/alerts/totals— return active alert counters plus resolved-history totalsGET /api/alerts/trend— return resolved-alert trend data for the selected periodGET /api/systems/:id/alerts— list active alerts for a single systemPOST /api/systems/:id/alerts/silences— create a silence for a single active system alertGET /api/systems/:id/alerts/history— return paginated resolved-alert history for a single systemAlerting configuration
AlertingConfigsupports global settings, per-severity overrides, per-system overrides, and Telegram integrationorganization_idquery parameter where required by the current handlersCollect service
POST /api/alert_historyreceives Alertmanager webhooks and stores resolved alerts in PostgreSQLALERTING_HISTORY_WEBHOOK_SECRETPOST /api/services/mimir/alertmanager/api/v2/alertsproxies authenticated systems to Alertmanager withX-Scope-OrgIDderived server-sidelabels.system_keyis always overwritten with the authenticated system valuePOST /api/services/mimir/alertmanager/api/v2/silencesproxies authenticated systems to Alertmanager with tenant scoping enforced by the serverFrontend
manage:systemsLinkFailed monitoring
inactiveafter exceedingHEARTBEAT_TIMEOUT_MINUTESLinkFailedalert is automatically posted when a system fails to communicateNotification channels
Tooling and docs
services/mimir/scripts/alerting_config.pymanages alerting config and alert queries through the MY APIservices/mimir/scripts/alert.pyfires, resolves, silences, and lists alerts through the collect proxy🧪 Validation
cd backend && make pre-commitcd collect && make pre-commitcd frontend && npm run pre-commitRelated issue
Implements requirements from #72 (Alarm Management - Alertmanager Integration)