Xen Orchestra OpenMetrics Plugin - Grafana Dashboard
-
Hello XCP-ng community!
Since Vates released the new OpenMetrics plugin for Xen Orchestra we now have an official, built-in exporter for Prometheus metrics!
I was using xen-exporter before in order to make hypervisor internal RRD database available in the form of Prometheus metrics.
I migrated to the new plugin which works just fine.I updated the Grafana dashboard that I was using in order to be compatible with the official OpenMetrics plugin and thought "why not share it with other users"?
In case you are interested you can find my dashboard JSON here: https://gist.github.com/MajorP93/3a933a6f03b4c4e673282fb54a68474b
It is based on the xen-exporter dashboard made by MikeDombo: https://grafana.com/grafana/dashboards/16588-xen/
In case you also use Prometheus for scraping Xen Orchestra OpenMetrics plugin in combination with Grafana you can copy the JSON from my gist, import it and you are ready to go!
Hope it helps!
Might even be a good idea to include the dashboard as an example in the Xen Orchestra documentation.

Best regards
-
@MajorP93 hi, how can i scrape openmetrics endpoint?
i set up openmetrics plugin prometheus secret, enabled it, and ten tried to use curl like that: curl -H "Authorization: Bearer abc123" http://localhost:9004
but response i got was
{"error":"Query authentication does not match server setting"}
what am i doing wrong? -
@Mang0Musztarda can you try http://<xo>/openmetrics
the :9004 is more an internal route ( on xoa it is behind the proxy ) -
To add to what @florent said, here's the complete picture:
Why your command failed:
-
Wrong URL:
localhost:9004is the internal port that only listens on
127.0.0.1. It's proxied through xo-server at/openmetrics/metrics. -
Wrong token: The error "Query authentication does not match server setting"
means your Bearer token doesn't match the one configured in the plugin.
Correct approach:
-
Get your secret from: Settings → Plugins → OpenMetrics → "Prometheus secret"
-
Use the proxied endpoint:
curl -H "Authorization: Bearer <your-actual-secret>" \ http://<your-xo-server>/openmetrics/metrics -
For health checks (no auth required):
curl http://<your-xo-server>/openmetrics/health
Returns: {"status":"ok"}
Full documentation is available at:
https://docs.xen-orchestra.com/advanced#openmetrics--prometheus-integrationIt covers Prometheus configuration, available metrics, Grafana dashboards,
alerting rules, and troubleshooting.@MajorP93 Thanks for sharing your Grafana dashboard! It could indeed be a nice
addition to link it from the official docs as a community example. -
-
@Mang0Musztarda said in Xen Orchestra OpenMetrics Plugin - Grafana Dashboard:
@MajorP93 hi, how can i scrape openmetrics endpoint?
i set up openmetrics plugin prometheus secret, enabled it, and ten tried to use curl like that: curl -H "Authorization: Bearer abc123" http://localhost:9004
but response i got was
{"error":"Query authentication does not match server setting"}
what am i doing wrong?Hey!
I scrape it like so:root@prometheus01:~# cat /etc/prometheus/scrape_configs/xen-orchestra-openmetrics.yml scrape_configs: - job_name: xen-orchestra honor_labels: true scrape_interval: 30s scrape_timeout: 20s scheme: https tls_config: insecure_skip_verify: true bearer_token_file: /etc/prometheus/bearer.token metrics_path: /openmetrics/metrics static_configs: - targets: - xen-orchestra.domain.local/etc/prometheus/bearer.token file contains the bearer token as configured in openmetrics xen orchestra plugin.
best regards