Alert Rules
Configure when and how you receive notifications.
Creating Rules
Navigate to Rules
- Go to Alerts → Rules
- Click New Rule
Rule Builder
| Section | Field | Value |
|---|---|---|
| Name | Production Error Alerts | |
| When | Trigger | A new issue is created |
| Conditions | Project | My Production App |
| Environment | production | |
| Level | error, fatal | |
| Actions | Send to | #prod-alerts (Slack) |
| Schedule | Active | Always |
Trigger Types
New Issue
Alert when a never-seen-before error occurs.
trigger: new_issueBest for: Catching new bugs immediately
Issue Regression
Alert when a resolved issue reoccurs.
trigger: regressionBest for: Catching bugs that return after being fixed
Error Count Threshold
Alert when error count exceeds threshold.
trigger: threshold
metric: error_count
operator: greater_than
value: 100
window: 5mBest for: Detecting error spikes
Error Rate Threshold
Alert when error rate exceeds threshold.
trigger: threshold
metric: error_rate
operator: greater_than
value: 5 # percent
window: 15mBest for: Relative error detection
Unique Users Affected
Alert when errors affect many users.
trigger: threshold
metric: affected_users
operator: greater_than
value: 50
window: 1hBest for: High-impact issue detection
Performance Degradation
Alert when Web Vitals degrade.
trigger: performance
metric: lcp_p75
operator: greater_than
value: 3000 # ms
window: 30mBest for: Performance monitoring
Conditions
Project
Limit to specific projects:
conditions:
project: my-production-appOr multiple projects:
conditions:
projects:
- app-frontend
- app-backendEnvironment
Limit to specific environments:
conditions:
environment: productionError Level
Limit to specific severity:
conditions:
levels:
- error
- fatalTags
Match specific tags:
conditions:
tags:
feature: checkout
payment_gateway: stripeIssue Attributes
Match issue properties:
conditions:
issue:
handled: false # Only unhandled errors
first_seen_within: 24h # Only recent issuesActions
Notification Channels
Send to configured channels:
actions:
- channel: slack
target: "#production-alerts"
- channel: email
target: "[email protected]"Multiple Actions
Send to multiple destinations:
actions:
- channel: slack
target: "#alerts"
- channel: teams
target: "Error Notifications"
- channel: webhook
target: "https://api.example.com/alerts"Action Options
Configure how notifications appear:
actions:
- channel: slack
target: "#alerts"
options:
mention: "@oncall"
thread: trueSchedule
Always Active
schedule: alwaysBusiness Hours
schedule:
type: hours
timezone: America/New_York
hours:
start: "09:00"
end: "18:00"
days:
- monday
- tuesday
- wednesday
- thursday
- fridayCustom Schedule
schedule:
type: custom
windows:
- start: "2024-01-01T00:00:00Z"
end: "2024-01-02T00:00:00Z"Rate Limiting
Prevent alert floods:
rate_limit:
max_alerts: 10
window: 1h
action: aggregate # or "drop"Examples
Critical Production Errors
name: Critical Production Errors
trigger: new_issue
conditions:
environment: production
levels: [error, fatal]
actions:
- channel: slack
target: "#critical-alerts"
options:
mention: "@oncall"
- channel: pagerduty
target: production-service
schedule: alwaysError Spike Detection
name: Error Spike Detection
trigger: threshold
metric: error_count
operator: greater_than
value: 50
window: 5m
conditions:
environment: production
actions:
- channel: slack
target: "#monitoring"
rate_limit:
max_alerts: 3
window: 1hPerformance Alerts
name: LCP Degradation
trigger: performance
metric: lcp_p75
operator: greater_than
value: 3000
window: 30m
conditions:
environment: production
actions:
- channel: slack
target: "#performance"
schedule:
type: hours
hours:
start: "06:00"
end: "22:00"User Impact Alert
name: High User Impact
trigger: threshold
metric: affected_users
operator: greater_than
value: 100
window: 1h
conditions:
environment: production
actions:
- channel: email
target: "[email protected]"
- channel: slack
target: "#incidents"Testing Rules
Test before activating:
- Click Test on the rule
- Review sample notification
- Adjust as needed
- Enable the rule
Managing Rules
Enable/Disable
Toggle rules on/off without deleting.
Clone
Duplicate a rule to create variations.
History
View when rule triggered and what was sent.