Use MariaDB Xpand's Host Anomaly Detector with Prometheus
This page is part of MariaDB's Documentation.
The parent of this page is: Host Anomaly Detector for MariaDB Xpand
Topics on this page:
Overview
Starting with MariaDB Xpand 6.1.1, Prometheus can be used to store monitoring metrics from the Host Anomaly Detector.
Alternatively, InfluxDB can also be used.
Compatibility
MariaDB Xpand
MariaDB Xpand 6.1 (6.1.1 and later)
Prometheus
The following versions of Prometheus have been tested:
Prometheus 2.8.1
Prometheus 2.43.0
Use Cases
Identify potential problems with nodes sooner
Detect when backend network connections repeatedly fail
Detect when particular periodic tasks take too long
Configuration
To configure Xpand's Host Anomaly Detector to send metrics to Prometheus, configure some options in the Xpand configuration file:
MONITOR_PORT=PORT
The following configuration options are relevant:
Option | Description |
---|---|
| The TCP port on which to expose Prometheus metrics. Defaults to |
Metrics
To see the metrics from an Xpand node, query the Prometheus endpoint on MONITOR_PORT
:
$ curl xpand-node1:8123/metrics
# HELP mariadb_xpand_errors The number of errors observed
# TYPE mariadb_xpand_errors counter
mariadb_xpand_errors{host="xpand-node1",nid="1"} 5
# HELP mariadb_xpand_alerts The number of alerts observed
# TYPE mariadb_xpand_alerts counter
mariadb_xpand_alerts{host="xpand-node1",nid="2"} 4
# HELP mariadb_xpand_times_unreachable Incremented when the subject node is unreachable from the source
# TYPE mariadb_xpand_times_unreachable counter
mariadb_xpand_times_unreachable{source="2",host="xpand-node1",subject="1"} 1
mariadb_xpand_times_unreachable{source="1",host="xpand-node1",subject="2"} 180
...
The output provides some metadata about each metric as PromQL comments.