[openstack-exporter-k8s] Correct the Ceph dectect variable in dashboard
The query for `Ceph Shared Storage` variable returned both values 0 and 1 when a shared Ceph config is detected, since the `or` operator in promql returns both values when evaluating between two terms that both have data. This can be simply fixed by wrapping a max() around the expression. Change-Id: Idb64b57185020f8b38b540e501fd2e01b180b247 Signed-off-by: Quang Ngo <quang.ngo@canonical.com>
This commit is contained in:
@@ -1682,7 +1682,7 @@
|
|||||||
"datasource": {
|
"datasource": {
|
||||||
"uid": "${prometheusds}"
|
"uid": "${prometheusds}"
|
||||||
},
|
},
|
||||||
"definition": "query_result(((ceph_cluster_total_bytes or vector(0) > bool(0)) * scalar(stddev(openstack_nova_local_storage_available_bytes) < bool(1e8)) * scalar(abs(sum(ceph_cluster_total_bytes or vector(0)) - max(openstack_nova_local_storage_available_bytes)) < bool(5e9))))",
|
"definition": "query_result(max(((ceph_cluster_total_bytes or vector(0)) > bool(0)) * scalar(stddev(openstack_nova_local_storage_available_bytes) < bool(1e8)) * scalar(abs(sum(ceph_cluster_total_bytes or vector(0)) - max(openstack_nova_local_storage_available_bytes)) < bool(5e9))))",
|
||||||
"description": "Detect if Ceph is used as shared backend storage (no ephemeral available)",
|
"description": "Detect if Ceph is used as shared backend storage (no ephemeral available)",
|
||||||
"error": null,
|
"error": null,
|
||||||
"hide": 0,
|
"hide": 0,
|
||||||
@@ -1692,7 +1692,7 @@
|
|||||||
"name": "ceph_without_ephemeral",
|
"name": "ceph_without_ephemeral",
|
||||||
"options": [],
|
"options": [],
|
||||||
"query": {
|
"query": {
|
||||||
"query": "query_result(((ceph_cluster_total_bytes or vector(0) > bool(0)) * scalar(stddev(openstack_nova_local_storage_available_bytes) < bool(1e8)) * scalar(abs(sum(ceph_cluster_total_bytes or vector(0)) - max(openstack_nova_local_storage_available_bytes)) < bool(5e9))))",
|
"query": "query_result(max(((ceph_cluster_total_bytes or vector(0)) > bool(0)) * scalar(stddev(openstack_nova_local_storage_available_bytes) < bool(1e8)) * scalar(abs(sum(ceph_cluster_total_bytes or vector(0)) - max(openstack_nova_local_storage_available_bytes)) < bool(5e9))))",
|
||||||
"refId": "${prometheusds}-ceph_without_ephemeral-Variable-Query"
|
"refId": "${prometheusds}-ceph_without_ephemeral-Variable-Query"
|
||||||
},
|
},
|
||||||
"refresh": 1,
|
"refresh": 1,
|
||||||
|
@@ -2378,7 +2378,7 @@
|
|||||||
"datasource": {
|
"datasource": {
|
||||||
"uid": "${prometheusds}"
|
"uid": "${prometheusds}"
|
||||||
},
|
},
|
||||||
"definition": "query_result(((ceph_cluster_total_bytes or vector(0) > bool(0)) * scalar(stddev(openstack_nova_local_storage_available_bytes) < bool(1e8)) * scalar(abs(sum(ceph_cluster_total_bytes or vector(0)) - max(openstack_nova_local_storage_available_bytes)) < bool(5e9))))",
|
"definition": "query_result(max(((ceph_cluster_total_bytes or vector(0)) > bool(0)) * scalar(stddev(openstack_nova_local_storage_available_bytes) < bool(1e8)) * scalar(abs(sum(ceph_cluster_total_bytes or vector(0)) - max(openstack_nova_local_storage_available_bytes)) < bool(5e9))))",
|
||||||
"description": "Detect if Ceph is used as shared backend storage (no ephemeral available)",
|
"description": "Detect if Ceph is used as shared backend storage (no ephemeral available)",
|
||||||
"error": null,
|
"error": null,
|
||||||
"hide": 0,
|
"hide": 0,
|
||||||
@@ -2388,7 +2388,7 @@
|
|||||||
"name": "ceph_without_ephemeral",
|
"name": "ceph_without_ephemeral",
|
||||||
"options": [],
|
"options": [],
|
||||||
"query": {
|
"query": {
|
||||||
"query": "query_result(((ceph_cluster_total_bytes or vector(0) > bool(0)) * scalar(stddev(openstack_nova_local_storage_available_bytes) < bool(1e8)) * scalar(abs(sum(ceph_cluster_total_bytes or vector(0)) - max(openstack_nova_local_storage_available_bytes)) < bool(5e9))))",
|
"query": "query_result(max(((ceph_cluster_total_bytes or vector(0)) > bool(0)) * scalar(stddev(openstack_nova_local_storage_available_bytes) < bool(1e8)) * scalar(abs(sum(ceph_cluster_total_bytes or vector(0)) - max(openstack_nova_local_storage_available_bytes)) < bool(5e9))))",
|
||||||
"refId": "${prometheusds}-ceph_without_ephemeral-Variable-Query"
|
"refId": "${prometheusds}-ceph_without_ephemeral-Variable-Query"
|
||||||
},
|
},
|
||||||
"refresh": 1,
|
"refresh": 1,
|
||||||
|
Reference in New Issue
Block a user