Skip to main content

Prometheus exporter built on top of `nvitop`.

Project description

nvitop-exporter

Prometheus exporter built on top of nvitop.

Quickstart

Start the exporter with the following command:

uvx nvitop-exporter --bind-address 0.0.0.0 --port 5050
# or
pipx run nvitop-exporter --bind-address 0.0.0.0 --port 5050

Then you can access the metrics at http://localhost:5050/metrics.

You will need to configure Prometheus to scrape the metrics from the exporter.

scrape_configs:
  - job_name: 'nvitop-exporter'
    static_configs:
      - targets: ['localhost:5050']

TLS / mTLS

The exporter can serve metrics over HTTPS, optionally requiring client certificate authentication (mTLS). TLS support is provided by prometheus_client (>= 0.19.0) and configured entirely through CLI flags — no config file is involved.

Plain HTTPS

Provide a server certificate and private key:

nvitop-exporter --bind-address 0.0.0.0 --port 5050 \
    --certfile /path/to/server.crt \
    --keyfile /path/to/server.key

The metrics endpoint is then served at https://localhost:5050/metrics. Update the Prometheus scrape config to use the https scheme, and point it at the CA that signed your server certificate:

scrape_configs:
  - job_name: 'nvitop-exporter'
    scheme: https
    static_configs:
      - targets: ['localhost:5050']
    tls_config:
      ca_file: /path/to/server-ca.crt

Mutual TLS (mTLS)

To require scrapers to present a valid client certificate, pass a CA bundle (--client-cafile) or CA directory (--client-capath) and --client-auth-required:

nvitop-exporter --bind-address 0.0.0.0 --port 5050 \
    --certfile /path/to/server.crt \
    --keyfile /path/to/server.key \
    --client-cafile /path/to/clients-ca.crt \
    --client-auth-required

--client-cafile / --client-capath and --client-auth-required must be specified together. Passing a CA without --client-auth-required is rejected by the CLI to avoid the silent "trust but don't verify" configuration that the underlying prometheus_client API would otherwise allow.

Configure Prometheus to present its client certificate when scraping:

scrape_configs:
  - job_name: 'nvitop-exporter'
    scheme: https
    static_configs:
      - targets: ['localhost:5050']
    tls_config:
      ca_file: /path/to/server-ca.crt
      cert_file: /path/to/prometheus-client.crt
      key_file: /path/to/prometheus-client.key

Authentication beyond mTLS

The exporter does not implement HTTP basic auth, OAuth, or IP allowlisting. Following the standard Prometheus exporter pattern, run the exporter behind a reverse proxy (NGINX, Traefik, Caddy, ...) if any of those are required.

Grafana Dashboard

A Grafana dashboard is provided to visualize the metrics collected by the exporter. The source of the dashboard is dashboard.json. The Grafana dashboard can also be imported as by ID 22589.

If you are using docker-compose, you can start a dashboard at http://localhost:3000 with the following command:

cd nvitop-exporter/grafana
docker compose up --build --detach

Grafana Dashboard
The Grafana dashboard for the exporter.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nvitop_exporter-1.7.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nvitop_exporter-1.7.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file nvitop_exporter-1.7.0.tar.gz.

File metadata

  • Download URL: nvitop_exporter-1.7.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nvitop_exporter-1.7.0.tar.gz
Algorithm Hash digest
SHA256 677a416564b4552d4a100e22c35463c07629632d42e2d5138d73c5b295869bf5
MD5 bcd419a51755e42eef9388135d418355
BLAKE2b-256 4640949a1ec2b3f19c66419d83f5fe9fbd1f05f150e700293b4bbedcf894f11a

See more details on using hashes here.

File details

Details for the file nvitop_exporter-1.7.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nvitop_exporter-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b8f9cf8f0a950f8ee5cd38fec6813930984f563beeabdaefdcd1bdffe9397faa
MD5 88a545ca68c76c714991964426385a68
BLAKE2b-256 39644c5f6550582b508132d61305a8a89493ddb65c17d6dd47842e3301a7f562

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page