{"id":22416400,"url":"https://github.com/cilindrox/plex-exporter","last_synced_at":"2026-01-07T03:34:22.425Z","repository":{"id":150165102,"uuid":"315040450","full_name":"cilindrox/plex-exporter","owner":"cilindrox","description":"Plex metrics exporter for the Prometheus stack running on k8s ","archived":false,"fork":false,"pushed_at":"2020-11-22T15:16:56.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T09:29:31.160Z","etag":null,"topics":["plex-media-server","plex-server","plexmediaserver"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cilindrox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-22T13:10:31.000Z","updated_at":"2020-11-22T15:16:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"452b33b0-53e8-41ba-aebb-0e2449d16c07","html_url":"https://github.com/cilindrox/plex-exporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cilindrox%2Fplex-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cilindrox%2Fplex-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cilindrox%2Fplex-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cilindrox%2Fplex-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cilindrox","download_url":"https://codeload.github.com/cilindrox/plex-exporter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245779485,"owners_count":20670688,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["plex-media-server","plex-server","plexmediaserver"],"created_at":"2024-12-05T15:16:07.000Z","updated_at":"2026-01-07T03:34:17.399Z","avatar_url":"https://github.com/cilindrox.png","language":"HTML","readme":"# Plex Prometheus Exporter\n\nThis repo installs an instance of Plex Media Server (PMS) [running in\nKubernetes][pms-docker] alongside of the Prometheus stack and a dashboard with\nPMS metrics in Grafana.\n\n## Setup\n\nThis section goes step-by-step into the cluster setup and configuration. Make\nsure you've set up and are running the following:\n\n- Kubernetes \u003e=1.19\n- Helm v2\n\n### Install Prometheus and Grafana\n\nThe Prometheus and Grafana are installed from the community charts:\n\n```bash\nhelm init --client-only --skip-repos\nhelm repo add prometheus-community https://prometheus-community.github.io/helm-charts\nhelm repo add grafana https://grafana.github.io/helm-charts\nhelm repo update\n```\n\u003e *NOTE*: it's highly recommended to run a [\"Tillerless Helm\"][tillerless] when\n\u003e using Helm v2\n\n```bash\n# Assumes tiller is on $PATH, otherwise you'll need to download Helm \u0026 Tiller binaries\ntiller\u0026\n\n# Helm will use the local running tiller instance.\nexport HELM_HOST=localhost:44134\n```\n\n```bash\n# This will create two namespaces, \"infra\" and \"plex\" that will be used to\n# install the Prometheus stack and PMS respectively.\nkubectl apply -f bootstrap\n\nhelm upgrade --install prom --namespace infra prometheus-community/prometheus \\\n  --wait \\\n  -f prometheus.yaml\n\n# Note: using version 5.x of the chart here, latest with support for Helm 2\n# this is not required if using Helm \u003e=3.4\nhelm upgrade --install grafana --namespace infra grafana/grafana \\\n  --version 5.8.16 \\\n  --wait \\\n  -f grafana.yaml \\\n  --set adminPassword=\"$(openssl rand 12 -base64)\"\n```\n\n### Accessing the Prometheus instance\n\n```bash\nexport POD_NAME=$(kubectl get pods --namespace infra -l \"app=prometheus,component=server\" -o jsonpath=\"{.items[0].metadata.name}\")\nkubectl --namespace infra port-forward $POD_NAME 9090:9090\n```\n\n### Accessing the Grafana instance\n\n```bash\nexport POD_NAME=$(kubectl get pods --namespace infra -l \"app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana\" -o jsonpath=\"{.items[0].metadata.name}\")\nkubectl --namespace infra port-forward $POD_NAME 3000:3000\n```\n\n## Installing PMS and claiming the server\n\nPMS must be connected to a [plex.tv](https://plex.tv) account. Once the\ntemporary token has been issued, you can install and claim the server using the\nincluded [kube-plex chart](./charts/kube-plex).\n\nThis chart is a copy of [munnerz/kube-plex] with the addition of a `/media`\nvolume, ie:\n\n```patch\ndiff --git a/charts/kube-plex/templates/deployment.yaml b/charts/kube-plex/templates/deployment.yaml\nindex eafe64b..d9a924a 100644\n--- a/charts/kube-plex/templates/deployment.yaml\n+++ b/charts/kube-plex/templates/deployment.yaml\n@@ -154,6 +154,10 @@ spec:\n         - mountPath: \"/data-{{ .name }}\"\n           name: \"extradata-{{ .name }}\"\n         {{- end }}\n+        {{- if .Values.persistence.hostVolume }}\n+        - name: media\n+          mountPath: /media\n+        {{- end }}\n         - name: shared\n           mountPath: /shared\n         resources:\n@@ -199,6 +203,11 @@ spec:\n {{- end }}\n       - name: shared\n         emptyDir: {}\n+      {{- if .Values.persistence.hostVolume }}\n+      - name: media\n+        hostPath:\n+          path: {{ .Values.persistence.hostVolume }}\n+      {{ end }}\n     {{- with .Values.affinity }}\n       affinity:\n {{ toYaml . | indent 8 }}\n```\n\n\u003e **NOTE**: the above git patch can be applied to any existing copies of the\n\u003e kube-plex chart.\n\nThis approach is mainly a workaround for a couple of [existing issues in \nMinikube][minikube-mounts], which results in empty bind mounts when using kvm as\nthe driver.\n\n```bash\nhelm diff upgrade --install plex ./charts/kube-plex \\\n  --namespace plex \\\n  -f kube-plex.yaml \\\n  --set 'claimToken=MY_CLAIM' \\\n  --set 'persistence.hostVolume=/hosthome/music'\n```\n\nThe same can be accomplished with Helm 3.1+ via [a post-render\nhook][helm-post-render] that [applies a kustomization][kustomize-post].\n\n\n### PMS metrics exporter\n\nA [chart is included](./charts/plex_exporter) for exposing PMS metrics in\nprometheus format.\n\n```bash\nhelm upgrade --install \\\n  --namespace plex  \\\n  exporter ./charts/plex_exporter \\\n  --set 'server.token=MY-TOKEN'\n```\n\nAlternatively, the exporter can be added as a sidecar to existing chart, but\nsince it requires a server token to auth against the api which can only be\nobtained once the server is up and running, I went for running it on its own\nchart.\n\n[helm-post-render]: https://helm.sh/docs/topics/advanced/#post-rendering\n[kustomize-post]: https://github.com/thomastaylor312/advanced-helm-demos/tree/master/post-render\n[minikube-mounts]: https://github.com/kubernetes/minikube/issues/3973\n[munnerz/kube-plex]: https://github.com/munnerz/kube-plex/tree/master/charts/kube-plex\n[pms-docker]: https://github.com/plexinc/pms-docker\n[tillerless]: https://rimusz.net/tillerless-helm\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcilindrox%2Fplex-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcilindrox%2Fplex-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcilindrox%2Fplex-exporter/lists"}