Add Plex Media Server observability #13

Merged
eblume merged 3 commits from feature/plex-observability into main 2026-01-15 15:27:59 -08:00

3 commits

Author SHA1 Message Date
026026572d Rewrite plex-metrics to use jq for JSON parsing
The grep-based JSON parsing was fragile and broke on nested arrays
(like Location inside Directory). Using jq properly handles the
JSON structure.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 15:26:56 -08:00
9d2d744f34 Fix heredoc EOF marker in plex-metrics script
The EOF marker was on the same line as the library_metrics variable,
causing the heredoc to not close properly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 15:22:26 -08:00
77b34ec523 Add Plex Media Server observability (metrics, logs, dashboard)
- Create plex_metrics ansible role with textfile collector script
- Add Plex log collection to Alloy configuration
- Add Grafana dashboard for Plex server monitoring
- Update indri.yml playbook to include plex_metrics role

Metrics collected:
- plex_up (server health)
- plex_version_info (server version)
- plex_sessions_total/playing/paused (active sessions)
- plex_transcode_sessions_total/video/audio (transcoding)
- plex_library_items{library,type} (library counts)

Requires Plex token stored at ~/.plex-token on indri.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 15:10:20 -08:00