vmware-archive / vsan-integration-for-prometheus

vSAN Integration for Prometheus: making it easier using Prometheus to monitor vSAN performance

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

VSAN Prometheus Statistics API

stefanLeo opened this issue · comments

Hi @peng-mi

I am referring to this part of your doc:

Lots of new features come in vSphere & vSAN 7.0 release:
ESXi natively exposes a Prometheus /vsanmetrics API endpoint for vSAN metrics.

I interpreted that in a way that I do no need to setup the exporter as of vspere 7.0 (we have 7u2). Is that correct?
If yes: what exactly is the URI of this Prometheus "/vsanmetrics" Endpoint? We could not find it. Do we need to configure/enalbe this API somewhere?
I would need some sort of IP-OF-VSAN-HOST:Port/vsanmetrics type of api uri.

If no: Then I need to use your exporter to scrape the metrics form the vcenter API correct?

Thx for you help & BR
Stefan

In case anyone else is stumbling over this issue - we found out how to solve this issue and get the native Prom API into Prometheus:

  1. The URI is enabled per default on every ESXI host under: https://[IP or DNS]:5443/vsanmetrics
    Non HTTPS does NOT work. I.e. there is no redirect
  2. You need an authentication token (bearer) to be able to get statistics data.
    You can obtain that via the "vsan-prometheus-setup" container or directly via vsphere client. This container effectivly connects to vsphere and obtains such a token.
    For details see: https://github.com/vmware/vsan-integration-for-prometheus/blob/master/vsan-prometheus-setup/vsanSetupToken.py
  3. You might want to use the "exporter" - in this case it imho is not an exporter but more some kind of endpoint discovery tool to get a list of URIs that are available via vsphere API. or you just configure the endpoints manually for static environments.

Result: Native Prom Metrics - no Exporter or so needed to grab them.
The containers basically solve different issues you might have in real life scenarios (like discovery, token grabbing & refresh, ...)