Add slow_alert_consecutive setting to control slow alert sensitivity

Exposes the consecutive-slow-checks requirement as a configurable setting
instead of hardcoding 3. Saved under key 'slow_alert_consecutive' in the
DB, readable via SLOW_ALERT_CONSECUTIVE env var. UI appears in Settings →
Monitoring alongside the existing Consecutive Failures Threshold field.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 4.6 committed 2026-08-06 16:53:06 -04:00
1 parent dd85a79d55
commit 3a3d32ecac
3 files changed
+19 -2

No files matched your search

+14
View File
@@ -35,6 +35,7 @@ function SettingsWizard() {
items_per_page: 20,
refresh_interval: 5000,
incident_failure_threshold: 10,
slow_alert_consecutive: 3,
});
const [testResult, setTestResult] = useState(null);
@@ -529,6 +530,18 @@ function SettingsWizard() {
<small>Number of consecutive failures before triggering an alert (default: 3)</small>
</div>
<div className="form-group">
<label>Slow Alert Sensitivity</label>
<input
type="number"
value={settings.slow_alert_consecutive || 3}
onChange={(e) => setSettings({ ...settings, slow_alert_consecutive: parseInt(e.target.value) })}
min="1"
max="20"
/>
<small>Consecutive slow checks required before alerting — 1 = any spike, 3 = default, 5+ = only sustained slowness</small>
</div>
<div className="form-group">
<label>Incident Failure Threshold</label>
<input
@@ -579,6 +592,7 @@ function SettingsWizard() {
grace_period: settings.grace_period,
downtime_threshold: settings.downtime_threshold,
incident_failure_threshold: settings.incident_failure_threshold,
slow_alert_consecutive: settings.slow_alert_consecutive,
})}
disabled={savingSection === 'Monitoring'}
>