Skip to main content
Loading

Configuring Prometheus and AlertManager

This section describes how to configure the Prometheus server to scrape metrics from Aerospike Prometheus Exporter, send alerts to an Alertmanager instance, and add an Aerospike alert rules configuration file.

Configure Prometheus

Specify values for global parameters.

global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).

Optional: Enable the sending of alerts by listing the IP addresses and ports of target instances of AlertManager.

alerting:
alertmanagers:
- static_configs:
- targets:
- "alertmanager:9093"

Configure rules for sending alerts.

Download the Aerospike rules-configuration file. This file configures fourteen alert rules. You can download it from the config/prometheus/ folder of the aerospike-monitoring GitHub repository. The link is https://github.com/aerospike/aerospike-monitoring/blob/master/config/prometheus/aerospike_rules.yml.

Copy the file to the path /etc/prometheus/.

Add the path to the file as the value of the rules_file parameter in prometheus.yml.

rule_files:
- "/etc/prometheus/aerospike_rules.yaml"

Specify the instances of Aerospike Prometheus Exporter that you want Prometheus to scrape.

scrape_configs:
- job_name: 'aerospike'
static_configs:
- targets: ['172.20.0.2:9145', '172.20.0.3:9145']

Configure AlertManager

The Alertmanager supports various configurations depending on where the notifications need to be sent.

An example that sends alerts to Slack is available as a file from GitHub Gist.

For more details, see the documentation for AlertManager.