# Alerts and notifications

> Get told about new issues, regressions, error bursts, slow or failing transactions, crash-free drops, insight changes, log spikes, missed cron jobs and downtime, by email, Slack, PagerDuty, Opsgenie, Discord, Teams or signed webhooks.

Source: https://apphelm.dev/docs/alerts

AppHelm checks your data on a schedule and sends a **notification** when something needs attention. Some notifications come from rules you write (issue alerts, metric alerts, insight alerts, log alerts); others come from monitors you set up (cron monitors, uptime checks, certificates). Each notification goes to email and to the channels you connect.

Only owners and admins can create or change rules, channels and maintenance windows. Every member chooses which notifications they get by email. The demo product is read-only.

| Alert | Fires when | Where you set it up | Checked |
| --- | --- | --- | --- |
| [Issue alert](#issue-alerts) | A new issue, a regression or escalation, or an issue over a rate | Issues → Alerts | Every 5 minutes |
| [Metric alert](#metric-alerts) | Error count, latency, failure rate, crash-free rate or a web vital crosses a threshold | Issues → Alerts | Every 5 minutes |
| [Insight alert](#insight-alerts) | A trend insight goes above or below a value, or changes by a percentage | The saved insight's page | Hourly to monthly |
| [Log alert](#log-alerts) | More matching log lines than a threshold in a window | Logs → Log alerts | Every 5 minutes |
| [Cron monitor](#cron-monitors-and-uptime-checks) | A job reports an error, misses its run or runs too long | Issues → Monitors | Every 5 minutes |
| [Uptime check](#cron-monitors-and-uptime-checks) | An address fails twice in a row, or its certificate is about to expire | Status pages | Every 5 minutes (1 on Portfolio and Scale) |

## Issue alerts

Open **Reliability → Issues → Alerts**, fill in the form under **Alert rules** and press **Add rule**. Choose a trigger:

| Trigger | UI label | Fires |
| --- | --- | --- |
| `new_issue` | A new issue appears | Once per issue, when its first event arrives |
| `regression` | A resolved issue regresses | Once each time a resolved issue reopens. Also when an ignored issue passes its ignore condition (**escalates**) |
| `frequency` | An issue exceeds a rate | When one issue has at least `threshold` events within `windowMinutes` (5–1,440) |

- **Environment** (optional) limits the rule to events from one environment: the issue must first appear there, reopen from there, or, for a rate, only that environment's events count.
- **Ignored issues never alert.**
- A frequency rule fires at most once per issue per window: time is cut into fixed slots the length of the window. Each check alerts on at most the 20 busiest issues per rule.
- A new rule doesn't alert on issues that existed before it. Turning a rule back on doesn't alert on what happened while it was off.
- Frequency alerts are sent as `critical`; new issue and regression alerts as `warning`. The title is `<rule name>: <Exception>: <message>`, with a link to the issue.

There are no filters on level, tags or release, no "users affected" trigger, and no configurable action interval yet. Rules can't be edited in the app (**Disable**, **Enable** and **Delete** only): create a new rule, or change it through the [API](#api).

## Metric alerts

Under **Metric alerts** on the same tab, fill in the form and press **Add metric alert**. A metric alert watches one number over a window (5–1,440 minutes) and fires when it goes **above** or **below** your threshold. It resolves, and notifies again, when it no longer does.

| Metric | Measures | Filters | Default in the form |
| --- | --- | --- | --- |
| `error_count` | Exception events across all issues | — | above 100 |
| `transaction_p95` | 95th percentile transaction duration (ms, shown as "≤") | `transactionName` | above 1,000 ms |
| `transaction_error_rate` | % of transactions that ended in error | `transactionName` | above 5% |
| `crash_free_rate` | % of [release-health sessions](https://apphelm.dev/docs/release-health) without a crash | `environment` | below 99% |
| `span_p50`, `span_p75`, `span_p95`, `span_p99`, `span_avg` | Span duration (ms) | `spanQuery` | above 200 / 300 / 500 / 1,000 / 250 ms |
| `span_count` | Number of spans | `spanQuery` | above 1,000 |
| `span_failure_rate` | % of spans that failed | `spanQuery` | above 5% |
| `web_vital_p75` | 75th percentile of `lcp`, `inp`, `cls`, `fcp` or `ttfb` | `vital` (required), page as `transactionName` | above 2,500 |

- `spanQuery` uses the trace explorer's search language ([Tracing](https://apphelm.dev/docs/tracing)) and must parse cleanly; `environment:` and `transaction:` go in it for span metrics.
- Rate thresholds are percentages, 0–100. Comparisons are strict: "above 5" fires at 5.01, not 5.
- **Minimum samples:** below 20 transactions, 10 sessions, 20 spans or 20 web-vital samples in the window, the rule doesn't change state. `span_count` is always measured.
- Transaction metrics cover the whole hours the window touches; span and web-vital metrics cover exactly the window.
- Firing is sent as `metric.alert` (`critical`), resolving as `metric.resolved` (`info`). Each change is sent once. Turning a rule off resets it to OK.

There is one threshold per rule: no separate warning level, anomaly detection or custom evaluation interval.

## Insight alerts

Open a saved **trend** insight and add an alert. It checks one line of the chart (a series or breakdown value, or the sum of all lines) once per period:

| Field | Values |
| --- | --- |
| `condition` | `above`, `below`, `increase_pct`, `decrease_pct` (compared with the previous period) |
| `threshold` | A number; above 0 for the percentage conditions |
| `interval` | `hour`, `day`, `week` or `month` (UTC; weeks start on Monday) |
| `checkCurrent` | Check the period in progress instead of the last complete one |
| `channels` | `email`, `slack`, `webhook` |

- Hourly alerts (and `checkCurrent` alerts) are checked every hour at :02; daily, weekly and monthly ones 10 minutes after the period closes.
- A percentage change from 0 never fires.
- If the check can't run (the insight changed or was deleted), the alert shows **errored**, retries hourly and notifies no one.
- Firing is `insight.alert` (`warning`); recovery is `insight.resolved`.
- Up to 10 alerts per insight and 100 per workspace. Funnel, retention, path, SQL and other insight types can't have alerts (`insight_not_alertable`).

## Log alerts

On the **Logs** page, search for the lines you care about and press **Alert on this search**. The alert fires when more than `threshold` lines match within `windowMinutes`, and resolves when the count drops back.

- A search with words or attributes can cover up to 60 minutes; a search on levels and services only can cover up to a day.
- A count from an incomplete read can fire an alert but never resolve one.
- Channels are `email`, `slack` and `webhook`. Firing is `log.alert` (`critical`); recovery is `log.resolved`.
- Up to 20 log alerts per product. After creating one you can change its name, threshold and status.

See [Logs](https://apphelm.dev/docs/logs) for the search language.

## Cron monitors and uptime checks

These alert without a rule: setting up the monitor is enough.

- **Cron monitors** send `monitor.failed` (`critical`) the first time a job reports an **error**, **misses** its run (no check-in within the margin, 5 minutes by default) or **times out** (still in progress after the maximum runtime, 30 minutes by default), and `monitor.recovered` when it is OK again.
- **Uptime checks** send `uptime.failed` (`critical`) after **two failed checks in a row** (a non-2xx/3xx answer, a timeout, or a failed assertion), and `uptime.recovered` when the address answers again.
- **Certificates** send `certificate.expiring` at 30, 14 and 7 days before expiry and `certificate.expired` once expired.

They go to email, Slack and every alert channel that takes their kind, and to webhooks. [Cron monitors, uptime and status pages](https://apphelm.dev/docs/crons-and-uptime) covers setting them up.

## Channels

### Email

Alerts come from `alerts@apphelm.dev` ("Apphelm Alerts") with the subject `[Apphelm] <title>`.

By default an alert emails **every member who can see the product**, except members who turned immediate email off or muted that kind, and billing members. Narrow it per rule:

- **Recipients**: up to 20 members or teams (`team:<id>`). Teams are expanded when the alert fires, to at most 50 people. Then only those people get email; Slack and other channels are unchanged.
- **Notify assignee** (issue alerts): also emails the issue's assignee, or the members of the team it is assigned to. If the rule routes only to the assignee and the issue is unassigned, everyone is emailed.

Recipients must be members who can see the product; arbitrary email addresses aren't supported. Rules need the `email` channel for recipients to apply.

Assigning an issue (`issue.assigned`) and mentioning someone in a comment (`issue.mention`) also email that person. Ownership rules that auto-assign an issue reach its owner this way.

### Slack

In **Settings → Notifications → Slack channels**, add a Slack **incoming webhook** URL (`https://hooks.slack.com/services/…`, `/workflows/…` or `/triggers/…`):

| Field | What it does |
| --- | --- |
| Channel name | Your label |
| Incoming-webhook URL | Stored encrypted |
| Product | One product, or all products (needs access to every product) |
| At least | The lowest severity posted: `info`, `warning` or `critical` |
| Kinds | Which notification kinds; none ticked posts every kind |

Messages show the severity, the title, a short body and an **Open in Apphelm** link. Up to 20 Slack channels per workspace. Personal notifications (assignments, mentions) never go to Slack.

### PagerDuty, Opsgenie, Discord and Microsoft Teams

In **Settings → Notifications → Alert channels**, add a channel with the same product, severity and kinds fields, plus its secret:

| Service | Paste | Behaviour |
| --- | --- | --- |
| PagerDuty | The **Integration key** (32 characters) of an Events API v2 integration | Opens an incident; the matching recovery resolves it |
| Opsgenie | An **API key** from an API integration, and the region (US or EU) | Opens an alert (P1 critical, P3 warning, P5 info); the recovery closes it |
| Discord | A channel **Webhook URL** (`https://discord.com/api/webhooks/…`) | One embed; nobody is pinged |
| Microsoft Teams | A **Webhook URL** (`*.webhook.office.com/webhookb2/…`, or a Workflows URL ending in `/triggers/…/paths/invoke`) | An Adaptive Card with an **Open in AppHelm** button |

- Repeated alerts for the same issue, monitor or rule share one incident key (for example `apphelm:issue:<id>`), so PagerDuty and Opsgenie don't open duplicates.
- Recoveries (`monitor.recovered`, `metric.resolved`, `uptime.recovered`, `insight.resolved`, `log.resolved`) close the incident, whatever the channel's minimum severity. When an issue that alerted is resolved, `issue.resolved` closes its PagerDuty or Opsgenie incident.
- **Send test** on a channel sends a real request and shows the service's answer and what to fix; for PagerDuty and Opsgenie it opens a test incident and closes it straight away.
- Up to 20 alert channels per workspace. Only a hint of each secret is shown again.

Issue and metric alerts use these channels only when the rule ticks them. Cron, uptime and certificate alerts reach every channel that takes their kind. Insight and log alerts use email, Slack and webhooks only.

### Webhooks

In **Settings → Webhooks**, an owner or admin with access to every product adds a **workspace-wide** subscription with a public HTTPS URL and picks event types. The signing secret (`whsec_…`) is shown once; adding the same URL again rotates it.

Alert event types: `error.alert`, `metric.alert`, `metric.resolved`, `insight.alert`, `insight.resolved`, `log.alert`, `log.resolved`, `monitor.failed`, `monitor.recovered`, `uptime.failed`, `uptime.recovered`, `certificate.expiring`, `certificate.expired`.

```json
{
  "id": "whe_…",
  "type": "error.alert",
  "schemaVersion": "apphelm.customer-intelligence-webhook/v1",
  "occurredAt": "2026-11-07T10:15:00.000Z",
  "subjectId": "…",
  "data": {
    "rule": { "id": "alr_…", "name": "Checkout errors", "trigger": "frequency" },
    "issue": { "id": "erg_…", "productId": "prd_…", "title": "TypeError: …", "count": 240, "lastSeen": "…", "release": "web@2.4.1", "environment": "production" },
    "reason": "…",
    "url": "https://apphelm.dev/app/errors?issue=…"
  }
}
```

Each request carries `x-apphelm-event-id`, `x-apphelm-event-type`, `x-apphelm-schema-version`, `x-apphelm-timestamp` (Unix seconds) and `x-apphelm-signature: v1=<hex>`, the HMAC-SHA256 of `<timestamp>.<raw body>` with your secret. Verify it before trusting the body:

Node.js:
```ts
import { createHmac, timingSafeEqual } from "node:crypto";

function verify(rawBody: string, timestamp: string, signature: string, secret: string) {
  const expected = "v1=" + createHmac("sha256", secret).update(`${timestamp}.${rawBody}`).digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) < 300; // reject old replays
  return fresh && expected.length === signature.length && timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
}
```

Python:
```python
import hashlib, hmac, time

def verify(raw_body: bytes, timestamp: str, signature: str, secret: str) -> bool:
    expected = "v1=" + hmac.new(secret.encode(), f"{timestamp}.".encode() + raw_body, hashlib.sha256).hexdigest()
    return abs(time.time() - int(timestamp)) < 300 and hmac.compare_digest(expected, signature)
```

Answer with a 2xx within 10 seconds. Redirects aren't followed and count as failures. A failed delivery is retried with growing delays (from a minute up to a day) and given up after 8 attempts; the delivery log keeps the last 50, and **Redeliver** sends one again.

Metric, log and insight payloads carry the rule, product, state, value and a link; uptime payloads carry the monitor, `status` (`down` or `up`), HTTP status, error, response time and consecutive failures.

## Your notification settings

Each member sets their own email in **Settings → Notifications → Your email**, then presses **Save preferences**:

| Setting | Default | Choices |
| --- | --- | --- |
| Email me as things happen | On | Off stops immediate email |
| Digest | No digest | Daily at 08:00 UTC, or weekly on Mondays at 08:00 UTC |
| Mute | Nothing | Any notification kind, such as `error.alert` or `uptime.failed` |

**Send me a test** emails you a `notification.test` (once a minute at most). **Recent notifications** shows the last 20 you can see, with how they were delivered.

The digest lists counts per kind and the 15 most severe items of the day or week; an empty period sends nothing. Alert and digest emails have a **Manage notification preferences** link rather than an unsubscribe link. Preferences don't affect Slack, alert channels or webhooks, which an admin controls.

## Scheduled reports

Subscribe members to a saved insight or a dashboard to email it **daily**, **weekly** or **monthly** at an hour you pick (UTC; 08:00 by default), from the insight or dashboard page. Up to 20 members per subscription, 10 subscriptions per insight or dashboard and 100 per workspace. **Send a test now** emails it to you. Muting notification kinds doesn't stop subscriptions; pause or delete the subscription instead. See [Insights, dashboards and SQL](https://apphelm.dev/docs/insights).

## Maintenance windows

Schedule a window on the **Status pages** page before planned work. During it:

- Uptime checks show **maintenance** instead of failing, so no `uptime.failed` is sent. A check still failing when the window ends alerts then.
- Cron monitor failure and recovery alerts are held, and no cron incidents open.
- Checks keep running and recording.

A window covers one product, lasts up to 7 days, can start up to 366 days ahead, and shows on the public status page (the active one and up to 5 in the next 14 days). Cancel ends it now. Windows don't mute issue, metric, log, insight or certificate alerts, and can't repeat. They are managed in the app only.

## API

Manage rules with a workspace API key. Writes need an `Idempotency-Key` header (8–160 characters) and are made in the name of the key's creator, who must be an owner or admin. `alerts:write` and `analytics:write` are never in a key unless you add them.

| Method | Path | Scope | Does |
| --- | --- | --- | --- |
| `GET` | `/api/v1/alert-rules?productId=&kind=issue\|metric` | `alerts:read` | List issue and metric rules, with limits |
| `POST` | `/api/v1/alert-rules` | `alerts:write` | Create a rule: `{ "kind": "issue" \| "metric", …fields }` |
| `GET` | `/api/v1/alert-rules/{id}` | `alerts:read` | One rule (`alr_…` or `mar_…`); issue rules include their last 20 firings |
| `PATCH` | `/api/v1/alert-rules/{id}` | `alerts:write` | Change `status`, `name`, `threshold`, `windowMinutes`, `comparison`, `environment`, `transactionName`, `spanQuery`, `channels`, `recipients`, `notifyAssignee` |
| `DELETE` | `/api/v1/alert-rules/{id}` | `alerts:write` | Delete a rule |
| `GET`, `POST` | `/api/v1/logs/alerts` | `logs:read`, `analytics:write` | List and create log alerts |
| `GET`, `PATCH`, `DELETE` | `/api/v1/logs/alerts/{id}` | `logs:read`, `analytics:write` | One log alert; PATCH takes `status`, `name`, `threshold` |
| `GET`, `POST` | `/api/v1/insight-alerts` | `analytics:read`, `analytics:write` | List (`?insightId=`) and create insight alerts |
| `GET`, `PATCH`, `DELETE` | `/api/v1/insight-alerts/{id}` | `analytics:read`, `analytics:write` | One insight alert |
| `GET`, `POST` | `/api/v1/insight-subscriptions` | `analytics:read`, `analytics:write` | Scheduled reports |
| `GET`, `PATCH`, `DELETE` | `/api/v1/insight-subscriptions/{id}` | `analytics:read`, `analytics:write` | One subscription |

A rule's product, trigger, metric and vital can't be changed; create a new rule instead.

```bash
# An issue rule: 100 or more events in 60 minutes, in production
curl -X POST https://apphelm.dev/api/v1/alert-rules \
  -H "Authorization: Bearer $APPHELM_API_KEY" -H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" \
  --data '{"kind":"issue","productId":"prd_…","name":"Checkout error burst","trigger":"frequency","threshold":100,"windowMinutes":60,"environment":"production","channels":["email","slack"],"notifyAssignee":true}'

# A metric rule: p95 of POST /checkout above 1,000 ms over an hour, to PagerDuty
curl -X POST https://apphelm.dev/api/v1/alert-rules \
  -H "Authorization: Bearer $APPHELM_API_KEY" -H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" \
  --data '{"kind":"metric","productId":"prd_…","name":"Slow checkout","metric":"transaction_p95","comparison":"above","threshold":1000,"windowMinutes":60,"transactionName":"POST /checkout","channels":["pagerduty"]}'

# Pause a rule
curl -X PATCH https://apphelm.dev/api/v1/alert-rules/alr_… \
  -H "Authorization: Bearer $APPHELM_API_KEY" -H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" \
  --data '{"status":"disabled"}'

# An insight alert: daily signups fell by 20% or more
curl -X POST https://apphelm.dev/api/v1/insight-alerts \
  -H "Authorization: Bearer $APPHELM_API_KEY" -H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" \
  --data '{"insightId":"sin_…","name":"Signups fell","condition":"decrease_pct","threshold":20,"interval":"day","channels":["email"]}'
```

| Error | Cause | What to do |
| --- | --- | --- |
| `422 invalid_alert_rule` | A field is missing or out of range | Read `error.message`; a frequency rule needs `threshold` and `windowMinutes` |
| `422 recipient_not_member` | A recipient can't see the product | Pick members with access, or give them access |
| `409 rule_limit`, `log_alert_limit`, `alert_limit` | The product or insight is at its limit | Delete rules you no longer use |
| `422 insight_not_alertable` | The insight isn't a trend | Alert on a trend insight |
| `403 workspace_key_required` | Not a workspace API key | Use a workspace key with the scope |
| `404 rule_not_found` | Unknown id, or another product's | Check the id and the key's products |

Slack and alert channels, webhook subscriptions, notification preferences, maintenance windows and test sends are managed in the app only. Full schemas are in the [API reference](https://apphelm.dev/docs/api).

## Limits

| What | Limit |
| --- | --- |
| Issue alert rules | 50 per product |
| Metric alert rules | 20 per product |
| Log alerts | 20 per product |
| Insight alerts | 10 per insight, 100 per workspace |
| Scheduled reports | 10 per insight or dashboard, 100 per workspace |
| Slack channels, alert channels | 20 each per workspace |
| Recipients per rule | 20 members or teams, up to 50 people once teams are expanded |
| Issue alert history | Firings kept 90 days |

Email delivery is retried with growing delays for up to 6 attempts.

## Check it works

### Send yourself a test
In **Settings → Notifications**, press **Send me a test**. It should arrive within a few minutes. Press **Send test** on each alert channel you added.

### Fire a real rule
Create an issue rule with the **A new issue appears** trigger, then send a new error: `npx @sansavision/apphelm send-event --product prd_… --message "Alert test $(date +%s)"`. Rules are checked every 5 minutes.

### Check what was delivered
**Recent notifications** shows each notification and how it was delivered. For webhooks, read the delivery log in **Settings → Webhooks**.

## Best practices

- **Start with new issues and regressions**, then add a frequency rule for the few issues that matter most in production.
- **Route by ownership**: assign issues with ownership rules and tick **Notify assignee**, so the right person is told instead of everyone.
- **Send critical alerts to paging, the rest to chat**: give PagerDuty or Opsgenie a minimum severity of `critical`, and Slack `warning`.
- **Use metric alerts for symptoms** (crash-free rate, p95 latency, failure rate) and issue alerts for causes.
- **Schedule maintenance windows** before planned downtime, so on-call isn't paged for it.
- **Verify webhook signatures** and reject old timestamps.

## Troubleshooting

| Symptom | Likely cause | What to do |
| --- | --- | --- |
| No email for an alert | You turned off immediate email, muted the kind, or have the billing role | Check **Settings → Notifications → Your email**; ask an admin about your role |
| A rule never fires | Its issues are ignored, the environment doesn't match, or it was just created | Check the environment; rules don't alert on issues that existed before them |
| A frequency rule fires once and then goes quiet | It fires at most once per issue per window | Expected; lower the window for more frequent alerts |
| A metric alert never changes state | Too few samples (20 transactions, 10 sessions) | Widen the window |
| Slack messages don't arrive | Wrong URL, the product doesn't match, or the severity is below **At least** | Check the channel's fields; tick the kinds or leave all unticked |
| PagerDuty test fails | The key isn't an Events API v2 integration key | Create an Events API v2 integration and paste its key |
| Webhook deliveries fail | The endpoint redirects, is slow, or isn't public HTTPS | Answer 2xx within 10 seconds at the exact URL; use **Redeliver** after fixing it |
| Webhook signature doesn't match | The body was parsed and re-serialised before hashing | Hash the raw request body exactly as received |
| Paged during planned work | No maintenance window, or the alert isn't uptime or cron | Schedule a window; pause other rules for the duration |
| `recipient_not_member` | A recipient can't see the product | Give them access to the product, or remove them |
