cronping

Anomaly Detection

Detect duration, schedule, and error-rate changes without hand-tuned alert thresholds.

Pro Feature

Anomaly detection is available on Pro and Business plans.

Overview

Anomaly detection watches the historical behavior of each heartbeat and alerts when the job starts behaving differently, even if it still checks in before the normal down alert fires.

Cronping builds a rolling baseline from recent pings and checks three independent signals:

SignalWhat it catchesDefault threshold
Duration spikeA successful or warning run took much longer than usualLatest duration is more than 2.5x the median of recent runs
Interval driftPings are arriving with a less stable cadence than usualCurrent interval variation exceeds the baseline by 1.5x
Error-rate surgeWarnings or failures are clustering in the last 24 hours24-hour warn/fail rate is more than 3x the 30-day baseline

How it works

  1. Enable anomaly detection on a heartbeat.
  2. Cronping collects enough historical pings to build a reliable baseline.
  3. The worker periodically recalculates the baseline and compares recent behavior with that baseline.
  4. If a signal crosses its threshold, Cronping records an anomaly and sends alerts through the heartbeat's configured email and integration channels.
  5. When the signal returns to normal, the active anomaly is resolved automatically.

The detector runs in the background. You do not need to change the ping URLs or request payloads.


Baseline requirements

Anomaly detection needs history before it can make useful comparisons.

SettingDefaultDescription
Minimum pings for baseline20A signal is skipped until it has enough samples
Duration sample windowLast 30 successful or warning runsUsed for the median duration baseline
Interval sample windowRecent terminal pingsUsed to calculate interval variation
Error-rate windowLast 24h vs previous 30dUsed to detect a sudden warn/fail surge

For new heartbeats, the anomaly card may be empty until enough pings have arrived.


Configuration

Open a heartbeat, choose Edit, and use the Anomaly Detection section.

FieldDescription
Enable anomaly detectionTurns all anomaly checks on or off for the heartbeat
Duration spikesAlerts when run duration exceeds the learned median by the configured factor
Duration spike factorMultiplier used for duration alerts, default 2.5
Interval driftAlerts when ping cadence becomes significantly less stable
Error-rate surgesAlerts when warnings or failures cluster in the last 24 hours
Alert cooldownMinimum time before Cronping sends another alert for the same anomaly type
Minimum pings for baselineRequired historical samples before a signal is considered reliable

Anomaly detection is enabled by default for new heartbeats on plans that include it. The Management API defaults it to disabled unless anomalyEnabled is explicitly sent.


Alerts

Anomaly alerts use the same notification channels as heartbeat down alerts:

  • Email
  • Slack, Discord, Microsoft Teams, Telegram
  • Webhooks
  • PagerDuty, Incident.io
  • Gotify, ntfy, Pushover, Pushbullet

The alert includes the anomaly type, severity, and the measured value compared with the baseline. Webhooks receive anomaly events with event names such as heartbeat.anomaly_duration, heartbeat.anomaly_interval, and heartbeat.anomaly_error_rate.


Reviewing anomalies

The dashboard shows active anomaly counts on the overview page. Each heartbeat detail page includes an Anomaly Detection card with:

  • Current baseline values
  • Recent anomalies
  • Severity
  • Detection and resolution timestamps

Resolved anomalies remain in the history table so you can see recurring patterns over time.


Management API fields

The heartbeat create and update endpoints accept these anomaly settings:

{
  "anomalyEnabled": true,
  "durationSpikeEnabled": true,
  "durationSpikeFactor": 2.5,
  "intervalDriftEnabled": true,
  "errorRateSurgeEnabled": true,
  "anomalyAlertCooldownHours": 24,
  "minPingsForBaseline": 20
}

Setting anomalyEnabled to true requires a Pro or Business plan.

On this page