---
title: "Configure Prometheus and AlertManager"
description: "Guide on configuring Prometheus server and AlertManager to scrape Aerospike metrics and manage alert rules."
---

# Configure Prometheus and AlertManager

> For the complete documentation index see: [llms.txt](https://aerospike.com/docs/llms.txt)
> 
> All documentation pages available in markdown.

This page 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.

```yaml
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.

```yaml
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](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`.

```yaml
rule_files:

  - "/etc/prometheus/aerospike_rules.yaml"
```

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

```yaml
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](https://gist.github.com/rbotzer/4db1bc60bd9e02ba485abcbd32ec1606).

For more details, see the [documentation for AlertManager](https://prometheus.io/docs/alerting/configuration/#configuration).