Skip to content

Commit

Permalink
dashboard: fill with none for configuration status
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DifferentialOrange committed Jul 10, 2024
1 parent d5e540c commit 5cf067e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dashboard/panels/cluster.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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"', {
Expand Down
2 changes: 1 addition & 1 deletion tests/InfluxDB/dashboard_custom_compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/InfluxDB/dashboard_tarantool3_compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/InfluxDB/dashboard_with_custom_panels_compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 5cf067e

Please sign in to comment.