An open API service indexing awesome lists of open source software.

https://github.com/jsclayton/prometheus-plex-exporter

Export metrics from your Plex Media Server
https://github.com/jsclayton/prometheus-plex-exporter

grafana grafana-agent plex plex-media-server prometheus prometheus-exporter

Last synced: 4 months ago
JSON representation

Export metrics from your Plex Media Server

Awesome Lists containing this project

README

          

# Prometheus Exporter for Plex

Expose library playback, storage, and host metrics in a Prometheus format.

# Configuration

The exporter is configured via required environment variables:

- `PLEX_SERVER`: The full URL where your server can be reached, including the scheme and port (if not 80 or 443). For example `http://192.168.0.10:32400` or `https://my.plex.tld`.
- `PLEX_TOKEN`: A [Plex token](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/) belonging to the server administrator.

# Running

The exporter runs via Docker:

```bash
docker run \
-name prom-plex-exporter \
-p 9000:9000 \
-e PLEX_SERVER="" \
-e PLEX_TOKEN="" \
ghcr.io/jsclayton/prometheus-plex-exporter
```

Or via Docker Compose:

```yaml
prom-plex-exporter:
image: ghcr.io/jsclayton/prometheus-plex-exporter
ports:
- 9000:9000/tcp
environment:
PLEX_SERVER:
PLEX_TOKEN:
```

A sample dashboard can be found in the [examples](examples/dashboards/Media%20Server.json)

# Exporting Metrics

The simplest way to start visualizaing your metrics is with the Free Forever [Grafana Cloud](https://grafana.com/docs/grafana-cloud/) and [Grafana Agent](https://grafana.com/docs/agent/latest/).

Here's an example config file that will read metrics from the exporter and ship them to [Prometheus](https://grafana.com/docs/grafana-cloud/data-configuration/metrics/metrics-prometheus/) via `remote_write`:

```yaml
metrics:
configs:
- name: prom-plex
scrape_configs:
- job_name: prom-plex
static_configs:
- targets:
-
remote_write:
- url:
basic_auth:
username:
password:
```