Sign inSign up

ajwest3d/jellyfin-session-exporter

By ajwest3d

•Updated about 1 year ago

Image
0

1.4K

ajwest3d/jellyfin-session-exporter repository overview

⁠Jellyfin Session Exporter

A Prometheus exporter that monitors Jellyfin media server activity by exposing metrics about active playback sessions, including session counts and playback progress.

⁠🚀 Features

  • Real-time monitoring of active Jellyfin sessions
  • Progress tracking for individual playback sessions
  • Total active session count
  • Cumulative session tracking
  • Built-in health checks for container orchestration
  • Lightweight Python implementation

⁠� Configuration

The exporter requires two environment variables to be set:

VariableDescriptionDefault
JELLYFIN_URLThe base URL of your Jellyfin serverhttp://localhost:8096
JELLYFIN_API_KEYYour Jellyfin API keyRequired

To get an API key:

  1. Log into your Jellyfin server as an administrator
  2. Go to Dashboard → API Keys
  3. Create a new API key

⁠�📆 Docker Usage

Pull and run the latest version:

docker run -d \
  --name jellyfin-exporter \
  -p 9789:9789 \
  -e JELLYFIN_URL=http://your-jellyfin:8096 \
  -e JELLYFIN_API_KEY=your_api_key \
  ajwest3d/jellyfin-session-exporter:1.0.0

Or build locally:

# Build the image
docker build -t jellyfin-session-exporter .

# Run with environment variables
docker run -d \
  --name jellyfin-exporter \
  -p 9789:9789 \
  -e JELLYFIN_URL=http://your-jellyfin:8096 \
  -e JELLYFIN_API_KEY=your_api_key \
  jellyfin-session-exporter

The exporter will be available at http://localhost:9789/metrics

⁠🔧 Prometheus Scrape Config

- job_name: 'jellyfin_sessions'
  static_configs:
    - targets: ['your-host:9789']

⁠📊 Metrics

The following metrics are exposed at /metrics:

Metric NameTypeDescriptionLabels
jellyfin_playback_progress_percentGaugeProgress percentage of each active playback sessionuser, item_name, session_id
jellyfin_active_sessions_totalGaugeTotal number of currently active playback sessionsnone
jellyfin_active_sessions_count_totalGaugeCumulative count of all sessions seen since exporter startnone

⁠🔍 Health Checking

The container includes a built-in health check that verifies the /metrics endpoint is responding correctly. The health check runs every 30 seconds with a 3-second timeout.

⁠🚦 Port

The exporter listens on port 9789 by default.

⁠📝 License

MIT License

⁠👥 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Tag summary

Content type

Image

Digest

sha256:fb91bf6b6…

Size

52.6 MB

Last updated

about 1 year ago

docker pull ajwest3d/jellyfin-session-exporter