Documentation menu
Monitoring

Alert Rules

Notify your team when monitors, logs or server metrics cross a line.

Alert rules decide when to notify whom. A rule has a condition, a severity and one or more channels. Incidents from monitors page people through the escalation policy; alert rules add notifications on top, for example a Slack message for slow responses or a PagerDuty incident for an outage.

Create an alert rule

In the app open Settings > Alert rules and tap New alert rule (web dashboard: Configure > Alert rules):

  • Name
  • Monitor: one monitor, or all monitors of the project (not used by log and metric conditions)
  • Condition: see below
  • Severity: critical, high, medium, low or info
  • Channels: where to send it; channels your plan does not include are marked
  • Cooldown: the shortest time between two notifications of the rule (default 5 minutes)

Use Test to send a test alert on every channel: you see per channel whether it was delivered. Tests of personal channels (push, email) only reach you.

Monitor conditions

These run on each confirmed check result.

Type Fires when Fields
monitor_status the monitor is in a status threshold: up, down or degraded
status_change the status changes optional from and to
downtime the monitor has been down for a while (once per outage) threshold: minutes, 1 to 10080
consecutive_failures that many failed checks in a row threshold: 1 to 100, optional operator
response_time the response time crosses a value threshold: ms, operator (>, >=, <, <=, ==, !=)
error_rate the share of failed checks crosses a value threshold: percent, operator
uptime uptime crosses a value threshold: percent, operator
ssl_expiry the certificate expires within that many days threshold: 0 to 365
incident_created any incident opens in the project none
{ "type": "downtime", "threshold": 5 }

Failures count only after the monitor’s confirmation checks, so one dropped request does not fire a rule.

Log and metric conditions

These run a query every minute, resolve themselves when the condition clears and can open an incident (open_incident: off by default for log queries, on for log absence, new or spiking errors, metric thresholds and hosts that stopped reporting).

Log query

Counts the log lines that match in the last few minutes:

{
  "type": "log_query",
  "levels": ["error", "critical"],
  "services": ["api"],
  "environment_id": null,
  "search": "timeout",
  "window_minutes": 5,
  "operator": "gt",
  "threshold": 100,
  "open_incident": false
}
  • levels: any of debug, info, warning, error, critical (empty: all)
  • services: up to 20 service names (empty: all)
  • environment_id: one environment of the organization, or null for all
  • search: text the message must contain (as in the Logs tab)
  • window_minutes: 1, 5, 15 or 60
  • operator: gt, gte, lt or lte; threshold: a whole number
  • Start from a saved search to reuse its text and filters.

Log absence

Fires when a service that sent logs in the last 24 hours stops sending them:

{ "type": "log_absence", "service": "worker", "minutes": 15, "open_incident": true }

minutes is 1 to 1440. While Incidion itself receives no logs from any project, absence rules wait instead of firing.

New or spiking errors

One alert, and one incident, per error group that is new, back after it was resolved, or spiking. Every project has such a rule, New errors, which does not count against the plan.

{
  "type": "log_error_group",
  "triggers": ["new", "regression", "spike"],
  "levels": ["error", "critical"],
  "services": [],
  "environment_id": null,
  "min_events": 3,
  "window_minutes": 5,
  "spike_threshold": 100,
  "resolve_after_minutes": 30,
  "open_incident": true
}
  • triggers: any of new, regression (back after resolved), spike
  • min_events (Fire at): lines in the window before a new or returning group fires; 1 fires on the first line
  • window_minutes: 1, 5, 15 or 60; spike_threshold (Spike at): lines in the window that count as a spike
  • resolve_after_minutes (Resolve after): quiet time before the alert and its incident resolve, 1 to 1440
  • More than five groups firing at once open one incident together.

Metric threshold

Compares the average of a server metric per host over a window:

{
  "type": "metric_threshold",
  "metric_name": "cpu_usage",
  "host_filter": "",
  "operator": "gt",
  "threshold": 90,
  "window_minutes": 10
}

window_minutes is 1 to 1440 (default 5); host_filter limits the rule to one host (empty: every host). See Send logs for sending server metrics.

Host stopped reporting

Fires for each host that sent server metrics in the 24 hours before and none for minutes, for example a server that crashed, lost its network or whose collector stopped:

{
  "type": "host_silent",
  "host_filter": "",
  "minutes": 5
}

minutes is 2 to 1440 (default 5); host_filter limits the rule to one host (empty: every host), environment_id to one environment. It opens an incident by default, and the alert and the incident resolve themselves with the host’s next data point. A host you turn off on purpose stops counting 24 hours after its last data point; resolve its incident by hand. If Incidion’s own metric ingest is down, these rules wait instead of paging, and after an outage a host only fires once it stayed silent for its minutes while ingest worked.

