From 13acdd4c657c4774a2b51ae323b43723fddfbc15 Mon Sep 17 00:00:00 2001 From: Joseph Benguira Date: Wed, 12 Jan 2022 10:12:12 +0200 Subject: [PATCH 1/2] Fix for issue in logs This fix address the issue described here: https://github.com/louislam/uptime-kuma/issues/1024 --- server/prometheus.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/prometheus.js b/server/prometheus.js index 870581d2e..e53dee5ca 100644 --- a/server/prometheus.js +++ b/server/prometheus.js @@ -60,7 +60,9 @@ class Prometheus { } try { - monitor_cert_days_remaining.set(this.monitorLabelValues, tlsInfo.certInfo.daysRemaining); + if ( tlsInfo.certInfo != null ){ + monitor_cert_days_remaining.set(this.monitorLabelValues, tlsInfo.certInfo.daysRemaining); + } } catch (e) { console.error(e); } From 3b9fac29421e36d1d4f7e399248f5dfedf57f59d Mon Sep 17 00:00:00 2001 From: Joseph Benguira Date: Fri, 14 Jan 2022 08:51:45 +0200 Subject: [PATCH 2/2] Update server/prometheus.js removed useless spaces Co-authored-by: Adam Stachowicz --- server/prometheus.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/prometheus.js b/server/prometheus.js index e53dee5ca..f91b0a13b 100644 --- a/server/prometheus.js +++ b/server/prometheus.js @@ -60,7 +60,7 @@ class Prometheus { } try { - if ( tlsInfo.certInfo != null ){ + if (tlsInfo.certInfo != null) { monitor_cert_days_remaining.set(this.monitorLabelValues, tlsInfo.certInfo.daysRemaining); } } catch (e) {