From 173d63e9d5eac1cf9557c0568ac2f94b584efc88 Mon Sep 17 00:00:00 2001 From: Leonardo Graboski Veiga Date: Sat, 20 Jan 2024 10:14:25 -0300 Subject: [PATCH] data: don't ignore data point when unavailable Ignoring the entire data point when a cURL fails (in other words, when unavailable) leads to a panel with "no data" which is misleading. There actually is data, and maybe it just happens it is "unavailable" to all builds. Or it is unavailable to a single build. To fix this, save the data points even when cURL request fails, and show data as unavailable in the charts. Signed-off-by: Leonardo Graboski Veiga --- .../get-build-status.sh | 4 ++-- .../grafana-config/dashboard.json | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/TorizonOSBuildStatusDataAcquisition/get-build-status.sh b/TorizonOSBuildStatusDataAcquisition/get-build-status.sh index bb50633..2fdf173 100755 --- a/TorizonOSBuildStatusDataAcquisition/get-build-status.sh +++ b/TorizonOSBuildStatusDataAcquisition/get-build-status.sh @@ -47,8 +47,8 @@ function insert_into_influxdb() { buildstatus="${buildstatus}${job}=\"${jobstatus}\"," echo "Element: $job | Value: $jobstatus" else - echo "Element: $job returned an empty value, skipping this data point" - break + echo "Element: $job returned an empty value" + buildstatus="${buildstatus}${job}=\"Unavailable\"," fi done diff --git a/TorizonOSBuildStatusGrafana/grafana-config/dashboard.json b/TorizonOSBuildStatusGrafana/grafana-config/dashboard.json index 2854871..4b4177c 100644 --- a/TorizonOSBuildStatusGrafana/grafana-config/dashboard.json +++ b/TorizonOSBuildStatusGrafana/grafana-config/dashboard.json @@ -60,6 +60,11 @@ "index": 1, "text": "Success" }, + "Unavailable": { + "color": "transparent", + "index": 6, + "text": "-" + }, "Unstable": { "color": "orange", "index": 2, @@ -163,6 +168,11 @@ "index": 1, "text": "Success" }, + "Unavailable": { + "color": "transparent", + "index": 6, + "text": "-" + }, "Unstable": { "color": "orange", "index": 2,