Alert in Promscale

Promscale supports alerting rules. It evaluates these rules at regular intervals. The Promscale connector can be used as the ruler while ingesting and querying the data. In Promscale, you can set the alerting rules similar to Prometheus rules configuration and publish the alerts to alertmanager.

Alert manager

The alert manager manages alerts, including silencing, inhibition, and aggregation. It also sends out notifications using email, on-call notification systems, and chat platforms. The labels, summary, and description described in the alerting rules file is forwarded to the alert manager on meeting the PromQL alert expression.

To set up alerting and notifications, you need to:

  1. Setup and configure the alert manager
  2. Configure Promscale to talk to the alert manager
  3. Create alerting rules in Promscale

For more details about the alertmanager tool, see the alert manager documentation.

Set alerting rules

Promscale alerting rules are compatible with Prometheus alerting rules capabilities. Alerting rules are written in one or multiple YAML files. Promscale evaluates these conditional rules. The alerting rules are used to trigger alerts when there is a violation of pre-defined conditions. Alert notifications can be sent through different communication channels like Slack or email can receive these alerts.

Setting alerting rules

  1. Create a YAML file that contains the configuration for each alert similar to:

    1. groups:
    2. - name: <alert-group-name>
    3. rules:
    4. - alert: <alert-name>
    5. expr: <promql_expression>
    6. for: <time-interval for how long this to happen to happen to fire an alert>
    7. labels:
    8. <key>:<value>
    9. annotations:
    10. summary: <text>
    11. description: <description on alert>
  2. Create another file that lists all rules YAML files as well as global configuration parameters:

    1. global:
    2. evaluation_interval: 10s
    3. rule_files:
    4. - "<alert-rules-file>"
    5. #AlertManager client configuration to publish alerts
    6. alerting:
    7. alertmanagers:
    8. - static_configs:
    9. - targets:
    10. - localhost:9093
  3. Pass this configuration file to Promscale when you start the service, using the -metrics.rules.config flag.

For more information about alerting, see Prometheus alerting. For specific information about alerting rules, see Prometheus alerting rules.