This repository contains code for a prometheus exporter that exports metrics of XRootD dataservers and redirectors.
It uses XRootD's mpxstats
tool, which can optionally be enabled on servers/redirectors to send statistics to listeners via UDP.
The exporter transforms mpxstats
metrics into prometheus metrics, making those available for monitoring via prometheus.
A optional file containing descriptions for metrics is provided seperatly.
- Python 3.X
- prometheus_client python package
The process can be started by
python3 /path/to/xrootd_exporter.py
Alternatively, a systemd unitfile is provided.
Modify your xrootd configuration and point it to the host::port running the exporter
xrd.report 127.0.0.1:10024 every 10 -all
On startup, xrootd_exporter.py looks for 4 optional environmental variables:
MPX_PORT
defines the UDP listening port of the exporter'smpxstats
process, the default is 10024MPX_PATH
defines the path to thempxstats
binaryEXPORTER_PORT
defines the TCP listening port of the exporter's prometheus web server, the default is 9090EXPORTER_DESCRIPTION_FILE
defines the path to file containing metric descriptions
When using the systemd unitfile you can easily modify the service by adding
Environment=MPX_PATH=/usr/local/bin/mpxstats
A Vagrant/Ansible setup consisting of 2 data servers and grafana/prometheus instance is available here.
Right now these limitations exist on the exporter:
- The exporter can only show field descriptions for the first oss.path and cmsd.node
- The exporter will hang until mpxstats has received information at least once
LGPL3 as described in the License File
As for the current scope this exporter is considered completed.
It implements all summary statistics available via mpxstats
.
Even though, a much more advanced exporter based on the detailed monitoring data format might prove useful in the future.
Feel free to suggest features and report bugs via issues