Sign inSign up

ajwest3d/jellyfin-gpu-exporter

By ajwest3d

โ€ขUpdated over 1 year ago

Queries nvidia-smi of a different container (jellyfin) and exposes as prometheus metrics.

Image
0

178

ajwest3d/jellyfin-gpu-exporter repository overview

โ Jellyfin GPU Exporter

A lightweight Prometheus exporter that monitors the NVIDIA GPU usage inside a running Jellyfin Docker container.

This exporter runs independently, calls nvidia-smi inside the Jellyfin container using docker exec, and exposes metrics on /metrics for Prometheus scraping.


โ ๐Ÿ“ฆ Features

  • GPU presence check
  • Memory usage (used/total)
  • Utilization percentage
  • Temperature (ยฐC)
  • Power draw (watts)
  • Number of active GPU processes
  • Error counter (for failed scrapes)

โ ๐Ÿš€ Getting Started

โ 1. Build the image (optional)
git clone https://github.com/youruser/jellyfin-gpu-exporter.git
cd jellyfin-gpu-exporter
docker build -t ajwest3d/jellyfin-gpu-exporter:latest .
โ 2. Run the exporter
docker run -d \
  --name jellyfin-gpu-exporter \
  -e TARGET_CONTAINER=jellyfin \
  -e EXPORTER_PORT=9109 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -p 9109:9109 \
  ajwest3d/jellyfin-gpu-exporter:latest
  • TARGET_CONTAINER: Name of your Jellyfin container (default: jellyfin)
  • EXPORTER_PORT: Port to expose metrics on (default: 9109)

๐Ÿ” Note: Mounting Docker socket allows this container to run docker exec commands into Jellyfin. Only do this on trusted hosts.


โ ๐Ÿ“ˆ Metrics exposed

Metric NameDescription
jellyfin_gpu_ok1 if GPU is available, else 0
jellyfin_gpu_memory_used_mebibytesMemory used (MiB)
jellyfin_gpu_memory_total_mebibytesTotal memory (MiB)
jellyfin_gpu_utilization_percentGPU usage (%)
jellyfin_gpu_temperature_celsiusGPU temp (ยฐC)
jellyfin_gpu_power_draw_wattsEstimated power usage (W)
jellyfin_gpu_process_countNumber of active GPU processes
jellyfin_gpu_exporter_errors_totalExporter errors total counter

โ ๐Ÿ“ก Prometheus config

- job_name: 'jellyfin-gpu'
  static_configs:
    - targets: ['localhost:9109']

โ ๐Ÿงช Local test

Visit the metrics endpoint in a browser:

http://localhost:9109/metrics

You should see all metrics in Prometheus format.


โ ๐Ÿ›  Future Ideas

  • Multi-container support
  • Multi-GPU support
  • Label per GPU index
  • Optional metrics filtering

โ ๐Ÿ“„ License

MIT


Built with โค๏ธ by @ajwest3dโ 

Tag summary

Content type

Image

Digest

sha256:3651037f0โ€ฆ

Size

211.7 MB

Last updated

over 1 year ago

docker pull ajwest3d/jellyfin-gpu-exporter:v1