Browse Source

:sparkles: dashboard variable (#2153)

Signed-off-by: Moritz Johner <beller.moritz@googlemail.com>
Moritz Johner 3 years ago
parent
commit
b2269ee3fb
1 changed files with 139 additions and 223 deletions
  1. 139 223
      docs/snippets/dashboard.json

+ 139 - 223
docs/snippets/dashboard.json

@@ -1,47 +1,4 @@
 {
 {
-  "__inputs": [
-    {
-      "name": "DS_PROMETHEUS",
-      "label": "Prometheus",
-      "description": "",
-      "type": "datasource",
-      "pluginId": "prometheus",
-      "pluginName": "Prometheus"
-    }
-  ],
-  "__elements": {},
-  "__requires": [
-    {
-      "type": "grafana",
-      "id": "grafana",
-      "name": "Grafana",
-      "version": "9.3.1"
-    },
-    {
-      "type": "panel",
-      "id": "heatmap",
-      "name": "Heatmap",
-      "version": ""
-    },
-    {
-      "type": "datasource",
-      "id": "prometheus",
-      "name": "Prometheus",
-      "version": "1.0.0"
-    },
-    {
-      "type": "panel",
-      "id": "stat",
-      "name": "Stat",
-      "version": ""
-    },
-    {
-      "type": "panel",
-      "id": "timeseries",
-      "name": "Time series",
-      "version": ""
-    }
-  ],
   "annotations": {
   "annotations": {
     "list": [
     "list": [
       {
       {
@@ -67,7 +24,7 @@
   "editable": true,
   "editable": true,
   "fiscalYearStartMonth": 0,
   "fiscalYearStartMonth": 0,
   "graphTooltip": 0,
   "graphTooltip": 0,
-  "id": null,
+  "id": 1,
   "links": [],
   "links": [],
   "liveNow": false,
   "liveNow": false,
   "panels": [
   "panels": [
@@ -83,10 +40,7 @@
       "type": "row"
       "type": "row"
     },
     },
     {
     {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
+      "datasource": "$datasource",
       "fieldConfig": {
       "fieldConfig": {
         "defaults": {
         "defaults": {
           "color": {
           "color": {
@@ -160,12 +114,9 @@
       },
       },
       "targets": [
       "targets": [
         {
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
+          "datasource": "$datasource",
           "editorMode": "code",
           "editorMode": "code",
-          "expr": "sum(increase(controller_runtime_webhook_requests_total{service=~\"external-secrets.*\"}[1m])) by (webhook)",
+          "expr": "sum(increase(controller_runtime_webhook_requests_total{service=~\".*external-secrets.*\"}[1m])) by (webhook)",
           "legendFormat": "__auto",
           "legendFormat": "__auto",
           "range": true,
           "range": true,
           "refId": "A"
           "refId": "A"
@@ -175,10 +126,7 @@
       "type": "timeseries"
       "type": "timeseries"
     },
     },
     {
     {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
+      "datasource": "$datasource",
       "fieldConfig": {
       "fieldConfig": {
         "defaults": {
         "defaults": {
           "color": {
           "color": {
@@ -252,12 +200,9 @@
       },
       },
       "targets": [
       "targets": [
         {
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
+          "datasource": "$datasource",
           "editorMode": "code",
           "editorMode": "code",
-          "expr": "sum(controller_runtime_webhook_requests_in_flight{service=~\"external-secrets.*\"}) by (webhook)",
+          "expr": "sum(controller_runtime_webhook_requests_in_flight{service=~\".*external-secrets.*\"}) by (webhook)",
           "legendFormat": "__auto",
           "legendFormat": "__auto",
           "range": true,
           "range": true,
           "refId": "A"
           "refId": "A"
@@ -267,10 +212,7 @@
       "type": "timeseries"
       "type": "timeseries"
     },
     },
     {
     {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
+      "datasource": "$datasource",
       "fieldConfig": {
       "fieldConfig": {
         "defaults": {
         "defaults": {
           "color": {
           "color": {
@@ -344,12 +286,9 @@
       },
       },
       "targets": [
       "targets": [
         {
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
+          "datasource": "$datasource",
           "editorMode": "code",
           "editorMode": "code",
-          "expr": "sum(increase(controller_runtime_webhook_requests_total{service=~\"external-secrets.*\"}[1m])) by (code)",
+          "expr": "sum(increase(controller_runtime_webhook_requests_total{service=~\".*external-secrets.*\"}[1m])) by (code)",
           "legendFormat": "__auto",
           "legendFormat": "__auto",
           "range": true,
           "range": true,
           "refId": "A"
           "refId": "A"
@@ -359,10 +298,7 @@
       "type": "timeseries"
       "type": "timeseries"
     },
     },
     {
     {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
+      "datasource": "$datasource",
       "fieldConfig": {
       "fieldConfig": {
         "defaults": {
         "defaults": {
           "custom": {
           "custom": {
@@ -418,15 +354,12 @@
           "reverse": false
           "reverse": false
         }
         }
       },
       },
-      "pluginVersion": "9.3.1",
+      "pluginVersion": "9.4.3",
       "targets": [
       "targets": [
         {
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
+          "datasource": "$datasource",
           "editorMode": "code",
           "editorMode": "code",
-          "expr": "sum(rate(controller_runtime_webhook_latency_seconds_bucket{service=~\"external-secrets.*\"}[$__rate_interval])) by (le)",
+          "expr": "sum(rate(controller_runtime_webhook_latency_seconds_bucket{service=~\".*external-secrets.*\"}[$__rate_interval])) by (le)",
           "legendFormat": "{{le}}",
           "legendFormat": "{{le}}",
           "range": true,
           "range": true,
           "refId": "A"
           "refId": "A"
@@ -449,15 +382,41 @@
       "type": "row"
       "type": "row"
     },
     },
     {
     {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
-      "description": "",
+      "datasource": "$datasource",
       "fieldConfig": {
       "fieldConfig": {
         "defaults": {
         "defaults": {
           "color": {
           "color": {
-            "mode": "thresholds"
+            "mode": "palette-classic"
+          },
+          "custom": {
+            "axisCenteredZero": false,
+            "axisColorMode": "text",
+            "axisLabel": "",
+            "axisPlacement": "auto",
+            "barAlignment": 0,
+            "drawStyle": "line",
+            "fillOpacity": 0,
+            "gradientMode": "none",
+            "hideFrom": {
+              "legend": false,
+              "tooltip": false,
+              "viz": false
+            },
+            "lineInterpolation": "linear",
+            "lineWidth": 1,
+            "pointSize": 5,
+            "scaleDistribution": {
+              "type": "linear"
+            },
+            "showPoints": "auto",
+            "spanNulls": false,
+            "stacking": {
+              "group": "A",
+              "mode": "none"
+            },
+            "thresholdsStyle": {
+              "mode": "off"
+            }
           },
           },
           "mappings": [],
           "mappings": [],
           "thresholds": {
           "thresholds": {
@@ -477,51 +436,39 @@
         "overrides": []
         "overrides": []
       },
       },
       "gridPos": {
       "gridPos": {
-        "h": 6,
-        "w": 3.4285714285714284,
+        "h": 8,
+        "w": 7,
         "x": 0,
         "x": 0,
         "y": 18
         "y": 18
       },
       },
-      "id": 5,
-      "maxPerRow": 12,
+      "id": 2,
       "options": {
       "options": {
-        "colorMode": "value",
-        "graphMode": "area",
-        "justifyMode": "auto",
-        "orientation": "auto",
-        "reduceOptions": {
-          "calcs": [
-            "lastNotNull"
-          ],
-          "fields": "",
-          "values": false
+        "legend": {
+          "calcs": [],
+          "displayMode": "list",
+          "placement": "bottom",
+          "showLegend": true
         },
         },
-        "textMode": "auto"
+        "tooltip": {
+          "mode": "single",
+          "sort": "none"
+        }
       },
       },
-      "pluginVersion": "9.3.1",
-      "repeat": "controller",
-      "repeatDirection": "h",
       "targets": [
       "targets": [
         {
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
+          "datasource": "$datasource",
           "editorMode": "code",
           "editorMode": "code",
-          "expr": "sum(controller_runtime_max_concurrent_reconciles{service=~\"external-secrets.*\",controller=\"$controller\"}) by (controller)",
+          "expr": "sum(controller_runtime_active_workers{service=~\".*external-secrets.*\",controller=~\"$controller\"}) by (controller)",
           "legendFormat": "__auto",
           "legendFormat": "__auto",
           "range": true,
           "range": true,
           "refId": "A"
           "refId": "A"
         }
         }
       ],
       ],
-      "title": "max concurrent: $controller",
-      "type": "stat"
+      "title": "active workers by controller",
+      "type": "timeseries"
     },
     },
     {
     {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
+      "datasource": "$datasource",
       "fieldConfig": {
       "fieldConfig": {
         "defaults": {
         "defaults": {
           "color": {
           "color": {
@@ -575,9 +522,9 @@
         "overrides": []
         "overrides": []
       },
       },
       "gridPos": {
       "gridPos": {
-        "h": 9,
-        "w": 7,
-        "x": 8,
+        "h": 8,
+        "w": 8,
+        "x": 7,
         "y": 18
         "y": 18
       },
       },
       "id": 37,
       "id": 37,
@@ -595,12 +542,9 @@
       },
       },
       "targets": [
       "targets": [
         {
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
+          "datasource": "$datasource",
           "editorMode": "code",
           "editorMode": "code",
-          "expr": "sum(workqueue_depth{service=~\"external-secrets.*\"}) by (name)",
+          "expr": "sum(workqueue_depth{service=~\".*external-secrets.*\"}) by (name)",
           "legendFormat": "__auto",
           "legendFormat": "__auto",
           "range": true,
           "range": true,
           "refId": "A"
           "refId": "A"
@@ -610,10 +554,7 @@
       "type": "timeseries"
       "type": "timeseries"
     },
     },
     {
     {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
+      "datasource": "$datasource",
       "fieldConfig": {
       "fieldConfig": {
         "defaults": {
         "defaults": {
           "color": {
           "color": {
@@ -667,7 +608,7 @@
         "overrides": []
         "overrides": []
       },
       },
       "gridPos": {
       "gridPos": {
-        "h": 9,
+        "h": 8,
         "w": 9,
         "w": 9,
         "x": 15,
         "x": 15,
         "y": 18
         "y": 18
@@ -687,12 +628,9 @@
       },
       },
       "targets": [
       "targets": [
         {
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
+          "datasource": "$datasource",
           "editorMode": "code",
           "editorMode": "code",
-          "expr": "sum(increase(externalsecret_provider_api_calls_count{service=~\"external-secrets.*\"}[1m])) by(provider, call, status)",
+          "expr": "sum(increase(externalsecret_provider_api_calls_count{service=~\".*external-secrets.*\"}[1m])) by(provider, call, status)",
           "legendFormat": "{{provider}}/{{call}}={{status}}",
           "legendFormat": "{{provider}}/{{call}}={{status}}",
           "range": true,
           "range": true,
           "refId": "A"
           "refId": "A"
@@ -702,52 +640,19 @@
       "type": "timeseries"
       "type": "timeseries"
     },
     },
     {
     {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
+      "datasource": "$datasource",
+      "description": "",
       "fieldConfig": {
       "fieldConfig": {
         "defaults": {
         "defaults": {
           "color": {
           "color": {
-            "mode": "palette-classic"
-          },
-          "custom": {
-            "axisCenteredZero": false,
-            "axisColorMode": "text",
-            "axisLabel": "",
-            "axisPlacement": "auto",
-            "barAlignment": 0,
-            "drawStyle": "line",
-            "fillOpacity": 0,
-            "gradientMode": "none",
-            "hideFrom": {
-              "legend": false,
-              "tooltip": false,
-              "viz": false
-            },
-            "lineInterpolation": "linear",
-            "lineWidth": 1,
-            "pointSize": 5,
-            "scaleDistribution": {
-              "type": "linear"
-            },
-            "showPoints": "auto",
-            "spanNulls": false,
-            "stacking": {
-              "group": "A",
-              "mode": "none"
-            },
-            "thresholdsStyle": {
-              "mode": "off"
-            }
+            "mode": "thresholds"
           },
           },
           "mappings": [],
           "mappings": [],
           "thresholds": {
           "thresholds": {
             "mode": "absolute",
             "mode": "absolute",
             "steps": [
             "steps": [
               {
               {
-                "color": "green",
-                "value": null
+                "color": "green"
               },
               },
               {
               {
                 "color": "red",
                 "color": "red",
@@ -759,48 +664,45 @@
         "overrides": []
         "overrides": []
       },
       },
       "gridPos": {
       "gridPos": {
-        "h": 8,
+        "h": 6,
         "w": 3.4285714285714284,
         "w": 3.4285714285714284,
         "x": 0,
         "x": 0,
-        "y": 24
+        "y": 26
       },
       },
-      "id": 3,
-      "maxPerRow": 8,
+      "id": 5,
+      "maxPerRow": 12,
       "options": {
       "options": {
-        "legend": {
-          "calcs": [],
-          "displayMode": "list",
-          "placement": "bottom",
-          "showLegend": true
+        "colorMode": "value",
+        "graphMode": "area",
+        "justifyMode": "auto",
+        "orientation": "auto",
+        "reduceOptions": {
+          "calcs": [
+            "lastNotNull"
+          ],
+          "fields": "",
+          "values": false
         },
         },
-        "tooltip": {
-          "mode": "single",
-          "sort": "none"
-        }
+        "textMode": "auto"
       },
       },
+      "pluginVersion": "9.3.1",
       "repeat": "controller",
       "repeat": "controller",
       "repeatDirection": "h",
       "repeatDirection": "h",
       "targets": [
       "targets": [
         {
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
+          "datasource": "$datasource",
           "editorMode": "code",
           "editorMode": "code",
-          "expr": "sum(increase(controller_runtime_reconcile_total{service=~\"external-secrets.*\",controller=~\"$controller\"}[1m])) by (result)",
+          "expr": "sum(controller_runtime_max_concurrent_reconciles{service=~\".*external-secrets.*\",controller=\"$controller\"}) by (controller)",
           "legendFormat": "__auto",
           "legendFormat": "__auto",
           "range": true,
           "range": true,
           "refId": "A"
           "refId": "A"
         }
         }
       ],
       ],
-      "title": "reconcile rate per minute: $controller",
-      "type": "timeseries"
+      "title": "max concurrent: $controller",
+      "type": "stat"
     },
     },
     {
     {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
+      "datasource": "$datasource",
       "fieldConfig": {
       "fieldConfig": {
         "defaults": {
         "defaults": {
           "color": {
           "color": {
@@ -853,12 +755,13 @@
         "overrides": []
         "overrides": []
       },
       },
       "gridPos": {
       "gridPos": {
-        "h": 9,
-        "w": 8,
+        "h": 8,
+        "w": 3.4285714285714284,
         "x": 0,
         "x": 0,
         "y": 32
         "y": 32
       },
       },
-      "id": 2,
+      "id": 3,
+      "maxPerRow": 8,
       "options": {
       "options": {
         "legend": {
         "legend": {
           "calcs": [],
           "calcs": [],
@@ -871,27 +774,23 @@
           "sort": "none"
           "sort": "none"
         }
         }
       },
       },
+      "repeat": "controller",
+      "repeatDirection": "h",
       "targets": [
       "targets": [
         {
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
+          "datasource": "$datasource",
           "editorMode": "code",
           "editorMode": "code",
-          "expr": "sum(controller_runtime_active_workers{service=~\"external-secrets.*\",controller=~\"$controller\"}) by (controller)",
+          "expr": "sum(increase(controller_runtime_reconcile_total{service=~\".*external-secrets.*\",controller=~\"$controller\"}[1m])) by (result)",
           "legendFormat": "__auto",
           "legendFormat": "__auto",
           "range": true,
           "range": true,
           "refId": "A"
           "refId": "A"
         }
         }
       ],
       ],
-      "title": "active workers by controller",
+      "title": "reconcile rate per minute: $controller",
       "type": "timeseries"
       "type": "timeseries"
     },
     },
     {
     {
-      "datasource": {
-        "type": "prometheus",
-        "uid": "${DS_PROMETHEUS}"
-      },
+      "datasource": "$datasource",
       "fieldConfig": {
       "fieldConfig": {
         "defaults": {
         "defaults": {
           "custom": {
           "custom": {
@@ -911,7 +810,7 @@
         "h": 8,
         "h": 8,
         "w": 3.4285714285714284,
         "w": 3.4285714285714284,
         "x": 0,
         "x": 0,
-        "y": 41
+        "y": 40
       },
       },
       "id": 39,
       "id": 39,
       "maxPerRow": 8,
       "maxPerRow": 8,
@@ -959,12 +858,9 @@
       "repeatDirection": "h",
       "repeatDirection": "h",
       "targets": [
       "targets": [
         {
         {
-          "datasource": {
-            "type": "prometheus",
-            "uid": "${DS_PROMETHEUS}"
-          },
+          "datasource": "$datasource",
           "editorMode": "code",
           "editorMode": "code",
-          "expr": "rate(controller_runtime_reconcile_time_seconds_bucket{service=~\"external-secrets.*\",controller=~\"$controller\"}[$__rate_interval])",
+          "expr": "rate(controller_runtime_reconcile_time_seconds_bucket{service=~\".*external-secrets.*\",controller=~\"$controller\"}[$__rate_interval])",
           "legendFormat": "{{le}}",
           "legendFormat": "{{le}}",
           "range": true,
           "range": true,
           "refId": "A"
           "refId": "A"
@@ -974,27 +870,47 @@
       "type": "heatmap"
       "type": "heatmap"
     }
     }
   ],
   ],
-  "refresh": false,
-  "schemaVersion": 37,
+  "refresh": "",
+  "revision": 1,
+  "schemaVersion": 38,
   "style": "dark",
   "style": "dark",
   "tags": [],
   "tags": [],
   "templating": {
   "templating": {
     "list": [
     "list": [
       {
       {
+        "current": {
+          "selected": true,
+          "text": "Prometheus",
+          "value": "Prometheus"
+        },
+        "hide": 0,
+        "includeAll": false,
+        "multi": false,
+        "name": "datasource",
+        "options": [],
+        "query": "prometheus",
+        "queryValue": "",
+        "refresh": 1,
+        "regex": "",
+        "skipUrlSync": false,
+        "type": "datasource"
+      },
+      {
         "allValue": ".*",
         "allValue": ".*",
-        "current": {},
-        "datasource": {
-          "type": "prometheus",
-          "uid": "${DS_PROMETHEUS}"
+        "current": {
+          "selected": false,
+          "text": "All",
+          "value": "$__all"
         },
         },
-        "definition": "label_values(controller_runtime_active_workers{service=~\"external-secrets.*\"},  controller)",
+        "datasource": "$datasource",
+        "definition": "label_values(controller_runtime_active_workers{service=~\".*external-secrets.*\"},  controller)",
         "hide": 0,
         "hide": 0,
         "includeAll": true,
         "includeAll": true,
         "multi": true,
         "multi": true,
         "name": "controller",
         "name": "controller",
         "options": [],
         "options": [],
         "query": {
         "query": {
-          "query": "label_values(controller_runtime_active_workers{service=~\"external-secrets.*\"},  controller)",
+          "query": "label_values(controller_runtime_active_workers{service=~\".*external-secrets.*\"},  controller)",
           "refId": "StandardVariableQuery"
           "refId": "StandardVariableQuery"
         },
         },
         "refresh": 1,
         "refresh": 1,
@@ -1006,7 +922,7 @@
     ]
     ]
   },
   },
   "time": {
   "time": {
-    "from": "now-6h",
+    "from": "now-24h",
     "to": "now"
     "to": "now"
   },
   },
   "timepicker": {},
   "timepicker": {},