Use MariaDB Xpand's Host Anomaly Detector with Prometheus


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.


MariaDB Xpand

  • MariaDB Xpand 6.1 (6.1.1 and later)


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


To configure Xpand's Host Anomaly Detector to send metrics to Prometheus, configure some options in the Xpand configuration file:


The following configuration options are relevant:




The TCP port on which to expose Prometheus metrics. Defaults to 8123.


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.