From db275a78dc4a328d080653510676b12707f6a01b Mon Sep 17 00:00:00 2001 From: Leonardo Graboski Veiga Date: Sat, 20 Jan 2024 11:14:40 -0300 Subject: [PATCH] grafana: ignore empty values Ignore empty values so the aggregate looks better. Signed-off-by: Leonardo Graboski Veiga --- TorizonOSBuildStatusGrafana/grafana-config/dashboard.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TorizonOSBuildStatusGrafana/grafana-config/dashboard.json b/TorizonOSBuildStatusGrafana/grafana-config/dashboard.json index 4b4177c..b913a73 100644 --- a/TorizonOSBuildStatusGrafana/grafana-config/dashboard.json +++ b/TorizonOSBuildStatusGrafana/grafana-config/dashboard.json @@ -114,7 +114,7 @@ "type": "influxdb", "uid": "influxdb_jenkins" }, - "query": "from(bucket: \"jenkinsdatabucket\")\n |> range(start: -1h)\n |> filter(fn: (r) => r[\"_measurement\"] == \"jenkinsbuild\")\n |> last()\n |> pivot(rowKey:[\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")\n |> drop(columns: [\"_time\", \"_start\", \"_stop\"])", + "query": "from(bucket: \"jenkinsdatabucket\")\n |> range(start: -1h)\n |> filter(fn: (r) => r[\"_measurement\"] == \"jenkinsbuild\" and r[\"_value\"] != \"\")\n |> last()\n |> pivot(rowKey:[\"_time\"], columnKey: [\"_field\"], valueColumn: \"_value\")\n |> drop(columns: [\"_time\", \"_start\", \"_stop\"])", "refId": "A" } ], @@ -221,7 +221,7 @@ "type": "influxdb", "uid": "influxdb_jenkins" }, - "query": "from(bucket: \"jenkinsdatabucket\")\n |> range(start: -30d)\n |> filter(fn: (r) => r[\"_measurement\"] == \"jenkinsbuild\")\n |> aggregateWindow(every: 1d, fn: first)\n |> map(fn: (r) => ({_time: r._time, _field: r._field, _value: r._value}))\n", + "query": "from(bucket: \"jenkinsdatabucket\")\n |> range(start: -30d)\n |> filter(fn: (r) => r[\"_measurement\"] == \"jenkinsbuild\" and r[\"_value\"] != \"\")\n |> aggregateWindow(every: 1d, fn: first)\n |> map(fn: (r) => ({_time: r._time, _field: r._field, _value: r._value}))\n", "refId": "A" } ],