Open bnjns opened 1 year ago
I faced this issue with Kubernetes as well (thanks for even bringing this up.. I couldn't figure out why I wasn't getting playback metrics). The problem is a little harder to solve here because k8s doesn't really have a concept of dependencies. If you have more than one container in a pod they are always started simultaneously and there are longstanding issues regarding this problem open on the k8s project.
Regardless, for kubernetes, I managed to fix this with a healthcheck of sorts:
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c", "if ! wget -O- --no-check-certificate 127.0.0.1:32400/web; then reboot; fi"]
This goes in the spec for the exporter container and seems to be working well. All this does is reach out the the plex server and reboot the exporter container if the plex server isn't ready yet.
First of all, thanks so much for building this - love being able to monitor my plex server from Grafana!
I think this is related to the TODO in
listener.go
, but if you start the exporter before plex is ready then it fails to connect and doesn't retry, meaning you have to manually restart the exporter in order to then get metrics.I'm using Docker to run plex, the exporter, and the grafana agent. I've tried to mitigate by adding health checks to plex and configuring the exporter with a
depends_on
but it appears that's not enough when the computer starts up. Easily rectified withdocker-compose restart exporter
but I'd rather not have to remember to run this every day!