|
| 1 | +# Alert Rules Structure |
| 2 | + |
| 3 | +This directory contains Grafana alert rules for monitoring SAS Viya environments. The alerts are organized into subdirectories by component/category: |
| 4 | + |
| 5 | +- `cas/` - Alerts for CAS (Cloud Analytic Services) |
| 6 | +- `database/` - Alerts for database services |
| 7 | +- `platform/` - Alerts for Viya platform components |
| 8 | +- `other/` - Miscellaneous alerts |
| 9 | + |
| 10 | +## Alert Files Structure |
| 11 | + |
| 12 | +Each alert is stored in its own YAML file with a descriptive name. This modular approach makes it easier to: |
| 13 | + |
| 14 | +- Manage individual alerts |
| 15 | +- Track changes in version control |
| 16 | +- Enable/disable specific alerts |
| 17 | +- Customize alerts for specific environments |
| 18 | + |
| 19 | +## Alert File Format |
| 20 | + |
| 21 | +Each alert file follows this structure: |
| 22 | + |
| 23 | +```yaml |
| 24 | +apiVersion: 1 |
| 25 | +groups: |
| 26 | + - interval: 5m # How often the alert is evaluated |
| 27 | + folder: Category Name # The folder where the alert appears in Grafana |
| 28 | + name: SAS Viya Alerts # The alert group name |
| 29 | + orgId: 1 |
| 30 | + rules: |
| 31 | + - title: Alert Title # The name of the alert |
| 32 | + annotations: |
| 33 | + description: Detailed explanation of the alert condition |
| 34 | + summary: Brief summary of the alert |
| 35 | + condition: C # The condition reference letter |
| 36 | + data: |
| 37 | + # The alert query and evaluation conditions |
| 38 | + execErrState: Error |
| 39 | + for: 5m # Duration before alert fires |
| 40 | + labels: |
| 41 | + severity: warning # Alert severity |
| 42 | + noDataState: NoData |
| 43 | + uid: unique-alert-id # Unique identifier for the alert |
| 44 | +``` |
| 45 | +
|
| 46 | +## Legacy Alert Files |
| 47 | +
|
| 48 | +The original monolithic alert files (cas_alerts.yaml, database_alerts.yaml, etc.) are still present for backward compatibility. These files will be deprecated in future releases, so we recommend using the individual alert files going forward. |
| 49 | +
|
| 50 | +## Customizing Alerts |
| 51 | +
|
| 52 | +To customize an alert: |
| 53 | +
|
| 54 | +1. Copy the alert file to your user directory |
| 55 | +2. Modify the alert parameters as needed (thresholds, evaluation intervals, etc.) |
| 56 | +3. Deploy the monitoring components to apply your custom alerts |
| 57 | +
|
| 58 | +For more detailed information on Grafana alerting, see the [Grafana documentation](https://grafana.com/docs/grafana/latest/alerting/). |
0 commit comments