Guide: Setting Up Alerts
Getting timely, context-rich alerts is the primary reason for monitoring. This guide walks you through setting up alerts using the 9n9s web dashboard - the recommended approach for most users.
Dashboard First: This guide focuses on web interface setup for ease of use. For programmatic alert configuration, see our API Reference or CLI Reference after completing your dashboard setup.
The alerting system has two main components:
- Notification Channels: The services you want to receive alerts on (e.g., Email, Slack, SMS).
- Alert Rules: The logic that determines when to send an alert to a specific channel based on the monitor and the event.
1. Configure Notification Channels
Section titled “1. Configure Notification Channels”First, you need to tell 9n9s where to send notifications. You can configure channels at the Organization level.
- Navigate to Organization Settings > Notification Channels.
- Click “Add Channel” and choose a provider.
- Follow the instructions to connect your account.
9n9s supports a wide range of channels, including:
- SMS (via Twilio)
- Webhooks (for custom integrations)
- Slack
- Discord
- PagerDuty
- Opsgenie
- And many more…
You can set up as many channels as you need. For example, you might have one Slack channel for low-priority warnings and a PagerDuty service for critical production alerts.
2. Create an Alert Rule
Section titled “2. Create an Alert Rule”By default, your project has a simple rule to email you for any monitor failure. You can create more sophisticated rules to control alert routing.
Alert rules are configured at the Project level.
-
Navigate to your Project Settings > Alert Rules.
-
Click “Create Rule”.
-
Define the
whencondition:- Monitor Status: e.g.,
is Down,is Up(for recovery notices),is Degraded. - Monitor Tags: Route alerts based on tags. For example, you can create a rule to only fire for monitors with the
productiontag. - Duration: Only send an alert if a monitor has been down for a certain amount of time (e.g.,
5 minutes) to avoid flapping.
- Monitor Status: e.g.,
-
Define the
thenaction:- Send a notification to: Select one or more of your pre-configured Notification Channels.
- Deduplication: You can set a time window to prevent re-sending the same alert (e.g.,
don't re-notify for 1 hour).
Example Alert Rule
Section titled “Example Alert Rule”Here’s a common example:
- When…
- A monitor with the tag
database - has been
Downfor10 minutes
- A monitor with the tag
- Then…
- Send a notification to the
#database-alertsSlack channel. - Send a notification to the
Primary On-CallPagerDuty service.
- Send a notification to the
- And…
- Do not re-notify for
2 hours.
- Do not re-notify for
This setup ensures that a transient database issue doesn’t wake someone up, but a sustained outage triggers a high-priority incident.