Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(exporter): add dashboard example #138

Merged
merged 8 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ insert_final_newline = true
indent_size = 4
src_paths=nvitop

[*.{yaml,yml}]
[*.{yaml,yml,json,xml}]
indent_size = 2

[*.md]
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repos:
- id: debug-statements
- id: double-quote-string-fixer
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.3
rev: v0.8.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand All @@ -34,7 +34,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py37-plus] # sync with requires-python
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@ An interactive NVIDIA-GPU process viewer and beyond, the one-stop solution for G
(TERM: GNOME Terminal / OS: Ubuntu 16.04 LTS (over SSH) / Locale: <code>en_US.UTF-8</code>)
</p>

<p align="center">
<a href="./nvitop-exporter">
<img width="100%" src="https://github.com/user-attachments/assets/c1769a8b-2d06-47c4-8f76-c91dace132e9" alt="Filter">
</a>
<br/>
A Grafana dashboard built on top of <code>nvitop-exporter</code>.
</p>


### Table of Contents <!-- omit in toc --> <!-- markdownlint-disable heading-increment -->

- [Features](#features)
Expand Down
31 changes: 28 additions & 3 deletions nvitop-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,35 @@

Prometheus exporter built on top of `nvitop`.

## Installation
## Quickstart

Install from PyPI:
Start the exporter with the following command:

```bash
pip3 install --upgrade nvitop-exporter
pipx run nvitop-exporter --bind-address 0.0.0.0 --port 5050
# or
uvx 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.

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

## Grafana Dashboard

A Grafana dashboard is provided to visualize the metrics collected by the exporter.
The source of the dashboard is [`dashboard.json`](./dashboard.json).
The Grafana dashboard can also be imported as by ID [22589](https://grafana.com/grafana/dashboards/22589-nvitop-dashboard).

<p align="center">
<img width="100%" src="https://github.com/user-attachments/assets/c1769a8b-2d06-47c4-8f76-c91dace132e9" alt="Filter">
<br/>
The Grafana dashboard for the exporter.
</p>
Loading
Loading