psyinfra / prometheus-eaton-ups-exporter

A Prometheus exporter for (some) Eaton UPSs
ISC License
11 stars 5 forks source link

exporter returns error when a UPS is unreachable #13

Closed aqw closed 3 years ago

aqw commented 3 years ago

I am monitoring three UPSs. When one became unavailable (the network between the exporter and one of the UPSs went down), the exporter waited for 7 seconds and then returns this following error:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <title>Error response</title>
    </head>
    <body>
        <h1>Error response</h1>
        <p>Error code: 500</p>
        <p>Message: error generating metric output.</p>
        <p>Error code explanation: 500 - Server got itself in trouble.</p>
    </body>
</html>

It would be preferable if the exporter had an overall timeout (5-10 seconds), and any UPS that has responded by then is included in the metric output. That way one unreachable UPS doesn't halt reporting for all others. This feature would likely require #3.

mathisloevenich commented 3 years ago

Alright, I'll have a look.

mathisloevenich commented 3 years ago

Can be closed according to #17