> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devhelm.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Testing Your Alerts

> Validate your DevHelm alert pipeline end-to-end before an actual incident

By the end of this guide, you'll have validated that your alert channels deliver correctly, your notification policies match as expected, and the full incident-to-notification pipeline works.

<Accordion title="Prerequisites">
  * At least one alert channel — see [First alert](/guides/first-alert)
  * At least one notification policy
</Accordion>

## Three levels of testing

### Level 1: Test individual channels

Verify each channel's configuration sends a test message:

```bash theme={null}
devhelm alert-channels test <channel-id>
```

This sends a sample notification and reports success or failure. Test every channel — misconfigured webhook URLs and expired tokens are the most common causes of missed alerts.

### Level 2: Dry-run notification policies

Test that your match rules evaluate correctly without creating a real incident:

```bash theme={null}
curl -X POST https://api.devhelm.io/api/v1/notification-policies/<policy-id>/test \
  -H "Authorization: Bearer $DEVHELM_API_TOKEN"
```

### Level 3: End-to-end with a failing monitor

Create a monitor designed to fail and trace the full pipeline:

<Steps>
  <Step title="Create a test monitor">
    ```bash theme={null}
    devhelm monitors create \
      --name "Alert Pipeline Test (delete me)" \
      --type HTTP \
      --url https://httpstat.us/500 \
      --frequency 30 \
      --regions us-east
    ```
  </Step>

  <Step title="Wait for the incident">
    With default incident policy settings (2 consecutive failures), an incident should be confirmed within about 1 minute. List incidents and look for one with status `CONFIRMED`:

    ```bash theme={null}
    devhelm incidents list
    ```
  </Step>

  <Step title="Verify notifications">
    Check that the expected notifications arrived at your channels. Also verify via the API:

    ```bash theme={null}
    curl "https://api.devhelm.io/api/v1/notification-dispatches?incident_id=<incident-id>" \
      -H "Authorization: Bearer $DEVHELM_API_TOKEN"
    ```

    Each dispatch shows the channel, delivery status, and timestamp.
  </Step>

  <Step title="Test resolution notifications">
    Resolve the incident and verify resolution messages arrive:

    ```bash theme={null}
    devhelm incidents resolve <incident-id> \
      --message "Test complete"
    ```
  </Step>

  <Step title="Clean up">
    ```bash theme={null}
    devhelm monitors delete <test-monitor-id>
    ```
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Channel test succeeds but real alerts don't arrive">
    Check that your notification policy actually matches the incident. Review match rules — an empty `matchRules` array (catch-all) is the safest starting point for testing.
  </Accordion>

  <Accordion title="Incident created but no dispatches">
    The incident may be suppressed by an active [maintenance window](/incidents/maintenance-windows) or [resource group suppression](/alerting/suppression). Check:

    ```bash theme={null}
    curl "https://api.devhelm.io/api/v1/maintenance-windows?filter=active" \
      -H "Authorization: Bearer $DEVHELM_API_TOKEN"
    ```
  </Accordion>

  <Accordion title="Dispatches show FAILED status">
    Check the delivery history for the channel:

    ```bash theme={null}
    curl "https://api.devhelm.io/api/v1/alert-channels/<channel-id>/deliveries" \
      -H "Authorization: Bearer $DEVHELM_API_TOKEN"
    ```

    Common causes: expired webhook URL, revoked API key, rate limiting from the destination.
  </Accordion>

  <Accordion title="Escalation chain doesn't advance">
    If `requireAck` is set on a step and someone acknowledged, the chain stops. Check dispatch acknowledgment status. Also verify the `delayMinutes` value — the chain waits that long before advancing.
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Alert channels" icon="plug" href="/alerting/channels">
    Channel types and delivery behavior.
  </Card>

  <Card title="Notification policies" icon="filter" href="/alerting/notification-policies">
    Match rules, priority, and evaluation order.
  </Card>

  <Card title="Tiered escalation" icon="arrow-up-right-dots" href="/guides/tiered-escalation">
    Build multi-step escalation chains.
  </Card>
</CardGroup>
