Alert Rules
Configure alert rules to get notified when things go wrong.
Overview#
Alert rules define conditions that trigger notifications when your application's metrics exceed defined thresholds. JustAnalytics monitors these conditions continuously and notifies you via your configured channels.
Creating an Alert Rule#
Navigate to Monitoring > Alerts and click Create Rule.
Rule Components#
Each rule consists of:
- Metric -- what to measure
- Condition -- when to trigger (threshold, comparison)
- Window -- time period to evaluate
- Severity -- how critical the alert is
- Channels -- where to send notifications
Example Rules#
High Error Rate:
Metric: Error count
Condition: Greater than 50
Window: 5 minutes
Severity: Critical
Slow API Response:
Metric: p95 latency
Condition: Greater than 2000ms
Window: 10 minutes
Severity: Warning
Service: api-server
Low Uptime:
Metric: Uptime check failures
Condition: Greater than 2 consecutive
Window: N/A
Severity: Critical
Available Metrics#
Error Metrics#
| Metric | Description | |--------|-------------| | Error count | Total errors in the window | | Error rate | Errors per minute | | New error groups | Previously unseen error types | | Error regression | Resolved errors that recur |
Performance Metrics#
| Metric | Description | |--------|-------------| | p50 latency | Median response time | | p95 latency | 95th percentile response time | | p99 latency | 99th percentile response time | | Request rate | Requests per minute | | Throughput | Successful requests per minute |
Infrastructure Metrics#
| Metric | Description | |--------|-------------| | CPU usage | CPU utilization percentage | | Memory usage | Memory utilization percentage | | Disk usage | Disk utilization percentage |
Custom Metrics#
Any metric you send via JA.recordMetric() can be used as an alert condition.
Severity Levels#
| Severity | Behavior | Suggested Use | |----------|----------|---------------| | Info | Log only | Low-priority awareness | | Warning | Notify during business hours | Potential issues | | Critical | Notify immediately | Service degradation |
Alert States#
| State | Description | |-------|-------------| | OK | Condition not met | | Firing | Condition exceeded, notification sent | | Acknowledged | Team member acknowledged the alert | | Resolved | Condition returned to normal |
Evaluation#
Alert rules are evaluated every 60 seconds. The evaluation window looks back at the configured time period (e.g., "last 5 minutes") and computes the metric value. If the condition is met, the alert transitions to Firing.
Muting#
Temporarily mute alerts during planned maintenance:
- Mute by rule -- silence a specific rule
- Mute by service -- silence all alerts for a service
- Mute schedule -- set recurring mute windows (e.g., during deploy windows)