Add new variable to filter by exported namespace.

Edit definition of namespace variable to use grafana custom promql function `label_values`.
Rename variable namespace to operator_namespace.
Rename variable exported_namespace to namespace

Signed-off-by: Daniel AguadoAraujo <daniel.aguadoaraujo@gfk.com>
pull/2062/head
Daniel AguadoAraujo 3 years ago
parent 789aa322f1
commit 80cf5fa729

@ -15,7 +15,7 @@
"editable": true, "editable": true,
"gnetId": null, "gnetId": null,
"graphTooltip": 0, "graphTooltip": 0,
"iteration": 1602679512025, "iteration": 1636369574387,
"links": [], "links": [],
"panels": [ "panels": [
{ {
@ -23,7 +23,6 @@
"description": "", "description": "",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {},
"decimals": 0, "decimals": 0,
"mappings": [], "mappings": [],
"thresholds": { "thresholds": {
@ -62,12 +61,14 @@
"fields": "", "fields": "",
"values": false "values": false
}, },
"text": {},
"textMode": "value" "textMode": "value"
}, },
"pluginVersion": "7.2.1", "pluginVersion": "7.5.5",
"targets": [ "targets": [
{ {
"expr": "count(gotk_reconcile_condition{namespace=~\"$namespace\",type=\"Ready\",status=\"True\",kind=~\"Kustomization|HelmRelease\"})\n-\nsum(gotk_reconcile_condition{namespace=~\"$namespace\",type=\"Ready\",status=\"Deleted\",kind=~\"Kustomization|HelmRelease\"})", "exemplar": true,
"expr": "count(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"True\",kind=~\"Kustomization|HelmRelease\"})\n-\nsum(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"Deleted\",kind=~\"Kustomization|HelmRelease\"})",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"refId": "A" "refId": "A"
@ -83,7 +84,6 @@
"description": "", "description": "",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {},
"decimals": 0, "decimals": 0,
"mappings": [], "mappings": [],
"thresholds": { "thresholds": {
@ -118,12 +118,14 @@
"fields": "", "fields": "",
"values": false "values": false
}, },
"text": {},
"textMode": "value" "textMode": "value"
}, },
"pluginVersion": "7.2.1", "pluginVersion": "7.5.5",
"targets": [ "targets": [
{ {
"expr": "sum(gotk_reconcile_condition{namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"Kustomization|HelmRelease\"})", "exemplar": true,
"expr": "sum(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"Kustomization|HelmRelease\"})",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"refId": "A" "refId": "A"
@ -139,7 +141,6 @@
"description": "", "description": "",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {},
"decimals": 0, "decimals": 0,
"mappings": [], "mappings": [],
"thresholds": { "thresholds": {
@ -178,12 +179,14 @@
"fields": "", "fields": "",
"values": false "values": false
}, },
"text": {},
"textMode": "value" "textMode": "value"
}, },
"pluginVersion": "7.2.1", "pluginVersion": "7.5.5",
"targets": [ "targets": [
{ {
"expr": "count(gotk_reconcile_condition{namespace=~\"$namespace\",type=\"Ready\",status=\"True\",kind=~\"GitRepository|HelmRepository|Bucket\"})\n-\nsum(gotk_reconcile_condition{namespace=~\"$namespace\",type=\"Ready\",status=\"Deleted\",kind=~\"GitRepository|HelmRepository|Bucket\"})", "exemplar": true,
"expr": "count(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"True\",kind=~\"GitRepository|HelmRepository|Bucket\"})\n-\nsum(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"Deleted\",kind=~\"GitRepository|HelmRepository|Bucket\"})",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"refId": "A" "refId": "A"
@ -199,7 +202,6 @@
"description": "", "description": "",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {},
"decimals": 0, "decimals": 0,
"mappings": [], "mappings": [],
"thresholds": { "thresholds": {
@ -234,12 +236,14 @@
"fields": "", "fields": "",
"values": false "values": false
}, },
"text": {},
"textMode": "value" "textMode": "value"
}, },
"pluginVersion": "7.2.1", "pluginVersion": "7.5.5",
"targets": [ "targets": [
{ {
"expr": "sum(gotk_reconcile_condition{namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"GitRepository|HelmRepository|Bucket\"})", "exemplar": true,
"expr": "sum(gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"GitRepository|HelmRepository|Bucket\"})",
"interval": "", "interval": "",
"legendFormat": "", "legendFormat": "",
"refId": "A" "refId": "A"
@ -255,7 +259,6 @@
"description": "", "description": "",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {},
"mappings": [], "mappings": [],
"thresholds": { "thresholds": {
"mode": "absolute", "mode": "absolute",
@ -295,12 +298,14 @@
"fields": "", "fields": "",
"values": false "values": false
}, },
"showUnfilled": true "showUnfilled": true,
"text": {}
}, },
"pluginVersion": "7.2.1", "pluginVersion": "7.5.5",
"targets": [ "targets": [
{ {
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind)", "exemplar": true,
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind)",
"interval": "", "interval": "",
"legendFormat": "{{kind}}", "legendFormat": "{{kind}}",
"refId": "A" "refId": "A"
@ -316,7 +321,6 @@
"description": "", "description": "",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {
"custom": {},
"mappings": [], "mappings": [],
"thresholds": { "thresholds": {
"mode": "absolute", "mode": "absolute",
@ -356,12 +360,14 @@
"fields": "", "fields": "",
"values": false "values": false
}, },
"showUnfilled": true "showUnfilled": true,
"text": {}
}, },
"pluginVersion": "7.2.1", "pluginVersion": "7.5.5",
"targets": [ "targets": [
{ {
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind)", "exemplar": true,
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind)",
"interval": "", "interval": "",
"legendFormat": "{{kind}}", "legendFormat": "{{kind}}",
"refId": "A" "refId": "A"
@ -456,10 +462,11 @@
"options": { "options": {
"showHeader": true "showHeader": true
}, },
"pluginVersion": "7.2.1", "pluginVersion": "7.5.5",
"targets": [ "targets": [
{ {
"expr": "gotk_reconcile_condition{namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"Kustomization|HelmRelease\"}", "exemplar": true,
"expr": "gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"Kustomization|HelmRelease\"}",
"format": "table", "format": "table",
"instant": true, "instant": true,
"interval": "", "interval": "",
@ -478,17 +485,17 @@
"Time": true, "Time": true,
"__name__": true, "__name__": true,
"app": true, "app": true,
"container": true,
"endpoint": true,
"exported_namespace": true,
"instance": true, "instance": true,
"job": true, "job": true,
"kubernetes_namespace": true, "kubernetes_namespace": true,
"kubernetes_pod_name": true, "kubernetes_pod_name": true,
"pod": true,
"pod_template_hash": true, "pod_template_hash": true,
"status": true, "status": true,
"type": true, "type": true
"pod": true,
"container": true,
"endpoint": true,
"exported_namespace": true
}, },
"indexByName": {}, "indexByName": {},
"renameByName": { "renameByName": {
@ -572,10 +579,11 @@
"options": { "options": {
"showHeader": true "showHeader": true
}, },
"pluginVersion": "7.2.1", "pluginVersion": "7.5.5",
"targets": [ "targets": [
{ {
"expr": "gotk_reconcile_condition{namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"GitRepository|HelmRepository|Bucket\"}", "exemplar": true,
"expr": "gotk_reconcile_condition{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",type=\"Ready\",status=\"False\",kind=~\"GitRepository|HelmRepository|Bucket\"}",
"format": "table", "format": "table",
"instant": true, "instant": true,
"interval": "", "interval": "",
@ -594,24 +602,24 @@
"Time": true, "Time": true,
"__name__": true, "__name__": true,
"app": true, "app": true,
"container": true,
"endpoint": true,
"exported_namespace": true,
"instance": true, "instance": true,
"job": true, "job": true,
"kubernetes_namespace": true, "kubernetes_namespace": true,
"kubernetes_pod_name": true, "kubernetes_pod_name": true,
"pod_template_hash": true,
"pod": true, "pod": true,
"pod_template_hash": true,
"status": true, "status": true,
"type": true, "type": true
"container": true,
"endpoint": true,
"exported_namespace": true
}, },
"indexByName": {}, "indexByName": {},
"renameByName": { "renameByName": {
"Value": "Status", "Value": "Status",
"kind": "Kind", "kind": "Kind",
"namespace": "Namespace", "name": "Name",
"name": "Name" "namespace": "Namespace"
} }
} }
} }
@ -640,9 +648,7 @@
"datasource": "${DS_PROMETHEUS}", "datasource": "${DS_PROMETHEUS}",
"description": "", "description": "",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {},
"custom": {}
},
"overrides": [] "overrides": []
}, },
"fill": 1, "fill": 1,
@ -675,7 +681,7 @@
"alertThreshold": true "alertThreshold": true
}, },
"percentage": false, "percentage": false,
"pluginVersion": "7.2.1", "pluginVersion": "7.5.5",
"pointradius": 2, "pointradius": 2,
"points": false, "points": false,
"renderer": "flot", "renderer": "flot",
@ -685,7 +691,8 @@
"steppedLine": false, "steppedLine": false,
"targets": [ "targets": [
{ {
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind, name)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind, name)", "exemplar": true,
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind, name)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"Kustomization|HelmRelease\"}[5m])) by (kind, name)",
"hide": false, "hide": false,
"interval": "", "interval": "",
"legendFormat": "{{kind}}/{{name}}", "legendFormat": "{{kind}}/{{name}}",
@ -741,9 +748,7 @@
"datasource": "${DS_PROMETHEUS}", "datasource": "${DS_PROMETHEUS}",
"description": "", "description": "",
"fieldConfig": { "fieldConfig": {
"defaults": { "defaults": {},
"custom": {}
},
"overrides": [] "overrides": []
}, },
"fill": 1, "fill": 1,
@ -776,7 +781,7 @@
"alertThreshold": true "alertThreshold": true
}, },
"percentage": false, "percentage": false,
"pluginVersion": "7.2.1", "pluginVersion": "7.5.5",
"pointradius": 2, "pointradius": 2,
"points": false, "points": false,
"renderer": "flot", "renderer": "flot",
@ -786,7 +791,8 @@
"steppedLine": false, "steppedLine": false,
"targets": [ "targets": [
{ {
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind, name)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind, name)", "exemplar": true,
"expr": " sum(rate(gotk_reconcile_duration_seconds_sum{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind, name)\n/\n sum(rate(gotk_reconcile_duration_seconds_count{namespace=~\"$operator_namespace\",exported_namespace=~\"$namespace\",kind=~\"GitRepository|HelmRepository|Bucket\"}[5m])) by (kind, name)",
"hide": false, "hide": false,
"interval": "", "interval": "",
"legendFormat": "{{kind}}/{{name}}", "legendFormat": "{{kind}}/{{name}}",
@ -835,8 +841,8 @@
} }
} }
], ],
"refresh": "10s", "refresh": "",
"schemaVersion": 26, "schemaVersion": 27,
"style": "light", "style": "light",
"tags": [ "tags": [
"flux" "flux"
@ -846,9 +852,11 @@
{ {
"current": { "current": {
"selected": false, "selected": false,
"text": "prometheus", "text": "Prometheus",
"value": "prometheus" "value": "Prometheus"
}, },
"description": null,
"error": null,
"hide": 2, "hide": 2,
"includeAll": false, "includeAll": false,
"label": null, "label": null,
@ -862,23 +870,32 @@
"type": "datasource" "type": "datasource"
}, },
{ {
"allValue": ".*", "allValue": "",
"current": { "current": {
"selected": false, "selected": true,
"text": "All", "text": [
"value": "$__all" "All"
],
"value": [
"$__all"
]
}, },
"datasource": "$DS_PROMETHEUS", "datasource": "$DS_PROMETHEUS",
"definition": "gotk_reconcile_condition", "definition": "label_values(gotk_reconcile_condition, namespace)",
"description": null,
"error": null,
"hide": 0, "hide": 0,
"includeAll": true, "includeAll": true,
"label": null, "label": null,
"multi": false, "multi": true,
"name": "namespace", "name": "operator_namespace",
"options": [], "options": [],
"query": "gotk_reconcile_condition", "query": {
"query": "label_values(gotk_reconcile_condition, namespace)",
"refId": "StandardVariableQuery"
},
"refresh": 2, "refresh": 2,
"regex": "/.*namespace=\"([^\"]*).*/", "regex": "",
"skipUrlSync": false, "skipUrlSync": false,
"sort": 5, "sort": 5,
"tagValuesQuery": "", "tagValuesQuery": "",
@ -886,6 +903,42 @@
"tagsQuery": "", "tagsQuery": "",
"type": "query", "type": "query",
"useTags": false "useTags": false
},
{
"allValue": null,
"current": {
"selected": true,
"tags": [],
"text": [
"All"
],
"value": [
"$__all"
]
},
"datasource": null,
"definition": "label_values(gotk_reconcile_condition, exported_namespace)",
"description": null,
"error": null,
"hide": 0,
"includeAll": true,
"label": null,
"multi": true,
"name": "namespace",
"options": [],
"query": {
"query": "label_values(gotk_reconcile_condition, exported_namespace)",
"refId": "StandardVariableQuery"
},
"refresh": 2,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
} }
] ]
}, },

Loading…
Cancel
Save