Use MariaDB Xpand's Host Anomaly Detector with InfluxDB

Overview

Starting with MariaDB Xpand 6.1.1, InfluxDB can be used to store monitoring metrics from the Host Anomaly Detector. InfluxDB can be used on its own, or it can also be integrated with dashboards, such as Grafana.

Alternatively, Prometheus can also be used.

Compatibility

MariaDB Xpand

  • MariaDB Xpand 6.1 (6.1.1 and later)

InfluxDB

  • InfluxDB 1.8 (1.8.10 has been tested)

Grafana

  • Grafana 9.3 (9.3.6 has been tested)

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 InfluxDB, configure some options in the Xpand configuration file:

INFLUXDB_URL=https://USER:PASSWORD@HOST:PORT
INFLUXDB_DATABASE=DATABASE_NAME
INFLUXDB_UPDATE_FREQUENCY=600

The following configuration options are relevant:

Option

Description

INFLUXDB_URL

If specified, metrics will be exported automatically to the specified InfluxDB URL. The specified URL must use the form SCHEME://USER:PASSWORD@HOST:PORT, where SCHEME must be http or https. If the port is unspecified, InfluxDB's default HTTP API port (8086) is used.

INFLUXDB_DATABASE

If specified, metrics will be exported to the specified InfluxDB database. Defaults to xpand.

INFLUXDB_UPDATE_FREQUENCY

How often, in seconds, to export metrics to InfluxDB when configured. Defaults to 30.

Metrics

InfluxDB API

One method available to query metrics from InfluxDB is to use the InfluxDB API.

For example, with the v1 API, curl can be used to query the /query HTTP endpoint:

$ curl 'http://influxdb.internal:8086/query?pretty=true&db=MY_INFLUXDB_DATABASE&q=show+series'
"results": [
{
"statement_id": 0,
"series": [
{
"columns": [
"key"
],
"values": [
[
"mariadb_xpand_alerts,host=xpand.internal,nid=4"
],
[
"mariadb_xpand_times_unreachable,host=xpand.internal,source=4,subject=3"
],
...

Grafana

InfluxDB can also integrate with dashboards, such as Grafana.