Skip to content

Commit

Permalink
correctly set mssql_up 0 when mssql server is unreacheable (regressio…
Browse files Browse the repository at this point in the history
…n in 1.2.0)
  • Loading branch information
awaragi committed Apr 25, 2022
1 parent 5f71757 commit 27b9532
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ app.get("/metrics", async (req, res) => {
} catch (error) {
// error connecting
appLog("Error handling /metrics request");
mssql_up.set(0);
const mssqlUp = entries.mssql_up.metrics.mssql_up;
mssqlUp.set(0);
res.header("X-Error", error.message || error);
res.send(client.register.getSingleMetricAsString(mssql_up.name));
res.send(client.register.getSingleMetricAsString(mssqlUp.name));
}
});

Expand Down

0 comments on commit 27b9532

Please sign in to comment.