@@ -62,13 +62,12 @@ data:
6262 "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
6363 "fieldConfig": {
6464 "defaults": {
65- "color": { "mode": "thresholds " },
65+ "color": { "mode": "fixed", "fixedColor": "green " },
6666 "mappings": [],
6767 "thresholds": {
6868 "mode": "absolute",
6969 "steps": [
70- { "color": "green", "value": null },
71- { "color": "red", "value": 1 }
70+ { "color": "green", "value": null }
7271 ]
7372 },
7473 "unit": "short"
8988 "targets": [
9089 {
9190 "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
92- "expr": "count(bootchain_dependencies_total{namespace=~\"$namespace\"})",
91+ "expr": "count(bootchain_dependencies_total{namespace=~\"$namespace\"}) or vector(0) ",
9392 "instant": true,
9493 "legendFormat": "",
9594 "refId": "A"
@@ -107,8 +106,7 @@ data:
107106 "thresholds": {
108107 "mode": "absolute",
109108 "steps": [
110- { "color": "red", "value": null },
111- { "color": "green", "value": 1 }
109+ { "color": "green", "value": null }
112110 ]
113111 },
114112 "unit": "short"
@@ -129,7 +127,7 @@ data:
129127 "targets": [
130128 {
131129 "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
132- "expr": "sum(bootchain_dependencies_ready{namespace=~\"$namespace\"})",
130+ "expr": "sum(bootchain_dependencies_ready{namespace=~\"$namespace\"}) or vector(0) ",
133131 "instant": true,
134132 "legendFormat": "",
135133 "refId": "A"
@@ -148,8 +146,7 @@ data:
148146 "mode": "absolute",
149147 "steps": [
150148 { "color": "green", "value": null },
151- { "color": "yellow", "value": 1 },
152- { "color": "red", "value": 5 }
149+ { "color": "red", "value": 1 }
153150 ]
154151 },
155152 "unit": "short"
@@ -170,7 +167,7 @@ data:
170167 "targets": [
171168 {
172169 "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
173- "expr": "sum(bootchain_dependencies_total{namespace=~\"$namespace\"}) - sum(bootchain_dependencies_ready{namespace=~\"$namespace\"})",
170+ "expr": "( sum(bootchain_dependencies_total{namespace=~\"$namespace\"}) or vector(0)) - ( sum(bootchain_dependencies_ready{namespace=~\"$namespace\"}) or vector(0) )",
174171 "instant": true,
175172 "legendFormat": "",
176173 "refId": "A"
@@ -184,7 +181,9 @@ data:
184181 "fieldConfig": {
185182 "defaults": {
186183 "color": { "mode": "thresholds" },
187- "mappings": [],
184+ "mappings": [
185+ { "options": { "match": "null", "result": { "color": "green", "index": 0, "text": "0%" } }, "type": "special" }
186+ ],
188187 "thresholds": {
189188 "mode": "absolute",
190189 "steps": [
@@ -201,7 +200,7 @@ data:
201200 "id": 4,
202201 "options": {
203202 "colorMode": "background",
204- "graphMode": "area ",
203+ "graphMode": "none ",
205204 "justifyMode": "auto",
206205 "orientation": "auto",
207206 "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false },
@@ -211,8 +210,8 @@ data:
211210 "targets": [
212211 {
213212 "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
214- "expr": "rate(bootchain_reconcile_total{result=\"error\"}[$__rate_interval]) / rate(bootchain_reconcile_total[$__rate_interval] )",
215- "instant": false ,
213+ "expr": "(sum( rate(bootchain_reconcile_total{result=\"error\"}[5m])) or vector(0)) / ((sum( rate(bootchain_reconcile_total[5m])) or vector(0)) > 0 )",
214+ "instant": true ,
216215 "legendFormat": "",
217216 "refId": "A"
218217 }
@@ -388,10 +387,36 @@ data:
388387 }
389388 },
390389 "overrides": [
391- { "matcher": { "id": "byName", "options": "namespace" }, "properties": [{ "id": "custom.width", "value": 120 }] },
392- { "matcher": { "id": "byName", "options": "name" }, "properties": [{ "id": "custom.width", "value": 200 }] },
393- { "matcher": { "id": "byName", "options": "ready" }, "properties": [{ "id": "custom.width", "value": 80 }] },
394- { "matcher": { "id": "byName", "options": "total" }, "properties": [{ "id": "custom.width", "value": 70 }] }
390+ { "matcher": { "id": "byName", "options": "namespace" }, "properties": [{ "id": "custom.width", "value": 160 }] },
391+ { "matcher": { "id": "byName", "options": "name" }, "properties": [{ "id": "custom.width", "value": 220 }] },
392+ {
393+ "matcher": { "id": "byName", "options": "ready" },
394+ "properties": [
395+ { "id": "custom.width", "value": 80 },
396+ { "id": "custom.cellOptions", "value": { "type": "auto" } }
397+ ]
398+ },
399+ {
400+ "matcher": { "id": "byName", "options": "total" },
401+ "properties": [
402+ { "id": "custom.width", "value": 80 },
403+ { "id": "custom.cellOptions", "value": { "type": "auto" } }
404+ ]
405+ },
406+ {
407+ "matcher": { "id": "byName", "options": "Value #A" },
408+ "properties": [
409+ { "id": "displayName", "value": "ready" },
410+ { "id": "custom.width", "value": 80 }
411+ ]
412+ },
413+ {
414+ "matcher": { "id": "byName", "options": "Value #B" },
415+ "properties": [
416+ { "id": "displayName", "value": "total" },
417+ { "id": "custom.width", "value": 80 }
418+ ]
419+ }
395420 ]
396421 },
397422 "gridPos": { "h": 8, "w": 24, "x": 0, "y": 14 },
@@ -404,53 +429,57 @@ data:
404429 },
405430 "pluginVersion": "10.0.0",
406431 "targets": [
407- {
408- "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
409- "expr": "label_replace(\n bootchain_dependencies_ready{namespace=~\"$namespace\", name=~\"$bootdependency\"}\n == bootchain_dependencies_total{namespace=~\"$namespace\", name=~\"$bootdependency\"},\n \"status\", \"1\", \"\", \"\"\n) or label_replace(\n bootchain_dependencies_ready{namespace=~\"$namespace\", name=~\"$bootdependency\"}\n != bootchain_dependencies_total{namespace=~\"$namespace\", name=~\"$bootdependency\"},\n \"status\", \"0\", \"\", \"\"\n)",
410- "format": "table",
411- "instant": true,
412- "legendFormat": "",
413- "refId": "A"
414- },
415432 {
416433 "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
417434 "expr": "bootchain_dependencies_ready{namespace=~\"$namespace\", name=~\"$bootdependency\"}",
418435 "format": "table",
419436 "instant": true,
420437 "legendFormat": "",
421- "refId": "B "
438+ "refId": "A "
422439 },
423440 {
424441 "datasource": { "type": "prometheus", "uid": "${DS_PROMETHEUS}" },
425442 "expr": "bootchain_dependencies_total{namespace=~\"$namespace\", name=~\"$bootdependency\"}",
426443 "format": "table",
427444 "instant": true,
428445 "legendFormat": "",
429- "refId": "C "
446+ "refId": "B "
430447 }
431448 ],
432449 "title": "BootDependency Status Table",
433450 "transformations": [
434- { "id": "joinByField", "options": { "byField": "name", "mode": "outer" } },
451+ {
452+ "id": "joinByLabels",
453+ "options": { "labels": ["namespace", "name"] }
454+ },
435455 {
436456 "id": "organize",
437457 "options": {
438- "excludeByName": {
439- "Time": true, "Time 1": true, "Time 2": true, "Time 3": true,
440- "namespace 2": true, "namespace 3": true,
441- "__name__ 1": true, "__name__ 2": true, "__name__ 3": true,
442- "job 1": true, "job 2": true, "job 3": true,
443- "instance 1": true, "instance 2": true, "instance 3": true,
444- "status": true
458+ "excludeByName": {},
459+ "indexByName": {
460+ "namespace": 0,
461+ "name": 1,
462+ "Value #A": 2,
463+ "Value #B": 3
445464 },
446465 "renameByName": {
447- "namespace 1": "namespace",
448- "name": "name",
449- "Value #B": "ready",
450- "Value #C": "total",
451- "Value #A": "all_ready"
466+ "Value #A": "ready",
467+ "Value #B": "total"
452468 }
453469 }
470+ },
471+ {
472+ "id": "calculateField",
473+ "options": {
474+ "alias": "status",
475+ "binary": {
476+ "left": "ready",
477+ "operator": "==",
478+ "right": "total"
479+ },
480+ "mode": "reduceRow",
481+ "reduce": { "reducer": "sum" }
482+ }
454483 }
455484 ],
456485 "type": "table"
@@ -751,8 +780,8 @@ data:
751780 "time": { "from": "now-1h", "to": "now" },
752781 "timepicker": {},
753782 "timezone": "browser",
754- "title": "bootchain-operator ",
783+ "title": "Bootchain Operator ",
755784 "uid": "bootchain-operator-v1",
756- "version": 1
785+ "version": 3
757786 }
758787{{- end }}
0 commit comments