Plans include 2 (Free), 20 (Pro) or 100 (Business) active log and metric rules; Enterprise has no limit. Over the limit, saving another active rule answers 403 PlanLimitExceeded.

Channels

Push

{ "type": "push" }

To the phones of the organization’s owners, admins and members, following their notification settings. Viewers are never notified.

Email

{ "type": "email", "recipients": ["admin@example.com"] }

Up to 20 recipients, all active members of the organization. Without recipients, owners and admins get it.

Slack (Pro and up)

{ "type": "slack", "webhook_url": "https://hooks.slack.com/services/T000/B000/XXXX" }

Create an incoming webhook in a Slack app and paste its url. Without webhook_url, the message goes to the Slack webhooks members set in their notification settings.

Microsoft Teams (Pro and up)

{ "type": "teams", "webhook_url": "https://prod-00.westeurope.logic.azure.com/workflows/..." }
  1. In the Teams channel, open Workflows and add Post to a channel when a webhook request is received.
  2. Copy the workflow url and paste it into the rule.

Teams gets an Adaptive Card with the severity, condition, value, project and monitor, and a button to open the incident in Incidion. Teams is one-way: acknowledge and resolve in Incidion.

Webhook (Pro and up)

{ "type": "webhook", "webhook_endpoint_id": "endpoint-uuid" }

Sends an alert.triggered event to that endpoint, or to every endpoint subscribed to it. Set endpoints up under Settings > Webhooks; see Webhooks.

PagerDuty (Pro and up)

{ "type": "pagerduty", "routing_key": "your-events-api-v2-integration-key" }

Use the integration key of an Events API v2 integration on a PagerDuty service (20 to 64 letters and digits). Incidion opens a PagerDuty incident, acknowledges it when the incident is acknowledged in Incidion, and resolves it when it resolves.

Opsgenie (Pro and up)

{ "type": "opsgenie", "api_key": "your-api-integration-key", "region": "eu" }

Use the key of an Opsgenie API integration and your region (us or eu). Incidion opens, acknowledges and closes the Opsgenie alert.

SMS and voice calls (Pro and up)

{ "type": "sms", "user_ids": ["user-uuid"] }
{ "type": "voice" }

Texts or calls go to owners, admins and members with a verified phone number (Settings > Profile). user_ids picks people; without it everyone with a verified number is reached. Numbers that are not verified are skipped, and you can not enter other numbers.

Texts and calls are capped per day: per organization by plan (Pro: 100 texts and 30 calls, Business: 500 and 150, Enterprise: 2000 and 600, during a trial: 10 and 3) and 50 texts and 20 calls per person. Over a cap the delivery is skipped and owners get one notice that day.

Plans

Free includes push and email. Pro and up add Slack, Microsoft Teams, webhooks, PagerDuty, Opsgenie, SMS and voice. After a downgrade the channels the plan no longer includes are paused (skipped with a note) and resume after an upgrade.

Delivery and retries

Every notification gets a receipt with its status (sent, failed, skipped), the provider’s answer and the attempts. Failed deliveries are retried with backoff when a retry can help. Requests only go to public internet addresses and never follow redirects. Provider keys and webhook urls are shown masked (****abcd); send the masked value back to keep the stored one.

Escalation

If a rule’s alert is not acknowledged within escalation_timeout seconds, the escalation_channels are notified as well. For incidents, use escalation policies instead: they page people level by level until someone acknowledges.

Mute windows

mute_start and mute_end (UTC times) with mute_days (0 = Monday … 6 = Sunday) silence a rule every week, for example during nightly batch jobs. For one-off planned work use maintenance windows.

Severity

Severity Use for
Critical Service down, data at risk
High Degraded, one component down
Medium Can wait a few minutes
Low, Info Trends and FYI

PagerDuty and Opsgenie get the matching severity or priority.

API

curl -X POST https://api.incidion.dev/api/v1/projects/$PROJECT_ID/alert-rules/ \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "API down for 5 minutes",
    "monitor": "'$MONITOR_ID'",
    "severity": "critical",
    "condition": {"type": "downtime", "threshold": 5},
    "channels": [{"type": "email"}, {"type": "push"}],
    "cooldown_seconds": 300
  }'

GET .../alert-rules/condition-types/ and .../channel-types/ describe what is available (channel types the plan does not include are marked), POST .../alert-rules/{id}/test/ sends a test, and GET .../alert-rules/{id}/triggers/ lists what fired. Fired alerts are also under /projects/{id}/alert-triggers/ (acknowledge, resolve). See API Endpoints.