Memgraph exporter for Prometheus.
The metrics currently collected can be found in the documentation.
$ git clone https://github.com/memgraph/prometheus-exporter.git
$ cd prometheus-exporter
$ python3 -m pip install requests prometheus_client
$ python3 mg_exporter.py --type={standalone,HA}
Standalone exporter can attach only to the single Memgraph instance. It can be started by running:
python3 mg_exporter.py --type=standalone
Make sure to adjust host and port in standalone_config.yaml
.
High availability exporter attaches to multiple memgraph instances which are connected in cluster. It exposes for each instance all metrics which are exposed through standalone exporter but it also adds HA metrics. The full list of metrics used can be found on Memgraph docs.
Make sure to adjust url and port for each instance in the cluster in ha_config.yaml
file.
- Startup your local Memgraph instance.
- Make sure Memgraph is sending the metric information
$ curl <<MEMGRAPH_METRICS_HOST>>:<<MEMGRAPH_METRICS_PORT>>
You should see a JSON object containing the metrics information.
- Run the Memgraph exporter
$ cd prometheus-exporter
$ python3 mg_exporter.py --type=standalone
- Make sure the exporter is running
$ curl <<EXPORTER_HOST>>:<<EXPORTER_PORT>>
You should see a Prometheus object containing the metrics information.
- Launch Prometheus
$ cd prometheus-exporter
$ docker run --name memgraph-prometheus -d --network host -v $(pwd)/config:/etc/prometheus -p 9090:9090 prom/prometheus
- Open the Prometheus UI by going to http://localhost:9090