-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retry broker connections? #45
Comments
I see in the code it tries to "connect forever" to the Broker, but I still get left with this in the logs:
The broker is up and running, can connect fine with a client. Just restart the I don't see a way to monitor that its unable to connect as it still publishes stale metrics even though it is unable to connect to broker. Seems the metrics it publishes are just stuck in time. These should drop to zero or become unavailable after some point to allow alerting. The only thing I could think of was to detect the rate of change on messages published is stuck, then generate an alert:
I at least have an alert now, when mosquitto-exporter is not updating metrics, when I check its logs, its not connected, but I can't automate a solution to restart it. Zigbee2MQTT, HomeAssistant, Frigate, etc.... all connecting fine and maintaining connection. Just this exporter having a problem that I can tell. |
Came here to check the same issue 😂 Could it be that the instantiation of the client needs to be repeated (moved into the for loop) after connection fails? |
Is there a way to configure connection retries? I had to bounce the broker and the mosquitto-exporter log ended with:
No sign of a retry, the program doesn't exit out to trigger a container restart policy.
I manually restarted mosquitto-exporter and connected fine.
If the exporter can't connect, it should retry a set number of times and then exit out to allow the restart policy to kick in. Then it becomes a condition that can be monitored and fixed.
The text was updated successfully, but these errors were encountered: