From 5a21156f555a285cf2e52b7176dbae8eabfaa245 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Tue, 9 Jul 2024 17:56:45 +0300 Subject: [PATCH] dashboard: fill with none for configuration status Before this patch, if status is not provided, it was displayed as "0" for InfluxDB panels. Now there will be "No data", same as in other graphs. Follows #231 --- dashboard/panels/cluster.libsonnet | 2 +- tests/InfluxDB/dashboard_custom_compiled.json | 2 +- tests/InfluxDB/dashboard_tarantool3_compiled.json | 2 +- tests/InfluxDB/dashboard_with_custom_panels_compiled.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dashboard/panels/cluster.libsonnet b/dashboard/panels/cluster.libsonnet index 3d0966d..c282db8 100644 --- a/dashboard/panels/cluster.libsonnet +++ b/dashboard/panels/cluster.libsonnet @@ -469,7 +469,7 @@ local prometheus = grafana.prometheus; SELECT "value" as "ready" FROM %(measurement_with_policy)s WHERE ("metric_name" = '%(metric_full_name)s' AND %(ready_filters)s) AND $timeFilter ) - GROUP BY time($__interval), "label_pairs_alias" fill(0) + GROUP BY time($__interval), "label_pairs_alias" fill(none) |||, { metric_full_name: cfg.metrics_prefix + 'tnt_config_status', measurement_with_policy: std.format('%(policy_prefix)s"%(measurement)s"', { diff --git a/tests/InfluxDB/dashboard_custom_compiled.json b/tests/InfluxDB/dashboard_custom_compiled.json index 66debd7..686a6d4 100644 --- a/tests/InfluxDB/dashboard_custom_compiled.json +++ b/tests/InfluxDB/dashboard_custom_compiled.json @@ -253,7 +253,7 @@ } ], "policy": "default", - "query": "SELECT (1 * last(\"uninitialized\") + 2 * last(\"check_errors\") + 3 * last(\"startup_in_progress\") +\n 4 * last(\"reload_in_progress\") + 5 * last(\"check_warnings\") + 6 * last(\"ready\")) as \"status\" FROM\n(\n SELECT \"value\" as \"uninitialized\" FROM \"$measurement\"\n WHERE (\"metric_name\" = 'vendor_tt_tnt_config_status' AND \"label_pairs_alias\" =~ '$alias' AND \"label_pairs_status\" = 'uninitialized' AND \"vendor_app_tag\" = 'MyCacheApplication') AND $timeFilter\n),\n(\n SELECT \"value\" as \"check_errors\" FROM \"$measurement\"\n WHERE (\"metric_name\" = 'vendor_tt_tnt_config_status' AND \"label_pairs_alias\" =~ '$alias' AND \"label_pairs_status\" = 'check_errors' AND \"vendor_app_tag\" = 'MyCacheApplication') AND $timeFilter\n),\n(\n SELECT \"value\" as \"startup_in_progress\" FROM \"$measurement\"\n WHERE (\"metric_name\" = 'vendor_tt_tnt_config_status' AND \"label_pairs_alias\" =~ '$alias' AND \"label_pairs_status\" = 'startup_in_progress' AND \"vendor_app_tag\" = 'MyCacheApplication') AND $timeFilter\n),\n(\n SELECT \"value\" as \"reload_in_progress\" FROM \"$measurement\"\n WHERE (\"metric_name\" = 'vendor_tt_tnt_config_status' AND \"label_pairs_alias\" =~ '$alias' AND \"label_pairs_status\" = 'reload_in_progress' AND \"vendor_app_tag\" = 'MyCacheApplication') AND $timeFilter\n),\n(\n SELECT \"value\" as \"check_warnings\" FROM \"$measurement\"\n WHERE (\"metric_name\" = 'vendor_tt_tnt_config_status' AND \"label_pairs_alias\" =~ '$alias' AND \"label_pairs_status\" = 'check_warnings' AND \"vendor_app_tag\" = 'MyCacheApplication') AND $timeFilter\n),\n(\n SELECT \"value\" as \"ready\" FROM \"$measurement\"\n WHERE (\"metric_name\" = 'vendor_tt_tnt_config_status' AND \"label_pairs_alias\" =~ '$alias' AND \"label_pairs_status\" = 'ready' AND \"vendor_app_tag\" = 'MyCacheApplication') AND $timeFilter\n)\nGROUP BY time($__interval), \"label_pairs_alias\" fill(0)\n", + "query": "SELECT (1 * last(\"uninitialized\") + 2 * last(\"check_errors\") + 3 * last(\"startup_in_progress\") +\n 4 * last(\"reload_in_progress\") + 5 * last(\"check_warnings\") + 6 * last(\"ready\")) as \"status\" FROM\n(\n SELECT \"value\" as \"uninitialized\" FROM \"$measurement\"\n WHERE (\"metric_name\" = 'vendor_tt_tnt_config_status' AND \"label_pairs_alias\" =~ '$alias' AND \"label_pairs_status\" = 'uninitialized' AND \"vendor_app_tag\" = 'MyCacheApplication') AND $timeFilter\n),\n(\n SELECT \"value\" as \"check_errors\" FROM \"$measurement\"\n WHERE (\"metric_name\" = 'vendor_tt_tnt_config_status' AND \"label_pairs_alias\" =~ '$alias' AND \"label_pairs_status\" = 'check_errors' AND \"vendor_app_tag\" = 'MyCacheApplication') AND $timeFilter\n),\n(\n SELECT \"value\" as \"startup_in_progress\" FROM \"$measurement\"\n WHERE (\"metric_name\" = 'vendor_tt_tnt_config_status' AND \"label_pairs_alias\" =~ '$alias' AND \"label_pairs_status\" = 'startup_in_progress' AND \"vendor_app_tag\" = 'MyCacheApplication') AND $timeFilter\n),\n(\n SELECT \"value\" as \"reload_in_progress\" FROM \"$measurement\"\n WHERE (\"metric_name\" = 'vendor_tt_tnt_config_status' AND \"label_pairs_alias\" =~ '$alias' AND \"label_pairs_status\" = 'reload_in_progress' AND \"vendor_app_tag\" = 'MyCacheApplication') AND $timeFilter\n),\n(\n SELECT \"value\" as \"check_warnings\" FROM \"$measurement\"\n WHERE (\"metric_name\" = 'vendor_tt_tnt_config_status' AND \"label_pairs_alias\" =~ '$alias' AND \"label_pairs_status\" = 'check_warnings' AND \"vendor_app_tag\" = 'MyCacheApplication') AND $timeFilter\n),\n(\n SELECT \"value\" as \"ready\" FROM \"$measurement\"\n WHERE (\"metric_name\" = 'vendor_tt_tnt_config_status' AND \"label_pairs_alias\" =~ '$alias' AND \"label_pairs_status\" = 'ready' AND \"vendor_app_tag\" = 'MyCacheApplication') AND $timeFilter\n)\nGROUP BY time($__interval), \"label_pairs_alias\" fill(none)\n", "rawQuery": true, "refId": "A", "resultFormat": "time_series", diff --git a/tests/InfluxDB/dashboard_tarantool3_compiled.json b/tests/InfluxDB/dashboard_tarantool3_compiled.json index cae0491..d1ca12d 100644 --- a/tests/InfluxDB/dashboard_tarantool3_compiled.json +++ b/tests/InfluxDB/dashboard_tarantool3_compiled.json @@ -253,7 +253,7 @@ } ], "policy": "default", - "query": "SELECT (1 * last(\"uninitialized\") + 2 * last(\"check_errors\") + 3 * last(\"startup_in_progress\") +\n 4 * last(\"reload_in_progress\") + 5 * last(\"check_warnings\") + 6 * last(\"ready\")) as \"status\" FROM\n(\n SELECT \"value\" as \"uninitialized\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'uninitialized') AND $timeFilter\n),\n(\n SELECT \"value\" as \"check_errors\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'check_errors') AND $timeFilter\n),\n(\n SELECT \"value\" as \"startup_in_progress\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'startup_in_progress') AND $timeFilter\n),\n(\n SELECT \"value\" as \"reload_in_progress\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'reload_in_progress') AND $timeFilter\n),\n(\n SELECT \"value\" as \"check_warnings\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'check_warnings') AND $timeFilter\n),\n(\n SELECT \"value\" as \"ready\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'ready') AND $timeFilter\n)\nGROUP BY time($__interval), \"label_pairs_alias\" fill(0)\n", + "query": "SELECT (1 * last(\"uninitialized\") + 2 * last(\"check_errors\") + 3 * last(\"startup_in_progress\") +\n 4 * last(\"reload_in_progress\") + 5 * last(\"check_warnings\") + 6 * last(\"ready\")) as \"status\" FROM\n(\n SELECT \"value\" as \"uninitialized\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'uninitialized') AND $timeFilter\n),\n(\n SELECT \"value\" as \"check_errors\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'check_errors') AND $timeFilter\n),\n(\n SELECT \"value\" as \"startup_in_progress\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'startup_in_progress') AND $timeFilter\n),\n(\n SELECT \"value\" as \"reload_in_progress\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'reload_in_progress') AND $timeFilter\n),\n(\n SELECT \"value\" as \"check_warnings\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'check_warnings') AND $timeFilter\n),\n(\n SELECT \"value\" as \"ready\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'ready') AND $timeFilter\n)\nGROUP BY time($__interval), \"label_pairs_alias\" fill(none)\n", "rawQuery": true, "refId": "A", "resultFormat": "time_series", diff --git a/tests/InfluxDB/dashboard_with_custom_panels_compiled.json b/tests/InfluxDB/dashboard_with_custom_panels_compiled.json index 116b264..c57b69b 100644 --- a/tests/InfluxDB/dashboard_with_custom_panels_compiled.json +++ b/tests/InfluxDB/dashboard_with_custom_panels_compiled.json @@ -253,7 +253,7 @@ } ], "policy": "default", - "query": "SELECT (1 * last(\"uninitialized\") + 2 * last(\"check_errors\") + 3 * last(\"startup_in_progress\") +\n 4 * last(\"reload_in_progress\") + 5 * last(\"check_warnings\") + 6 * last(\"ready\")) as \"status\" FROM\n(\n SELECT \"value\" as \"uninitialized\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'uninitialized') AND $timeFilter\n),\n(\n SELECT \"value\" as \"check_errors\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'check_errors') AND $timeFilter\n),\n(\n SELECT \"value\" as \"startup_in_progress\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'startup_in_progress') AND $timeFilter\n),\n(\n SELECT \"value\" as \"reload_in_progress\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'reload_in_progress') AND $timeFilter\n),\n(\n SELECT \"value\" as \"check_warnings\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'check_warnings') AND $timeFilter\n),\n(\n SELECT \"value\" as \"ready\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'ready') AND $timeFilter\n)\nGROUP BY time($__interval), \"label_pairs_alias\" fill(0)\n", + "query": "SELECT (1 * last(\"uninitialized\") + 2 * last(\"check_errors\") + 3 * last(\"startup_in_progress\") +\n 4 * last(\"reload_in_progress\") + 5 * last(\"check_warnings\") + 6 * last(\"ready\")) as \"status\" FROM\n(\n SELECT \"value\" as \"uninitialized\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'uninitialized') AND $timeFilter\n),\n(\n SELECT \"value\" as \"check_errors\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'check_errors') AND $timeFilter\n),\n(\n SELECT \"value\" as \"startup_in_progress\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'startup_in_progress') AND $timeFilter\n),\n(\n SELECT \"value\" as \"reload_in_progress\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'reload_in_progress') AND $timeFilter\n),\n(\n SELECT \"value\" as \"check_warnings\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'check_warnings') AND $timeFilter\n),\n(\n SELECT \"value\" as \"ready\" FROM \"$policy\".\"$measurement\"\n WHERE (\"metric_name\" = 'tnt_config_status' AND \"label_pairs_alias\" =~ /^$alias$/ AND \"label_pairs_status\" = 'ready') AND $timeFilter\n)\nGROUP BY time($__interval), \"label_pairs_alias\" fill(none)\n", "rawQuery": true, "refId": "A", "resultFormat": "time_series",