Aerospike Database metrics
For production monitoring and alerting, collect the full set of Prometheus metrics from your Aerospike Cloud cluster. Unlike Cloud Console metrics or Cloud Public API metrics, Aerospike Database metrics give you per-node granularity, the complete metric catalog, and the ability to build custom dashboards and alerts in tools like Grafana.
Each Aerospike Cloud cluster node runs the Aerospike Prometheus Exporter, which collects metrics and exposes them on port 9145 at the same database hostname as the Aerospike database.
Collect Aerospike metrics
Set up Prometheus to scrape metrics from your Aerospike Cloud cluster nodes.
-
Get the Aerospike Cloud database hostname from the Aerospike Cloud Console.
-
(Optional) Run the following command to verify that metrics can be collected:
Terminal window curl <database-hostname>:9145/metricsFor example, if the database hostname is
0ecf039f-4abe-472d-aaf9-d99e55aa9f3a.aerospike.internal:Terminal window curl 0ecf039f-4abe-472d-aaf9-d99e55aa9f3a.aerospike.internal:9145/metricsThe command returns a list of Aerospike metrics in Prometheus metric format. See the Metrics Reference for a full list of available metrics.
-
Configure a Prometheus server to collect metrics from the database hostname on port 9145 and path
/metrics.The database hostname resolves to an A record for each Aerospike node, meaning the database hostname returns many host targets. When collecting metrics with Prometheus, use the
dns_sd_configscrape configuration. For more information, see the Prometheus documentation.# prometheus config filescrape_configs:- job_name: aerospikemetrics_path: /metricsscheme: httpscrape_interval: 30sdns_sd_configs:- names:DATABASE_HOSTNAMEtype: Aport: 9145metric_relabel_configs:- target_label: cluster_namereplacement: CLUSTER_NAMEReplace
CLUSTER_NAMEwith the name you want to identify this cluster with in Grafana dashboards. Themetric_relabel_configsrule rewrites thecluster_namelabel on all scraped metrics, so dashboard panels like Cluster Name display the value you configure here.
Identify clusters in Grafana dashboards
The pre-built dashboards in the aerospike-monitoring repository use the cluster_name label to filter panels. Because cluster_name is always aerospike for all Aerospike Cloud clusters, these dashboards display a generic name and cannot differentiate between multiple clusters.
The metric_relabel_configs rule in the scrape configuration rewrites the cluster_name label on all scraped metrics before Prometheus stores them. This means the pre-built Grafana dashboards display the name you configure without any dashboard modification.
If you monitor multiple Aerospike Cloud clusters, add a separate scrape job for each cluster with a different CLUSTER_NAME value. The existing Cluster dropdown in the pre-built dashboards then lets you switch between clusters.
Metric labels
Each metric scraped from an Aerospike Cloud cluster includes labels that identify the source. Two labels are important for identifying clusters:
cluster_name: Alwaysaerospikefor all Aerospike Cloud clusters, regardless of the name you entered during provisioning. The server configuration sets this value and you cannot change it.database_id: The unique identifier for your Aerospike Cloud database, shown as Cluster ID on the Details tab of the Aerospike Cloud Console. The exporter includes this label automatically in every metric. You do not need to configure anything to use it. This is the same UUID that appears in your database hostname.