From e79781ae34cbfeb4c3b3fa23352ac37a67abf3cb Mon Sep 17 00:00:00 2001 From: humoflife Date: Mon, 30 Oct 2023 21:37:51 -0700 Subject: [PATCH 01/29] added x-metrics pod monitor --- apis/oss/composition.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/apis/oss/composition.yaml b/apis/oss/composition.yaml index eb85472..2da305a 100644 --- a/apis/oss/composition.yaml +++ b/apis/oss/composition.yaml @@ -98,6 +98,31 @@ spec: - type: PatchSet patchSetName: common + - name: podMonitorXmetrics + base: + apiVersion: kubernetes.crossplane.io/v1alpha1 + kind: Object + spec: + forProvider: + manifest: + apiVersion: monitoring.coreos.com/v1 + kind: PodMonitor + metadata: + name: x-metrics + namespace: x-metrics + labels: + app: x-metrics + spec: + selector: + matchLabels: + app: x-metrics + podMetricsEndpoints: + - port: http-prom + path: /x-metrics + patches: + - type: PatchSet + patchSetName: common + - name: releasePrometheus base: apiVersion: helm.crossplane.io/v1beta1 From 97c6a6e267e693bd334676970403e0b95d2047cc Mon Sep 17 00:00:00 2001 From: Christopher Haar Date: Wed, 1 Nov 2023 13:12:27 +0100 Subject: [PATCH 02/29] feat(podmonitors): change pod monitors to operators namespace and add namespace selectors for crossplane-system and upbound-system Signed-off-by: Christopher Haar --- apis/oss/composition.yaml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/apis/oss/composition.yaml b/apis/oss/composition.yaml index eb85472..1b6d7f2 100644 --- a/apis/oss/composition.yaml +++ b/apis/oss/composition.yaml @@ -31,10 +31,14 @@ spec: kind: PodMonitor metadata: name: crossplane-rbac-manager - namespace: upbound-system + namespace: operators labels: app: crossplane-rbac-manager spec: + namespaceSelector: + matchNames: + - crossplane-system + - upbound-system selector: matchLabels: app: crossplane-rbac-manager @@ -58,10 +62,14 @@ spec: kind: PodMonitor metadata: name: crossplane - namespace: upbound-system + namespace: operators labels: app: crossplane spec: + namespaceSelector: + matchNames: + - crossplane-system + - upbound-system selector: matchLabels: app: crossplane @@ -85,10 +93,14 @@ spec: kind: PodMonitor metadata: name: crossplane-providers - namespace: upbound-system + namespace: operators labels: app: crossplane-providers spec: + namespaceSelector: + matchNames: + - crossplane-system + - upbound-system selector: matchLabels: app: crossplane-providers From e75584e41921b797e084bb4bf5ebdcb6a4697b8a Mon Sep 17 00:00:00 2001 From: humoflife Date: Wed, 1 Nov 2023 21:18:23 -0700 Subject: [PATCH 03/29] xmetrics dashboard checkpoint checkin --- ...dashboard-grafana-crossplane-xmetrics.yaml | 768 ++++++++++++++++++ 1 file changed, 768 insertions(+) create mode 100644 examples/dashboard-grafana-crossplane-xmetrics.yaml diff --git a/examples/dashboard-grafana-crossplane-xmetrics.yaml b/examples/dashboard-grafana-crossplane-xmetrics.yaml new file mode 100644 index 0000000..46599e9 --- /dev/null +++ b/examples/dashboard-grafana-crossplane-xmetrics.yaml @@ -0,0 +1,768 @@ +apiVersion: oss.grafana.crossplane.io/v1alpha1 +kind: Dashboard +metadata: + name: crossplane-xmetrics +spec: + forProvider: + folderRef: + name: configuration-observability-oss + configJson: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "Claim Status Related Metrics", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 76, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 7, + "x": 0, + "y": 0 + }, + "id": 10, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(kubernetes_crossplane_io_Object_v1alpha1_info > 0)", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Number of MRs by Control Plane", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 7, + "x": 7, + "y": 0 + }, + "id": 9, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(kubernetes_crossplane_io_Object_v1alpha1_synced{name=~\"$claim_name.*\"} > 0)", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Number of Synced MRs per Claim", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 7, + "x": 14, + "y": 0 + }, + "id": 8, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(kubernetes_crossplane_io_Object_v1alpha1_ready{name=~\"$claim_name.*\"} > 0)", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Number of Ready MRs per Claim", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "", + "fieldConfig": { + "defaults": { + "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" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "{__name__=\"kubernetes_crossplane_io_Object_v1alpha1_synced\", app=\"x-metrics\", app_kubernetes_io_instance=\"x-metrics\", app_kubernetes_io_name=\"x-metrics\", instance=\"240.59.99.22:8080\", job=\"kubernetes-pods\", kubernetes_namespace=\"x-metrics\", kubernetes_pod_name=\"x-metrics-65c989f5b9-f8h7f\", name=\"rds-test-postgres-01-nzhjh-mrvsn\", node=\"ip-240-59-88-238.us-west-2.compute.internal\", pod_template_hash=\"65c989f5b9\"}" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": false, + "viz": true + } + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 10, + "x": 0, + "y": 4 + }, + "id": 5, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "kubernetes_crossplane_io_Object_v1alpha1_synced{name=~\"$claim_name.*\"}", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Kubernetes Crossplane.io Object v1alpha1 Synced", + "type": "timeseries" + }, + { + "columns": [], + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "", + "fontSize": "100%", + "gridPos": { + "h": 9, + "w": 13, + "x": 10, + "y": 4 + }, + "id": 6, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "9.3.6", + "showHeader": true, + "sort": { + "desc": false + }, + "styles": [ + { + "$$hashKey": "object:312", + "alias": "Time", + "align": "auto", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "date" + }, + { + "$$hashKey": "object:313", + "alias": "", + "align": "right", + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "builder", + "exemplar": false, + "expr": "kubernetes_crossplane_io_Object_v1alpha1_synced_time{name=~\"$claim_name.*\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "__auto", + "range": false, + "refId": "A" + } + ], + "title": "Kubernetes Crossplane.io Object v1alpha1 Synched Time", + "transform": "timeseries_to_rows", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": false, + "Value": true, + "__name__": true, + "app": true, + "app_kubernetes_io_instance": true, + "app_kubernetes_io_name": true, + "instance": true, + "job": true, + "kubernetes_namespace": true, + "kubernetes_pod_name": true, + "name": false, + "node": true, + "pod_template_hash": true + }, + "indexByName": { + "Time": 1, + "Value": 12, + "__name__": 2, + "app": 3, + "app_kubernetes_io_instance": 4, + "app_kubernetes_io_name": 5, + "instance": 6, + "job": 7, + "kubernetes_namespace": 8, + "kubernetes_pod_name": 9, + "name": 0, + "node": 10, + "pod_template_hash": 11 + }, + "renameByName": {} + } + } + ], + "type": "table-old" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "", + "fieldConfig": { + "defaults": { + "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" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "{__name__=\"kubernetes_crossplane_io_Object_v1alpha1_ready\", app=\"x-metrics\", app_kubernetes_io_instance=\"x-metrics\", app_kubernetes_io_name=\"x-metrics\", instance=\"240.59.99.22:8080\", job=\"kubernetes-pods\", kubernetes_namespace=\"x-metrics\", kubernetes_pod_name=\"x-metrics-65c989f5b9-f8h7f\", name=\"rds-test-postgres-01-nzhjh-mrvsn\", node=\"ip-240-59-88-238.us-west-2.compute.internal\", pod_template_hash=\"65c989f5b9\"}" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": false, + "viz": true + } + } + ] + } + ] + }, + "gridPos": { + "h": 9, + "w": 10, + "x": 0, + "y": 13 + }, + "id": 7, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "kubernetes_crossplane_io_Object_v1alpha1_ready{name=~\"$claim_name.*\"}", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Kubernetes Crossplane.io Object v1alpha1 Ready", + "type": "timeseries" + }, + { + "columns": [], + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "displayMode": "auto", + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "fontSize": "100%", + "gridPos": { + "h": 9, + "w": 13, + "x": 10, + "y": 13 + }, + "id": 4, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "9.3.6", + "showHeader": true, + "sort": { + "col": 0, + "desc": true + }, + "styles": [ + { + "$$hashKey": "object:312", + "alias": "Time", + "align": "auto", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "date" + }, + { + "$$hashKey": "object:313", + "alias": "", + "align": "right", + "colors": [ + "rgba(245, 54, 54, 0.9)", + "rgba(237, 129, 40, 0.89)", + "rgba(50, 172, 45, 0.97)" + ], + "decimals": 2, + "pattern": "/.*/", + "thresholds": [], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "builder", + "exemplar": false, + "expr": "kubernetes_crossplane_io_Object_v1alpha1_ready_time{name=~\"$claim_name.*\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "__auto", + "range": false, + "refId": "A" + } + ], + "title": "Kubernetes Crossplane.io Object v1alpha1 Ready Time", + "transform": "timeseries_to_rows", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Value": true, + "__name__": true, + "app": true, + "app_kubernetes_io_instance": true, + "app_kubernetes_io_name": true, + "instance": true, + "job": true, + "kubernetes_namespace": true, + "kubernetes_pod_name": true, + "node": true, + "pod_template_hash": true + }, + "indexByName": { + "Time": 1, + "Value": 12, + "__name__": 2, + "app": 3, + "app_kubernetes_io_instance": 4, + "app_kubernetes_io_name": 5, + "instance": 6, + "job": 7, + "kubernetes_namespace": 8, + "kubernetes_pod_name": 9, + "name": 0, + "node": 10, + "pod_template_hash": 11 + }, + "renameByName": {} + } + } + ], + "type": "table-old" + } + ], + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "rds-test-postgres-01", + "value": "rds-test-postgres-01" + }, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels", + "description": "Claim Name", + "hide": 0, + "includeAll": false, + "label": "Claim Name", + "multi": false, + "name": "claim_name", + "options": [], + "query": { + "query": "kubernetes_crossplane_io_Object_v1alpha1_labels", + "refId": "StandardVariableQuery" + }, + "refresh": 2, + "regex": "/label_crossplane_io_claim_name=\\\"([^\\\"]+)\\\"/", + "skipUrlSync": false, + "sort": 2, + "type": "query" + } + ] + }, + "time": { + "from": "now-30m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Crossplane X-Metrics", + "uid": "dt-jfvVIk", + "version": 1, + "weekStart": "" + } From 80c294ae15974f194a74b6cbc49c8ef2611e6ed3 Mon Sep 17 00:00:00 2001 From: humoflife Date: Fri, 3 Nov 2023 11:18:09 -0700 Subject: [PATCH 04/29] variable setup for top level dashboard --- ...ashboard-grafana-crossplane-top-level.yaml | 656 ++++++++++++++++++ 1 file changed, 656 insertions(+) create mode 100644 examples/dashboard-grafana-crossplane-top-level.yaml diff --git a/examples/dashboard-grafana-crossplane-top-level.yaml b/examples/dashboard-grafana-crossplane-top-level.yaml new file mode 100644 index 0000000..ab6d3c9 --- /dev/null +++ b/examples/dashboard-grafana-crossplane-top-level.yaml @@ -0,0 +1,656 @@ +apiVersion: oss.grafana.crossplane.io/v1alpha1 +kind: Dashboard +metadata: + name: crossplane-mr +spec: + forProvider: + folderRef: + name: configuration-observability-oss + configJson: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 101, + "links": [], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "panels": [], + "title": "Managed Resource Counts", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 0, + "y": 1 + }, + "id": 4, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(tf_upbound_io_Workspace_v1beta1) + sum(tf_upbound_io_ProviderConfig_v1beta1) + sum(kubernetes_crossplane_io_Object_v1alpha1) + sum(kms_aws_upbound_io_Alias_v1beta1) + sum(lambda_aws_upbound_io_Invocation_v1beta1) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1)", + "hide": false, + "legendFormat": "__auto", + "range": true, + "refId": "C" + } + ], + "title": "Number of Managed Resources", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 0, + "y": 5 + }, + "id": 6, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(tf_upbound_io_Workspace_v1beta1_synced) + sum(tf_upbound_io_ProviderConfig_v1beta1_synced) + sum(kubernetes_crossplane_io_Object_v1alpha1_synced) + sum(kms_aws_upbound_io_Alias_v1beta1_synced) + sum(lambda_aws_upbound_io_Invocation_v1beta1_synced) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1_synced)", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Number of Managed Resources In Sync", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 4, + "x": 4, + "y": 5 + }, + "id": 7, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(tf_upbound_io_Workspace_v1beta1_ready) + sum(tf_upbound_io_ProviderConfig_v1beta1_ready) + sum(kubernetes_crossplane_io_Object_v1alpha1_ready) + sum(kms_aws_upbound_io_Alias_v1beta1_ready) + sum(lambda_aws_upbound_io_Invocation_v1beta1_ready) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1_ready)", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Number of Managed Resources In Ready", + "type": "gauge" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 9 + }, + "id": 9, + "panels": [], + "title": "Resource Tables", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "fillOpacity": 80, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineWidth": 1 + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "__systemRef": "hideSeriesFrom", + "matcher": { + "id": "byNames", + "options": { + "mode": "exclude", + "names": [ + "{app=\"x-metrics\", app_kubernetes_io_instance=\"x-metrics\", app_kubernetes_io_name=\"x-metrics\", instance=\"240.59.99.22:8080\", job=\"kubernetes-pods\", kubernetes_namespace=\"x-metrics\", kubernetes_pod_name=\"x-metrics-65c989f5b9-f8h7f\", name=\"afaytelson-provider-token-vgr98-gjs7c\", node=\"ip-240-59-88-238.us-west-2.compute.internal\", pod_template_hash=\"65c989f5b9\"}" + ], + "prefix": "All except:", + "readOnly": true + } + }, + "properties": [ + { + "id": "custom.hideFrom", + "value": { + "legend": false, + "tooltip": false, + "viz": true + } + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 10 + }, + "id": 11, + "options": { + "bucketOffset": 0, + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + } + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "kubernetes_crossplane_io_Object_v1alpha1", + "hide": false, + "legendFormat": "__auto", + "range": true, + "refId": "B" + } + ], + "title": "Composite Resource (XR) Time To Rreadiness", + "transformations": [], + "type": "histogram" + } + ], + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "awsuswest2-afaytelson", + "value": "awsuswest2-afaytelson" + }, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels", + "description": "The Kubernetes namespace where the Crossplane resource claim was applied.", + "hide": 0, + "includeAll": false, + "label": "Claim Namespace", + "multi": false, + "name": "claim_namespace", + "options": [], + "query": { + "query": "kubernetes_crossplane_io_Object_v1alpha1_labels", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/label_crossplane_io_claim_namespace=\\\"([^\\\"]+)\\\"/", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "afaytelson-provider-token", + "value": "afaytelson-provider-token" + }, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels", + "description": "The name of the Crossplane resource claim.", + "hide": 0, + "includeAll": false, + "label": "Claim Name", + "multi": false, + "name": "claim_name", + "options": [], + "query": { + "query": "kubernetes_crossplane_io_Object_v1alpha1_labels", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/label_crossplane_io_claim_name=\\\"([^\\\"]+)\\\"/", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "afaytelson-provider-token-vgr98", + "value": "afaytelson-provider-token-vgr98" + }, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels", + "description": "The name of the Crossplane composite resource (XR) that was created from a claim.", + "hide": 0, + "includeAll": false, + "label": "Composite Name", + "multi": false, + "name": "composite_name", + "options": [], + "query": { + "query": "kubernetes_crossplane_io_Object_v1alpha1_labels", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/label_crossplane_io_composite=\\\"([^\\\"]+)\\\"/", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": { + "selected": false, + "text": "crossplane-system", + "value": "crossplane-system" + }, + "description": "The Kubernetes namespace where providers and Crossplane pods reside.", + "hide": 0, + "includeAll": false, + "label": "Provider Namespace", + "multi": false, + "name": "provider_namespace", + "options": [ + { + "selected": true, + "text": "crossplane-system", + "value": "crossplane-system" + }, + { + "selected": false, + "text": "upbound-system", + "value": "upbound-system" + } + ], + "query": "crossplane-system,upbound-system", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": { + "selected": false, + "text": "true", + "value": "true" + }, + "description": "The status of a resource.", + "hide": 0, + "includeAll": false, + "label": "Synced Status", + "multi": false, + "name": "synced_status", + "options": [ + { + "selected": true, + "text": "true", + "value": "true" + }, + { + "selected": false, + "text": "false", + "value": "false" + }, + { + "selected": false, + "text": "other", + "value": "other" + } + ], + "query": "true, false, other\n", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": { + "selected": false, + "text": "true", + "value": "true" + }, + "description": "The ready status of a resource.", + "hide": 0, + "includeAll": false, + "label": "Ready Status", + "multi": false, + "name": "ready_status", + "options": [ + { + "selected": true, + "text": "true", + "value": "true" + }, + { + "selected": false, + "text": "false", + "value": "false" + }, + { + "selected": false, + "text": "other", + "value": "other" + } + ], + "query": "true, false, other", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": { + "selected": false, + "text": "0.5", + "value": "0.5" + }, + "description": "Each of a set of values of a variate which divide the frequency distribution into equal groups.", + "hide": 0, + "includeAll": false, + "label": "Quantile", + "multi": false, + "name": "quantile", + "options": [ + { + "selected": true, + "text": "0.5", + "value": "0.5" + }, + { + "selected": false, + "text": "0.75", + "value": "0.75" + }, + { + "selected": false, + "text": "0.9", + "value": "0.9" + }, + { + "selected": false, + "text": "0.95", + "value": "0.95" + }, + { + "selected": false, + "text": "0.99", + "value": "0.99" + }, + { + "selected": false, + "text": "100", + "value": "100" + } + ], + "query": "0.5,0.75,0.9,0.95,0.99,100", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": { + "isNone": true, + "selected": true, + "text": "None", + "value": "" + }, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "definition": "query_result(upjet_resource_ttr_bucket)", + "description": "API group.", + "hide": 0, + "includeAll": false, + "label": "group", + "multi": false, + "name": "group", + "options": [], + "query": { + "query": "query_result(upjet_resource_ttr_bucket)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/group=\\\"([^\\\"]+)\\\"/", + "skipUrlSync": false, + "sort": 1, + "type": "query" + }, + { + "current": { + "isNone": true, + "selected": false, + "text": "None", + "value": "" + }, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "definition": "query_result(upjet_resource_ttr_bucket)", + "description": "The kind of the resource.", + "hide": 0, + "includeAll": false, + "label": "kind", + "multi": false, + "name": "kind", + "options": [], + "query": { + "query": "query_result(upjet_resource_ttr_bucket)", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Crossplane Top Level View", + "uid": "sg0yFc4Ik", + "version": 4, + "weekStart": "" + } From 798f785d165df4a9f62ee43eee91ea3aaf12b81f Mon Sep 17 00:00:00 2001 From: humoflife Date: Fri, 3 Nov 2023 15:06:34 -0700 Subject: [PATCH 05/29] dashboard updates --- ...hboard-grafana-crossplane-sli-metrics.yaml | 72 ++++---- ...ashboard-grafana-crossplane-top-level.yaml | 161 ++++++++++++++---- ...dashboard-grafana-crossplane-xmetrics.yaml | 31 ++-- 3 files changed, 179 insertions(+), 85 deletions(-) diff --git a/examples/dashboard-grafana-crossplane-sli-metrics.yaml b/examples/dashboard-grafana-crossplane-sli-metrics.yaml index 371edb0..2a1b9fb 100644 --- a/examples/dashboard-grafana-crossplane-sli-metrics.yaml +++ b/examples/dashboard-grafana-crossplane-sli-metrics.yaml @@ -44,7 +44,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -122,7 +122,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "disableTextWrap": false, "editorMode": "code", @@ -156,7 +156,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -235,7 +235,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "kubelet_started_containers_total{}", @@ -265,7 +265,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -343,7 +343,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "disableTextWrap": false, "editorMode": "code", @@ -363,7 +363,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -441,7 +441,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "go_memstats_alloc_bytes", @@ -457,7 +457,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -535,7 +535,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "go_goroutines", @@ -565,7 +565,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -643,7 +643,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "disableTextWrap": false, "editorMode": "code", @@ -677,7 +677,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -755,7 +755,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "process_resident_memory_bytes", @@ -771,7 +771,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -849,7 +849,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "process_start_time_seconds", @@ -865,7 +865,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -943,7 +943,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "disableTextWrap": false, "editorMode": "builder", @@ -977,7 +977,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -1055,7 +1055,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "certwatcher_read_certificate_errors_total", @@ -1071,7 +1071,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -1149,7 +1149,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "disableTextWrap": false, "editorMode": "code", @@ -1183,7 +1183,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -1261,7 +1261,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "rate(controller_runtime_webhook_requests_total[5m])", @@ -1277,7 +1277,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -1355,7 +1355,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "rate(controller_runtime_reconcile_errors_total{namespace=\"upbound-system\"}[5m])", @@ -1371,7 +1371,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -1449,7 +1449,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "controller_runtime_max_concurrent_reconciles{namespace=\"upbound-system\"}", @@ -1465,7 +1465,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -1520,7 +1520,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "histogram_quantile(0.95, sum(rate(controller_runtime_reconcile_time_seconds_bucket[5m])) by (le))", @@ -1536,7 +1536,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -1614,7 +1614,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "rate(controller_runtime_reconcile_time_seconds_count[5m])", @@ -1630,7 +1630,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -1708,7 +1708,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "rate(controller_runtime_reconcile_time_seconds_sum{namespace=\"upbound-system\"}[5m])", @@ -1724,7 +1724,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -1802,7 +1802,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "rate(controller_runtime_reconcile_total{namespace=\"upbound-system\"}[5m])", diff --git a/examples/dashboard-grafana-crossplane-top-level.yaml b/examples/dashboard-grafana-crossplane-top-level.yaml index ab6d3c9..5b905e9 100644 --- a/examples/dashboard-grafana-crossplane-top-level.yaml +++ b/examples/dashboard-grafana-crossplane-top-level.yaml @@ -47,13 +47,13 @@ spec: }, "id": 2, "panels": [], - "title": "Managed Resource Counts", + "title": "Resource Counts", "type": "row" }, { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "description": "", "fieldConfig": { @@ -102,7 +102,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "sum(tf_upbound_io_Workspace_v1beta1) + sum(tf_upbound_io_ProviderConfig_v1beta1) + sum(kubernetes_crossplane_io_Object_v1alpha1) + sum(kms_aws_upbound_io_Alias_v1beta1) + sum(lambda_aws_upbound_io_Invocation_v1beta1) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1)", @@ -118,7 +118,72 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 8, + "x": 8, + "y": 1 + }, + "id": 12, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "editorMode": "code", + "expr": "sum(tf_upbound_io_Workspace_v1beta1) + sum(tf_upbound_io_ProviderConfig_v1beta1) + sum(kubernetes_crossplane_io_Object_v1alpha1) + sum(kms_aws_upbound_io_Alias_v1beta1) + sum(lambda_aws_upbound_io_Invocation_v1beta1) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1)", + "hide": false, + "legendFormat": "__auto", + "range": true, + "refId": "C" + } + ], + "title": "Number of Composite Resources", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -144,7 +209,7 @@ spec: }, "gridPos": { "h": 4, - "w": 4, + "w": 8, "x": 0, "y": 5 }, @@ -166,7 +231,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "sum(tf_upbound_io_Workspace_v1beta1_synced) + sum(tf_upbound_io_ProviderConfig_v1beta1_synced) + sum(kubernetes_crossplane_io_Object_v1alpha1_synced) + sum(kms_aws_upbound_io_Alias_v1beta1_synced) + sum(lambda_aws_upbound_io_Invocation_v1beta1_synced) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1_synced)", @@ -181,7 +246,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -207,8 +272,8 @@ spec: }, "gridPos": { "h": 4, - "w": 4, - "x": 4, + "w": 8, + "x": 8, "y": 5 }, "id": 7, @@ -229,7 +294,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "sum(tf_upbound_io_Workspace_v1beta1_ready) + sum(tf_upbound_io_ProviderConfig_v1beta1_ready) + sum(kubernetes_crossplane_io_Object_v1alpha1_ready) + sum(kms_aws_upbound_io_Alias_v1beta1_ready) + sum(lambda_aws_upbound_io_Invocation_v1beta1_ready) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1_ready)", @@ -238,7 +303,7 @@ spec: "refId": "A" } ], - "title": "Number of Managed Resources In Ready", + "title": "Number of Managed Resources Ready", "type": "gauge" }, { @@ -257,7 +322,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -337,10 +402,10 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", - "expr": "kubernetes_crossplane_io_Object_v1alpha1", + "expr": "histogram_quantile(0.95, sum(rate(upjet_resource_ttr_bucket[$interval])) by (le))", "hide": false, "legendFormat": "__auto", "range": true, @@ -360,12 +425,12 @@ spec: { "current": { "selected": false, - "text": "awsuswest2-afaytelson", - "value": "awsuswest2-afaytelson" + "text": "awsuswest2-markus-schweig", + "value": "awsuswest2-markus-schweig" }, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels", "description": "The Kubernetes namespace where the Crossplane resource claim was applied.", @@ -388,12 +453,12 @@ spec: { "current": { "selected": false, - "text": "afaytelson-provider-token", - "value": "afaytelson-provider-token" + "text": "rds-test-01", + "value": "rds-test-01" }, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels", "description": "The name of the Crossplane resource claim.", @@ -416,12 +481,12 @@ spec: { "current": { "selected": false, - "text": "afaytelson-provider-token-vgr98", - "value": "afaytelson-provider-token-vgr98" + "text": "rds-test-01-tncc2", + "value": "rds-test-01-tncc2" }, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels", "description": "The name of the Crossplane composite resource (XR) that was created from a claim.", @@ -585,14 +650,13 @@ spec: }, { "current": { - "isNone": true, - "selected": true, - "text": "None", + "selected": false, + "text": "", "value": "" }, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "definition": "query_result(upjet_resource_ttr_bucket)", "description": "API group.", @@ -614,14 +678,13 @@ spec: }, { "current": { - "isNone": true, "selected": false, - "text": "None", + "text": "", "value": "" }, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "definition": "query_result(upjet_resource_ttr_bucket)", "description": "The kind of the resource.", @@ -640,17 +703,49 @@ spec: "skipUrlSync": false, "sort": 1, "type": "query" + }, + { + "current": { + "selected": false, + "text": "2m", + "value": "2m" + }, + "description": "Interval.", + "hide": 0, + "includeAll": false, + "label": "Interval", + "multi": false, + "name": "interval", + "options": [ + { + "selected": true, + "text": "2m", + "value": "2m" + }, + { + "selected": false, + "text": "5m", + "value": "5m" + }, + { + "selected": false, + "text": "10m", + "value": "10m" + } + ], + "query": "2m, 5m, 10m", + "skipUrlSync": false, + "type": "custom" } ] }, "time": { - "from": "now-1h", + "from": "now-30m", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Crossplane Top Level View", - "uid": "sg0yFc4Ik", - "version": 4, + "version": 5, "weekStart": "" } diff --git a/examples/dashboard-grafana-crossplane-xmetrics.yaml b/examples/dashboard-grafana-crossplane-xmetrics.yaml index 46599e9..de6627d 100644 --- a/examples/dashboard-grafana-crossplane-xmetrics.yaml +++ b/examples/dashboard-grafana-crossplane-xmetrics.yaml @@ -41,7 +41,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "description": "", "fieldConfig": { @@ -90,7 +90,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "sum(kubernetes_crossplane_io_Object_v1alpha1_info > 0)", @@ -105,7 +105,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "description": "", "fieldConfig": { @@ -154,7 +154,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "sum(kubernetes_crossplane_io_Object_v1alpha1_synced{name=~\"$claim_name.*\"} > 0)", @@ -169,7 +169,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "description": "", "fieldConfig": { @@ -218,7 +218,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "sum(kubernetes_crossplane_io_Object_v1alpha1_ready{name=~\"$claim_name.*\"} > 0)", @@ -233,7 +233,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "description": "", "fieldConfig": { @@ -336,7 +336,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "kubernetes_crossplane_io_Object_v1alpha1_synced{name=~\"$claim_name.*\"}", @@ -352,7 +352,7 @@ spec: "columns": [], "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "description": "", "fontSize": "100%", @@ -407,7 +407,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "builder", "exemplar": false, @@ -465,7 +465,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "description": "", "fieldConfig": { @@ -568,7 +568,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "kubernetes_crossplane_io_Object_v1alpha1_ready{name=~\"$claim_name.*\"}", @@ -584,7 +584,7 @@ spec: "columns": [], "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "description": "", "fieldConfig": { @@ -666,7 +666,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "builder", "exemplar": false, @@ -733,7 +733,7 @@ spec: }, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels", "description": "Claim Name", @@ -762,7 +762,6 @@ spec: "timepicker": {}, "timezone": "", "title": "Crossplane X-Metrics", - "uid": "dt-jfvVIk", "version": 1, "weekStart": "" } From 91b73ffc8a38db8b93e96cc5e8d3395666c57fbe Mon Sep 17 00:00:00 2001 From: humoflife Date: Fri, 3 Nov 2023 19:35:21 -0700 Subject: [PATCH 06/29] added dashboard panels --- ...ashboard-grafana-crossplane-top-level.yaml | 720 +++++++++++++++--- 1 file changed, 621 insertions(+), 99 deletions(-) diff --git a/examples/dashboard-grafana-crossplane-top-level.yaml b/examples/dashboard-grafana-crossplane-top-level.yaml index 5b905e9..dec4cc6 100644 --- a/examples/dashboard-grafana-crossplane-top-level.yaml +++ b/examples/dashboard-grafana-crossplane-top-level.yaml @@ -1,7 +1,7 @@ apiVersion: oss.grafana.crossplane.io/v1alpha1 kind: Dashboard metadata: - name: crossplane-mr + name: crossplane-top-level spec: forProvider: folderRef: @@ -53,7 +53,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" }, "description": "", "fieldConfig": { @@ -80,7 +80,7 @@ spec: }, "gridPos": { "h": 4, - "w": 8, + "w": 6, "x": 0, "y": 1 }, @@ -102,7 +102,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" }, "editorMode": "code", "expr": "sum(tf_upbound_io_Workspace_v1beta1) + sum(tf_upbound_io_ProviderConfig_v1beta1) + sum(kubernetes_crossplane_io_Object_v1alpha1) + sum(kms_aws_upbound_io_Alias_v1beta1) + sum(lambda_aws_upbound_io_Invocation_v1beta1) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1)", @@ -112,15 +112,14 @@ spec: "refId": "C" } ], - "title": "Number of Managed Resources", + "title": "Managed Resources", "type": "gauge" }, { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" }, - "description": "", "fieldConfig": { "defaults": { "color": { @@ -145,11 +144,11 @@ spec: }, "gridPos": { "h": 4, - "w": 8, - "x": 8, + "w": 9, + "x": 6, "y": 1 }, - "id": 12, + "id": 6, "options": { "orientation": "auto", "reduceOptions": { @@ -167,23 +166,85 @@ spec: { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(tf_upbound_io_Workspace_v1beta1) + sum(tf_upbound_io_ProviderConfig_v1beta1) + sum(kubernetes_crossplane_io_Object_v1alpha1) + sum(kms_aws_upbound_io_Alias_v1beta1) + sum(lambda_aws_upbound_io_Invocation_v1beta1) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1)", - "hide": false, + "expr": "sum(tf_upbound_io_Workspace_v1beta1_synced) + sum(tf_upbound_io_ProviderConfig_v1beta1_synced) + sum(kubernetes_crossplane_io_Object_v1alpha1_synced) + sum(kms_aws_upbound_io_Alias_v1beta1_synced) + sum(lambda_aws_upbound_io_Invocation_v1beta1_synced) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1_synced)", "legendFormat": "__auto", "range": true, - "refId": "C" + "refId": "A" + } + ], + "title": "Managed Resources In Sync", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 9, + "x": 15, + "y": 1 + }, + "id": 7, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(tf_upbound_io_Workspace_v1beta1_ready) + sum(tf_upbound_io_ProviderConfig_v1beta1_ready) + sum(kubernetes_crossplane_io_Object_v1alpha1_ready) + sum(kms_aws_upbound_io_Alias_v1beta1_ready) + sum(lambda_aws_upbound_io_Invocation_v1beta1_ready) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1_ready)", + "legendFormat": "__auto", + "range": true, + "refId": "A" } ], - "title": "Number of Composite Resources", + "title": "Managed Resources Ready", "type": "gauge" }, { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" }, "fieldConfig": { "defaults": { @@ -209,11 +270,11 @@ spec: }, "gridPos": { "h": 4, - "w": 8, + "w": 6, "x": 0, "y": 5 }, - "id": 6, + "id": 14, "options": { "orientation": "auto", "reduceOptions": { @@ -231,22 +292,22 @@ spec: { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(tf_upbound_io_Workspace_v1beta1_synced) + sum(tf_upbound_io_ProviderConfig_v1beta1_synced) + sum(kubernetes_crossplane_io_Object_v1alpha1_synced) + sum(kms_aws_upbound_io_Alias_v1beta1_synced) + sum(lambda_aws_upbound_io_Invocation_v1beta1_synced) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1_synced)", + "expr": "count(apiextensions_crossplane_io_CompositeResourceDefinition_v1)", "legendFormat": "__auto", "range": true, "refId": "A" } ], - "title": "Number of Managed Resources In Sync", + "title": "API Extensions", "type": "gauge" }, { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" }, "fieldConfig": { "defaults": { @@ -272,11 +333,11 @@ spec: }, "gridPos": { "h": 4, - "w": 8, - "x": 8, + "w": 9, + "x": 6, "y": 5 }, - "id": 7, + "id": 15, "options": { "orientation": "auto", "reduceOptions": { @@ -294,16 +355,269 @@ spec: { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(tf_upbound_io_Workspace_v1beta1_ready) + sum(tf_upbound_io_ProviderConfig_v1beta1_ready) + sum(kubernetes_crossplane_io_Object_v1alpha1_ready) + sum(kms_aws_upbound_io_Alias_v1beta1_ready) + sum(lambda_aws_upbound_io_Invocation_v1beta1_ready) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1_ready)", + "expr": "count(apiextensions_crossplane_io_CompositeResourceDefinition_v1_synced)", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "API Extensions in Sync", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 9, + "x": 15, + "y": 5 + }, + "id": 16, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "count(apiextensions_crossplane_io_CompositeResourceDefinition_v1_ready)", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "API Extensions Ready", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 6, + "x": 0, + "y": 9 + }, + "id": 12, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "count(pkg_crossplane_io_ProviderRevision_v1)", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "Providers", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 9, + "x": 6, + "y": 9 + }, + "id": 17, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "upjet_resource_ttr_count{group=\"$group\",version=\"$version\",kind=\"$kind\"}", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "$group/$version $kind TTR Count", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "description": "TTR Sum in Minutes.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 9, + "x": 15, + "y": 9 + }, + "id": 13, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "upjet_resource_ttr_sum{group=\"$group\",version=\"$version\",kind=\"$kind\"}/60", "legendFormat": "__auto", "range": true, "refId": "A" } ], - "title": "Number of Managed Resources Ready", + "title": "$group/$version $kind TTR Sum", "type": "gauge" }, { @@ -312,18 +626,118 @@ spec: "h": 1, "w": 24, "x": 0, - "y": 9 + "y": 13 }, "id": 9, "panels": [], - "title": "Resource Tables", + "title": "Resource Graphs", "type": "row" }, { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" + }, + "description": "Preferred query:\nhistogram_quantile($quantile, sum(rate(upjet_resource_ttr_bucket{group=\"$group\",version=\"$version\",kind=\"$kind\"}[$interval])) by (le))", + "fieldConfig": { + "defaults": { + "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" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 16, + "x": 0, + "y": 14 + }, + "id": 11, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.3.6", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "exemplar": true, + "expr": "upjet_resource_ttr_bucket{group=\"$group\",version=\"$version\",kind=\"$kind\"}", + "format": "time_series", + "hide": false, + "instant": true, + "legendFormat": "__auto", + "range": true, + "refId": "B" + } + ], + "title": "$group/$version $kind Time To Readiness in Seconds", + "transformations": [], + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" }, + "description": "", "fieldConfig": { "defaults": { "color": { @@ -362,7 +776,7 @@ spec: "options": { "mode": "exclude", "names": [ - "{app=\"x-metrics\", app_kubernetes_io_instance=\"x-metrics\", app_kubernetes_io_name=\"x-metrics\", instance=\"240.59.99.22:8080\", job=\"kubernetes-pods\", kubernetes_namespace=\"x-metrics\", kubernetes_pod_name=\"x-metrics-65c989f5b9-f8h7f\", name=\"afaytelson-provider-token-vgr98-gjs7c\", node=\"ip-240-59-88-238.us-west-2.compute.internal\", pod_template_hash=\"65c989f5b9\"}" + "histogram_quantile(0.95, sum(rate(upjet_resource_ttr_bucket{group=\"lambda.aws.upbound.io\",version=\"v1beta1\",kind=\"Invocation\"}[2m])) by (le))" ], "prefix": "All except:", "readOnly": true @@ -383,11 +797,11 @@ spec: }, "gridPos": { "h": 8, - "w": 12, + "w": 16, "x": 0, - "y": 10 + "y": 22 }, - "id": 11, + "id": 18, "options": { "bucketOffset": 0, "legend": { @@ -402,19 +816,33 @@ spec: { "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "histogram_quantile(0.95, sum(rate(upjet_resource_ttr_bucket[$interval])) by (le))", + "exemplar": true, + "expr": "histogram_quantile($quantile, sum(rate(upjet_resource_ttr_bucket{group=\"$group\",version=\"$version\",kind=\"$kind\"}[$interval])) by (le))", + "format": "time_series", "hide": false, + "instant": true, "legendFormat": "__auto", "range": true, "refId": "B" } ], - "title": "Composite Resource (XR) Time To Rreadiness", + "title": "$group/$version $kind Time TTR Histogram in Seconds", "transformations": [], "type": "histogram" + }, + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 30 + }, + "id": 20, + "title": "Resource Tables", + "type": "row" } ], "schemaVersion": 37, @@ -424,13 +852,13 @@ spec: "list": [ { "current": { - "selected": false, + "selected": true, "text": "awsuswest2-markus-schweig", "value": "awsuswest2-markus-schweig" }, "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" }, "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels", "description": "The Kubernetes namespace where the Crossplane resource claim was applied.", @@ -452,15 +880,15 @@ spec: }, { "current": { - "selected": false, - "text": "rds-test-01", - "value": "rds-test-01" + "selected": true, + "text": "s3-audit-bucket-1", + "value": "s3-audit-bucket-1" }, "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" }, - "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels", + "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels{label_crossplane_io_claim_namespace=\"$claim_namespace\"}", "description": "The name of the Crossplane resource claim.", "hide": 0, "includeAll": false, @@ -469,7 +897,7 @@ spec: "name": "claim_name", "options": [], "query": { - "query": "kubernetes_crossplane_io_Object_v1alpha1_labels", + "query": "kubernetes_crossplane_io_Object_v1alpha1_labels{label_crossplane_io_claim_namespace=\"$claim_namespace\"}", "refId": "StandardVariableQuery" }, "refresh": 1, @@ -481,14 +909,14 @@ spec: { "current": { "selected": false, - "text": "rds-test-01-tncc2", - "value": "rds-test-01-tncc2" + "text": "s3-audit-bucket-1-kpfnk", + "value": "s3-audit-bucket-1-kpfnk" }, "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" }, - "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels", + "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels{label_crossplane_io_claim_name=\"$claim_name\"}", "description": "The name of the Crossplane composite resource (XR) that was created from a claim.", "hide": 0, "includeAll": false, @@ -497,7 +925,7 @@ spec: "name": "composite_name", "options": [], "query": { - "query": "kubernetes_crossplane_io_Object_v1alpha1_labels", + "query": "kubernetes_crossplane_io_Object_v1alpha1_labels{label_crossplane_io_claim_name=\"$claim_name\"}", "refId": "StandardVariableQuery" }, "refresh": 1, @@ -508,35 +936,7 @@ spec: }, { "current": { - "selected": false, - "text": "crossplane-system", - "value": "crossplane-system" - }, - "description": "The Kubernetes namespace where providers and Crossplane pods reside.", - "hide": 0, - "includeAll": false, - "label": "Provider Namespace", - "multi": false, - "name": "provider_namespace", - "options": [ - { - "selected": true, - "text": "crossplane-system", - "value": "crossplane-system" - }, - { - "selected": false, - "text": "upbound-system", - "value": "upbound-system" - } - ], - "query": "crossplane-system,upbound-system", - "skipUrlSync": false, - "type": "custom" - }, - { - "current": { - "selected": false, + "selected": true, "text": "true", "value": "true" }, @@ -564,6 +964,7 @@ spec: } ], "query": "true, false, other\n", + "queryValue": "", "skipUrlSync": false, "type": "custom" }, @@ -597,14 +998,15 @@ spec: } ], "query": "true, false, other", + "queryValue": "", "skipUrlSync": false, "type": "custom" }, { "current": { - "selected": false, - "text": "0.5", - "value": "0.5" + "selected": true, + "text": "0.95", + "value": "0.95" }, "description": "Each of a set of values of a variate which divide the frequency distribution into equal groups.", "hide": 0, @@ -614,7 +1016,7 @@ spec: "name": "quantile", "options": [ { - "selected": true, + "selected": false, "text": "0.5", "value": "0.5" }, @@ -629,7 +1031,7 @@ spec: "value": "0.9" }, { - "selected": false, + "selected": true, "text": "0.95", "value": "0.95" }, @@ -645,18 +1047,19 @@ spec: } ], "query": "0.5,0.75,0.9,0.95,0.99,100", + "queryValue": "", "skipUrlSync": false, "type": "custom" }, { "current": { - "selected": false, - "text": "", - "value": "" + "selected": true, + "text": "s3.aws.upbound.io", + "value": "s3.aws.upbound.io" }, "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" }, "definition": "query_result(upjet_resource_ttr_bucket)", "description": "API group.", @@ -679,15 +1082,43 @@ spec: { "current": { "selected": false, - "text": "", - "value": "" + "text": "v1beta1", + "value": "v1beta1" }, "datasource": { "type": "prometheus", - "uid": "prometheus" + "uid": "PBFA97CFB590B2093" }, - "definition": "query_result(upjet_resource_ttr_bucket)", - "description": "The kind of the resource.", + "definition": "query_result(upjet_resource_ttr_bucket{group=\"$group\"})", + "description": "API version.", + "hide": 0, + "includeAll": false, + "label": "version", + "multi": false, + "name": "version", + "options": [], + "query": { + "query": "query_result(upjet_resource_ttr_bucket{group=\"$group\"})", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/version=\\\"([^\\\"]+)\\\"/", + "skipUrlSync": false, + "sort": 0, + "type": "query" + }, + { + "current": { + "selected": true, + "text": "BucketPublicAccessBlock", + "value": "BucketPublicAccessBlock" + }, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "definition": "query_result(upjet_resource_ttr_bucket{group=\"$group\"})", + "description": "kind.", "hide": 0, "includeAll": false, "label": "kind", @@ -695,18 +1126,50 @@ spec: "name": "kind", "options": [], "query": { - "query": "query_result(upjet_resource_ttr_bucket)", + "query": "query_result(upjet_resource_ttr_bucket{group=\"$group\"})", "refId": "StandardVariableQuery" }, "refresh": 1, - "regex": "", + "regex": "/kind=\\\"([^\\\"]+)\\\"/", "skipUrlSync": false, - "sort": 1, + "sort": 0, "type": "query" }, { "current": { "selected": false, + "text": [ + "" + ], + "value": [ + "" + ] + }, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "definition": "upjet_resource_ttr_bucket{group=\"$group\",kind=\"$kind\",version=\"$version\"}", + "description": "Less equal.", + "hide": 0, + "includeAll": false, + "label": "le", + "multi": true, + "name": "le", + "options": [], + "query": { + "query": "upjet_resource_ttr_bucket{group=\"$group\",kind=\"$kind\",version=\"$version\"}", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/le=\\\"([^\\\"]+)\\\"/", + "skipUrlSync": false, + "sort": 3, + "type": "query" + }, + { + "current": { + "selected": true, "text": "2m", "value": "2m" }, @@ -734,18 +1197,77 @@ spec: } ], "query": "2m, 5m, 10m", + "queryValue": "", + "skipUrlSync": false, + "type": "custom" + }, + { + "current": { + "selected": true, + "text": "crossplane-system", + "value": "crossplane-system" + }, + "description": "The Kubernetes namespace where providers and Crossplane pods reside.", + "hide": 0, + "includeAll": false, + "label": "Provider Namespace", + "multi": false, + "name": "provider_namespace", + "options": [ + { + "selected": true, + "text": "crossplane-system", + "value": "crossplane-system" + }, + { + "selected": false, + "text": "upbound-system", + "value": "upbound-system" + } + ], + "query": "crossplane-system,upbound-system", + "queryValue": "", "skipUrlSync": false, "type": "custom" + }, + { + "current": { + "selected": true, + "text": "upbound-metric-sample", + "value": "upbound-metric-sample" + }, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "definition": "metrics_crossplane_io_ClusterMetric_v1", + "description": "Cluster Metric Samples", + "hide": 0, + "includeAll": false, + "label": "Cluster Metric Samples", + "multi": false, + "name": "cluster_metric_samples", + "options": [], + "query": { + "query": "metrics_crossplane_io_ClusterMetric_v1", + "refId": "StandardVariableQuery" + }, + "refresh": 1, + "regex": "/,name=\\\"([^\\\"]+)\\\"/", + "skipUrlSync": false, + "sort": 1, + "type": "query" } ] }, "time": { - "from": "now-30m", + "from": "now-5m", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Crossplane Top Level View", - "version": 5, + "uid": "sg0yFc4Ik", + "version": 15, "weekStart": "" } From 96db29ffacfb5ae76b9519fe53a3e3d27fccf6ff Mon Sep 17 00:00:00 2001 From: humoflife Date: Fri, 3 Nov 2023 19:37:50 -0700 Subject: [PATCH 07/29] added new line to yaml --- examples/folder-grafana.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/folder-grafana.yaml b/examples/folder-grafana.yaml index c88dee1..1c39931 100644 --- a/examples/folder-grafana.yaml +++ b/examples/folder-grafana.yaml @@ -4,4 +4,5 @@ metadata: name: configuration-observability-oss spec: forProvider: - title: 'Dashboards' \ No newline at end of file + title: 'Dashboards' + From ec5c873bd0d50d8cd144a53614dd02a3dff5f4fa Mon Sep 17 00:00:00 2001 From: humoflife Date: Mon, 6 Nov 2023 13:21:22 -0800 Subject: [PATCH 08/29] moved patch for deterministic dashboard creation --- apis/oss/composition.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apis/oss/composition.yaml b/apis/oss/composition.yaml index 1b6d7f2..5da6814 100644 --- a/apis/oss/composition.yaml +++ b/apis/oss/composition.yaml @@ -134,6 +134,12 @@ spec: patchSetName: common - fromFieldPath: spec.parameters.id toFieldPath: metadata.name + - fromFieldPath: metadata.labels + toFieldPath: metadata.labels + - fromFieldPath: metadata.annotations + toFieldPath: metadata.annotations + - fromFieldPath: spec.parameters.operators.prometheus.version + toFieldPath: spec.forProvider.chart.version - fromFieldPath: spec.parameters.id toFieldPath: metadata.annotations[crossplane.io/external-name] transforms: @@ -143,12 +149,6 @@ spec: - type: regexp regexp: '.*' result: oss - - fromFieldPath: metadata.labels - toFieldPath: metadata.labels - - fromFieldPath: metadata.annotations - toFieldPath: metadata.annotations - - fromFieldPath: spec.parameters.operators.prometheus.version - toFieldPath: spec.forProvider.chart.version - name: usagePrometheusByPodMonitorCrossplaneRbacManager base: From 7be531076ee1a31f1be6ec37bf278964bfb6cc7d Mon Sep 17 00:00:00 2001 From: humoflife Date: Mon, 6 Nov 2023 13:21:22 -0800 Subject: [PATCH 09/29] moved patch for deterministic dashboard creation --- apis/oss/composition.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apis/oss/composition.yaml b/apis/oss/composition.yaml index 1b6d7f2..5da6814 100644 --- a/apis/oss/composition.yaml +++ b/apis/oss/composition.yaml @@ -134,6 +134,12 @@ spec: patchSetName: common - fromFieldPath: spec.parameters.id toFieldPath: metadata.name + - fromFieldPath: metadata.labels + toFieldPath: metadata.labels + - fromFieldPath: metadata.annotations + toFieldPath: metadata.annotations + - fromFieldPath: spec.parameters.operators.prometheus.version + toFieldPath: spec.forProvider.chart.version - fromFieldPath: spec.parameters.id toFieldPath: metadata.annotations[crossplane.io/external-name] transforms: @@ -143,12 +149,6 @@ spec: - type: regexp regexp: '.*' result: oss - - fromFieldPath: metadata.labels - toFieldPath: metadata.labels - - fromFieldPath: metadata.annotations - toFieldPath: metadata.annotations - - fromFieldPath: spec.parameters.operators.prometheus.version - toFieldPath: spec.forProvider.chart.version - name: usagePrometheusByPodMonitorCrossplaneRbacManager base: From aca5877fb284802d9077abb191f1a606eae2ab2f Mon Sep 17 00:00:00 2001 From: humoflife Date: Mon, 6 Nov 2023 14:45:40 -0800 Subject: [PATCH 10/29] dashboard update --- Makefile | 2 +- README.md | 14 +++++ ...ashboard-grafana-crossplane-top-level.yaml | 61 +++++++++---------- 3 files changed, 45 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index 18f8c41..b71aa54 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ build.init: $(UP) # You can check the basic implementation here: https://github.com/upbound/uptest/blob/main/internal/templates/01-delete.yaml.tmpl. uptest: $(UPTEST) $(KUBECTL) $(KUTTL) @$(INFO) running automated tests - @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/folder-grafana.yaml,examples/dashboard-grafana-crossplane-health.yaml,examples/dashboard-grafana-crossplane-mr.yaml,examples/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboard-grafana-crossplane-sli-metrics.yaml,examples/oss.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL) + @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/folder-grafana.yaml,examples/dashboard-grafana-crossplane-health.yaml,examples/dashboard-grafana-crossplane-mr.yaml,examples/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboard-grafana-crossplane-sli-metrics.yaml,examples/dashboard-grafana-crossplane-top-level.yaml,examples/dashboard-grafana-crossplane-xmetrics.yaml,examples/oss.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL) @$(OK) running automated tests # This target requires the following environment variables to be set: diff --git a/README.md b/README.md index e8e27fe..15e2600 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,20 @@ with open source software integrations such as Prometheus and Grafana. Observability is a measure of how well platform performance can be inferred from knowledge of its metrics, logs and traces outputs. +**Warning** +## Disclaimer: Management Cluster Resource Use +Prometheus and Grafana may require significant cluster resources in relation +to the amount of metrics scraped, processed and visualized. This may impact +cluster operations. Consult the respective Prometheus Operator and +Grafana documentation for set up guidance prior to using this configuration +on mission critical Crossplane management clusters. + +**Warning** +## Disclaimer: Metric Stability +Crossplane has no concept of metric stability. This implies +that metrics used in this configuration may be absent in future versions +of Crossplane and / or its providers. + ## Purpose The goal for configuration-observability-oss is to complement other configurations such as configuration-caas. See the diff --git a/examples/dashboard-grafana-crossplane-top-level.yaml b/examples/dashboard-grafana-crossplane-top-level.yaml index dec4cc6..6309ffe 100644 --- a/examples/dashboard-grafana-crossplane-top-level.yaml +++ b/examples/dashboard-grafana-crossplane-top-level.yaml @@ -53,7 +53,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "description": "", "fieldConfig": { @@ -102,7 +102,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "sum(tf_upbound_io_Workspace_v1beta1) + sum(tf_upbound_io_ProviderConfig_v1beta1) + sum(kubernetes_crossplane_io_Object_v1alpha1) + sum(kms_aws_upbound_io_Alias_v1beta1) + sum(lambda_aws_upbound_io_Invocation_v1beta1) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1)", @@ -118,7 +118,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -166,7 +166,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "sum(tf_upbound_io_Workspace_v1beta1_synced) + sum(tf_upbound_io_ProviderConfig_v1beta1_synced) + sum(kubernetes_crossplane_io_Object_v1alpha1_synced) + sum(kms_aws_upbound_io_Alias_v1beta1_synced) + sum(lambda_aws_upbound_io_Invocation_v1beta1_synced) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1_synced)", @@ -181,7 +181,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -229,7 +229,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "sum(tf_upbound_io_Workspace_v1beta1_ready) + sum(tf_upbound_io_ProviderConfig_v1beta1_ready) + sum(kubernetes_crossplane_io_Object_v1alpha1_ready) + sum(kms_aws_upbound_io_Alias_v1beta1_ready) + sum(lambda_aws_upbound_io_Invocation_v1beta1_ready) + sum(rds_aws_upbound_io_ClusterParameterGroup_v1beta1_ready)", @@ -244,7 +244,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -292,7 +292,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "count(apiextensions_crossplane_io_CompositeResourceDefinition_v1)", @@ -307,7 +307,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -355,7 +355,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "count(apiextensions_crossplane_io_CompositeResourceDefinition_v1_synced)", @@ -370,7 +370,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -418,7 +418,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "count(apiextensions_crossplane_io_CompositeResourceDefinition_v1_ready)", @@ -433,7 +433,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -481,7 +481,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "count(pkg_crossplane_io_ProviderRevision_v1)", @@ -496,7 +496,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "fieldConfig": { "defaults": { @@ -544,7 +544,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "upjet_resource_ttr_count{group=\"$group\",version=\"$version\",kind=\"$kind\"}", @@ -559,7 +559,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "description": "TTR Sum in Minutes.", "fieldConfig": { @@ -608,7 +608,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "expr": "upjet_resource_ttr_sum{group=\"$group\",version=\"$version\",kind=\"$kind\"}/60", @@ -636,7 +636,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "description": "Preferred query:\nhistogram_quantile($quantile, sum(rate(upjet_resource_ttr_bucket{group=\"$group\",version=\"$version\",kind=\"$kind\"}[$interval])) by (le))", "fieldConfig": { @@ -715,7 +715,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "exemplar": true, @@ -735,7 +735,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "description": "", "fieldConfig": { @@ -816,7 +816,7 @@ spec: { "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "editorMode": "code", "exemplar": true, @@ -858,7 +858,7 @@ spec: }, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels", "description": "The Kubernetes namespace where the Crossplane resource claim was applied.", @@ -886,7 +886,7 @@ spec: }, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels{label_crossplane_io_claim_namespace=\"$claim_namespace\"}", "description": "The name of the Crossplane resource claim.", @@ -914,7 +914,7 @@ spec: }, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "definition": "kubernetes_crossplane_io_Object_v1alpha1_labels{label_crossplane_io_claim_name=\"$claim_name\"}", "description": "The name of the Crossplane composite resource (XR) that was created from a claim.", @@ -1059,7 +1059,7 @@ spec: }, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "definition": "query_result(upjet_resource_ttr_bucket)", "description": "API group.", @@ -1087,7 +1087,7 @@ spec: }, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "definition": "query_result(upjet_resource_ttr_bucket{group=\"$group\"})", "description": "API version.", @@ -1115,7 +1115,7 @@ spec: }, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "definition": "query_result(upjet_resource_ttr_bucket{group=\"$group\"})", "description": "kind.", @@ -1147,7 +1147,7 @@ spec: }, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "definition": "upjet_resource_ttr_bucket{group=\"$group\",kind=\"$kind\",version=\"$version\"}", "description": "Less equal.", @@ -1238,7 +1238,7 @@ spec: }, "datasource": { "type": "prometheus", - "uid": "PBFA97CFB590B2093" + "uid": "prometheus" }, "definition": "metrics_crossplane_io_ClusterMetric_v1", "description": "Cluster Metric Samples", @@ -1267,7 +1267,6 @@ spec: "timepicker": {}, "timezone": "", "title": "Crossplane Top Level View", - "uid": "sg0yFc4Ik", "version": 15, "weekStart": "" } From 884713b646c2d194b6e2c07d24a6ee6fd2ed1da2 Mon Sep 17 00:00:00 2001 From: humoflife Date: Mon, 30 Oct 2023 21:37:51 -0700 Subject: [PATCH 11/29] added x-metrics pod monitor --- apis/oss/composition.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/apis/oss/composition.yaml b/apis/oss/composition.yaml index 5da6814..cba5da9 100644 --- a/apis/oss/composition.yaml +++ b/apis/oss/composition.yaml @@ -110,6 +110,31 @@ spec: - type: PatchSet patchSetName: common + - name: podMonitorXmetrics + base: + apiVersion: kubernetes.crossplane.io/v1alpha1 + kind: Object + spec: + forProvider: + manifest: + apiVersion: monitoring.coreos.com/v1 + kind: PodMonitor + metadata: + name: x-metrics + namespace: x-metrics + labels: + app: x-metrics + spec: + selector: + matchLabels: + app: x-metrics + podMetricsEndpoints: + - port: http-prom + path: /x-metrics + patches: + - type: PatchSet + patchSetName: common + - name: releasePrometheus base: apiVersion: helm.crossplane.io/v1beta1 From dab3b010f4c0e231431e49d777a6cbb4e1298b45 Mon Sep 17 00:00:00 2001 From: humoflife Date: Tue, 7 Nov 2023 09:13:50 -0800 Subject: [PATCH 12/29] added usage --- apis/oss/composition.yaml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/apis/oss/composition.yaml b/apis/oss/composition.yaml index cba5da9..acbb115 100644 --- a/apis/oss/composition.yaml +++ b/apis/oss/composition.yaml @@ -121,16 +121,19 @@ spec: kind: PodMonitor metadata: name: x-metrics - namespace: x-metrics + namespace: operators labels: app: x-metrics spec: + namespaceSelector: + matchNames: + - x-metrics selector: matchLabels: app: x-metrics podMetricsEndpoints: - port: http-prom - path: /x-metrics + path: "/x-metrics" patches: - type: PatchSet patchSetName: common @@ -175,6 +178,24 @@ spec: regexp: '.*' result: oss + - name: usagePrometheusByPodMonitorXmetrics + base: + apiVersion: apiextensions.crossplane.io/v1alpha1 + kind: Usage + spec: + of: + apiVersion: helm.crossplane.io/v1beta1 + kind: Release + resourceSelector: + matchControllerRef: true + by: + apiVersion: kubernetes.crossplane.io/v1alpha1 + kind: Object + resourceSelector: + matchControllerRef: true + matchLabels: + type: podMonitorXmetrics + - name: usagePrometheusByPodMonitorCrossplaneRbacManager base: apiVersion: apiextensions.crossplane.io/v1alpha1 From 86ed1a41eb9619a216a0b7a1473a4395cf548fd8 Mon Sep 17 00:00:00 2001 From: humoflife Date: Tue, 7 Nov 2023 13:28:40 -0800 Subject: [PATCH 13/29] x-metrics port name is metrics --- apis/oss/composition.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apis/oss/composition.yaml b/apis/oss/composition.yaml index acbb115..d1b49ac 100644 --- a/apis/oss/composition.yaml +++ b/apis/oss/composition.yaml @@ -22,7 +22,7 @@ spec: apiVersion: kubernetes.crossplane.io/v1alpha1 kind: Object metadata: - labels: + labels: type: podMonitorCrossplaneRbacManager spec: forProvider: @@ -53,7 +53,7 @@ spec: apiVersion: kubernetes.crossplane.io/v1alpha1 kind: Object metadata: - labels: + labels: type: podMonitorCrossplane spec: forProvider: @@ -84,7 +84,7 @@ spec: apiVersion: kubernetes.crossplane.io/v1alpha1 kind: Object metadata: - labels: + labels: type: podMonitorCrossplaneProviders spec: forProvider: @@ -114,6 +114,9 @@ spec: base: apiVersion: kubernetes.crossplane.io/v1alpha1 kind: Object + metadata: + labels: + type: podMonitorXmetrics spec: forProvider: manifest: @@ -127,12 +130,14 @@ spec: spec: namespaceSelector: matchNames: + - crossplane-system + - upbound-system - x-metrics selector: matchLabels: app: x-metrics podMetricsEndpoints: - - port: http-prom + - port: metrics path: "/x-metrics" patches: - type: PatchSet From f16fb4e86abb97eb29d271feec21ffe5a614ece9 Mon Sep 17 00:00:00 2001 From: humoflife Date: Tue, 7 Nov 2023 15:57:27 -0800 Subject: [PATCH 14/29] added x-metrics install --- Makefile | 2 +- apis/oss/composition.yaml | 16 ++++++++++++++++ examples/xmetrics.yaml | 22 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 examples/xmetrics.yaml diff --git a/Makefile b/Makefile index b71aa54..82c7d3b 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ build.init: $(UP) # You can check the basic implementation here: https://github.com/upbound/uptest/blob/main/internal/templates/01-delete.yaml.tmpl. uptest: $(UPTEST) $(KUBECTL) $(KUTTL) @$(INFO) running automated tests - @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/folder-grafana.yaml,examples/dashboard-grafana-crossplane-health.yaml,examples/dashboard-grafana-crossplane-mr.yaml,examples/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboard-grafana-crossplane-sli-metrics.yaml,examples/dashboard-grafana-crossplane-top-level.yaml,examples/dashboard-grafana-crossplane-xmetrics.yaml,examples/oss.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL) + @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/folder-grafana.yaml,examples/dashboard-grafana-crossplane-health.yaml,examples/dashboard-grafana-crossplane-mr.yaml,examples/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboard-grafana-crossplane-sli-metrics.yaml,examples/dashboard-grafana-crossplane-top-level.yaml,examples/dashboard-grafana-crossplane-xmetrics.yaml,examples/oss.yaml,examples/xmetrics.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL) @$(OK) running automated tests # This target requires the following environment variables to be set: diff --git a/apis/oss/composition.yaml b/apis/oss/composition.yaml index d1b49ac..f35a43e 100644 --- a/apis/oss/composition.yaml +++ b/apis/oss/composition.yaml @@ -254,3 +254,19 @@ spec: matchControllerRef: true matchLabels: type: podMonitorCrossplaneProviders + + - name: releaseXMetrics + base: + apiVersion: helm.crossplane.io/v1beta1 + kind: Release + spec: + rollbackLimit: 3 + forProvider: + namespace: x-metrics + chart: + name: x-metrics + repository: https://crossplane-contrib.github.io/x-metrics + version: "0.1.3" + patches: + - type: PatchSet + patchSetName: common diff --git a/examples/xmetrics.yaml b/examples/xmetrics.yaml new file mode 100644 index 0000000..6ebdd1e --- /dev/null +++ b/examples/xmetrics.yaml @@ -0,0 +1,22 @@ +--- +apiVersion: metrics.crossplane.io/v1 +kind: ClusterMetric +metadata: + name: clustermetric-sample +spec: + matchName: ".crossplane.io" +--- +apiVersion: metrics.crossplane.io/v1 +kind: Metric +metadata: + name: metric-sample + namespace: upbound-system +spec: + matchName: "metrics.metrics.crossplane.io" +--- +apiVersion: metrics.crossplane.io/v1 +kind: ClusterMetric +metadata: + name: upbound-metric-sample +spec: + matchName: ".upbound.io" From b68c3967d2e43a22c18382df0766ff4033a3e398 Mon Sep 17 00:00:00 2001 From: humoflife Date: Tue, 7 Nov 2023 16:13:08 -0800 Subject: [PATCH 15/29] updated Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 82c7d3b..b71aa54 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ build.init: $(UP) # You can check the basic implementation here: https://github.com/upbound/uptest/blob/main/internal/templates/01-delete.yaml.tmpl. uptest: $(UPTEST) $(KUBECTL) $(KUTTL) @$(INFO) running automated tests - @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/folder-grafana.yaml,examples/dashboard-grafana-crossplane-health.yaml,examples/dashboard-grafana-crossplane-mr.yaml,examples/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboard-grafana-crossplane-sli-metrics.yaml,examples/dashboard-grafana-crossplane-top-level.yaml,examples/dashboard-grafana-crossplane-xmetrics.yaml,examples/oss.yaml,examples/xmetrics.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL) + @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/folder-grafana.yaml,examples/dashboard-grafana-crossplane-health.yaml,examples/dashboard-grafana-crossplane-mr.yaml,examples/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboard-grafana-crossplane-sli-metrics.yaml,examples/dashboard-grafana-crossplane-top-level.yaml,examples/dashboard-grafana-crossplane-xmetrics.yaml,examples/oss.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL) @$(OK) running automated tests # This target requires the following environment variables to be set: From 7d199f6add04713d4245eeac8c49b3f12eaced4f Mon Sep 17 00:00:00 2001 From: humoflife Date: Tue, 7 Nov 2023 16:56:06 -0800 Subject: [PATCH 16/29] updated README.md and moved dashboards --- Makefile | 2 +- README.md | 22 +++++++++---------- .../dashboard-grafana-crossplane-health.yaml | 0 .../dashboard-grafana-crossplane-mr.yaml | 0 ...oard-grafana-crossplane-resources-ttr.yaml | 0 ...hboard-grafana-crossplane-sli-metrics.yaml | 0 ...ashboard-grafana-crossplane-top-level.yaml | 0 ...dashboard-grafana-crossplane-xmetrics.yaml | 0 examples/{ => dashboards}/folder-grafana.yaml | 0 9 files changed, 12 insertions(+), 12 deletions(-) rename examples/{ => dashboards}/dashboard-grafana-crossplane-health.yaml (100%) rename examples/{ => dashboards}/dashboard-grafana-crossplane-mr.yaml (100%) rename examples/{ => dashboards}/dashboard-grafana-crossplane-resources-ttr.yaml (100%) rename examples/{ => dashboards}/dashboard-grafana-crossplane-sli-metrics.yaml (100%) rename examples/{ => dashboards}/dashboard-grafana-crossplane-top-level.yaml (100%) rename examples/{ => dashboards}/dashboard-grafana-crossplane-xmetrics.yaml (100%) rename examples/{ => dashboards}/folder-grafana.yaml (100%) diff --git a/Makefile b/Makefile index b71aa54..dd431a3 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ build.init: $(UP) # You can check the basic implementation here: https://github.com/upbound/uptest/blob/main/internal/templates/01-delete.yaml.tmpl. uptest: $(UPTEST) $(KUBECTL) $(KUTTL) @$(INFO) running automated tests - @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/folder-grafana.yaml,examples/dashboard-grafana-crossplane-health.yaml,examples/dashboard-grafana-crossplane-mr.yaml,examples/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboard-grafana-crossplane-sli-metrics.yaml,examples/dashboard-grafana-crossplane-top-level.yaml,examples/dashboard-grafana-crossplane-xmetrics.yaml,examples/oss.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL) + @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/dashboards/folder-grafana.yaml,examples/dashboards/dashboard-grafana-crossplane-health.yaml,examples/dashboards/dashboard-grafana-crossplane-mr.yaml,examples/dashboards/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboards/dashboard-grafana-crossplane-sli-metrics.yaml,examples/dashboards/dashboard-grafana-crossplane-top-level.yaml,examples/dashboards/dashboard-grafana-crossplane-xmetrics.yaml,examples/oss.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL) @$(OK) running automated tests # This target requires the following environment variables to be set: diff --git a/README.md b/README.md index 15e2600..7649c03 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,17 @@ at the conclusion of the tests by default. Apply the resource claim as follows to re-create the namespace, Prometheus, Grafana and dependencies for further -exploration. +exploration. Note that the xmetrics configuration examples +rely on the CRDs to be installed through the oss composition +first. ``` kubectl apply -f examples/oss.yaml +kubectl apply -f examples/dashboards +``` +Wait until xmetrics CRDs have been installed, then apply +the xmetrics configuration to see metrics flowing. +``` +kubectl apply -f examples/xmetrics.yaml ``` To load dashboards that are part of this configuration repository, @@ -51,20 +59,12 @@ kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-sli-metrics.ya Use the following to forward localhost:9090 to the Prometheus pod. ``` -PROMETHEUS_POD_NAME=$(k -n operators get pods|\ - awk '{print $1}'|\ - tail +2|\ - grep prometheus-0) -kubectl -n operators port-forward ${PROMETHEUS_POD_NAME} 9090 +kubectl -n operators port-forward prometheus-oss-kube-prometheus-stack-prometheus-0 9090 ``` Use the following to forward localhost:3000 to the Grafana pod. ``` -GRAFANA_POD_NAME=$(k -n operators get pods|\ - awk '{print $1}'|\ - tail +2|\ - grep grafana) -kubectl -n operators port-forward ${GRAFANA_POD_NAME} 3000 +kubectl -n operators port-forward svc/oss-grafana 3000:80 ``` Log in to Grafana at http://localhost:3000 with the credentials diff --git a/examples/dashboard-grafana-crossplane-health.yaml b/examples/dashboards/dashboard-grafana-crossplane-health.yaml similarity index 100% rename from examples/dashboard-grafana-crossplane-health.yaml rename to examples/dashboards/dashboard-grafana-crossplane-health.yaml diff --git a/examples/dashboard-grafana-crossplane-mr.yaml b/examples/dashboards/dashboard-grafana-crossplane-mr.yaml similarity index 100% rename from examples/dashboard-grafana-crossplane-mr.yaml rename to examples/dashboards/dashboard-grafana-crossplane-mr.yaml diff --git a/examples/dashboard-grafana-crossplane-resources-ttr.yaml b/examples/dashboards/dashboard-grafana-crossplane-resources-ttr.yaml similarity index 100% rename from examples/dashboard-grafana-crossplane-resources-ttr.yaml rename to examples/dashboards/dashboard-grafana-crossplane-resources-ttr.yaml diff --git a/examples/dashboard-grafana-crossplane-sli-metrics.yaml b/examples/dashboards/dashboard-grafana-crossplane-sli-metrics.yaml similarity index 100% rename from examples/dashboard-grafana-crossplane-sli-metrics.yaml rename to examples/dashboards/dashboard-grafana-crossplane-sli-metrics.yaml diff --git a/examples/dashboard-grafana-crossplane-top-level.yaml b/examples/dashboards/dashboard-grafana-crossplane-top-level.yaml similarity index 100% rename from examples/dashboard-grafana-crossplane-top-level.yaml rename to examples/dashboards/dashboard-grafana-crossplane-top-level.yaml diff --git a/examples/dashboard-grafana-crossplane-xmetrics.yaml b/examples/dashboards/dashboard-grafana-crossplane-xmetrics.yaml similarity index 100% rename from examples/dashboard-grafana-crossplane-xmetrics.yaml rename to examples/dashboards/dashboard-grafana-crossplane-xmetrics.yaml diff --git a/examples/folder-grafana.yaml b/examples/dashboards/folder-grafana.yaml similarity index 100% rename from examples/folder-grafana.yaml rename to examples/dashboards/folder-grafana.yaml From ac0453eb90365005ada1a8cb5f881ae218f2b8e7 Mon Sep 17 00:00:00 2001 From: humoflife Date: Tue, 7 Nov 2023 17:14:29 -0800 Subject: [PATCH 17/29] updated README.md --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 7649c03..580172f 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,6 @@ rely on the CRDs to be installed through the oss composition first. ``` kubectl apply -f examples/oss.yaml -kubectl apply -f examples/dashboards ``` Wait until xmetrics CRDs have been installed, then apply the xmetrics configuration to see metrics flowing. @@ -50,11 +49,7 @@ kubectl apply -f examples/xmetrics.yaml To load dashboards that are part of this configuration repository, please apply the following dashboard resource claims. ``` -kubectl apply -f examples/dashboards/folder-grafana.yaml -kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-health.yaml -kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-mr.yaml -kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-resources-ttr.yaml -kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-sli-metrics.yaml +kubectl apply -f examples/dashboards ``` Use the following to forward localhost:9090 to the Prometheus pod. From 9ba87a6e65148c6bd7f079d4d22a142816d0cc51 Mon Sep 17 00:00:00 2001 From: humoflife Date: Mon, 13 Nov 2023 16:38:15 -0800 Subject: [PATCH 18/29] updated Makefile --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index dd431a3..4bce84c 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,8 @@ PLATFORMS ?= linux_amd64 UP_VERSION = v0.21.0 UP_CHANNEL = stable UPTEST_VERSION = v0.6.1 +UXP_INSTALL_OPTS = "--unstable" +UXP_VERSION = 1.14.0-up.1.rc.2" -include build/makelib/k8s_tools.mk # ==================================================================================== From 10b18ff5ff007785548dca23dcd422151b2c1f70 Mon Sep 17 00:00:00 2001 From: humoflife Date: Tue, 7 Nov 2023 09:13:50 -0800 Subject: [PATCH 19/29] added usage --- apis/oss/composition.yaml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/apis/oss/composition.yaml b/apis/oss/composition.yaml index cba5da9..acbb115 100644 --- a/apis/oss/composition.yaml +++ b/apis/oss/composition.yaml @@ -121,16 +121,19 @@ spec: kind: PodMonitor metadata: name: x-metrics - namespace: x-metrics + namespace: operators labels: app: x-metrics spec: + namespaceSelector: + matchNames: + - x-metrics selector: matchLabels: app: x-metrics podMetricsEndpoints: - port: http-prom - path: /x-metrics + path: "/x-metrics" patches: - type: PatchSet patchSetName: common @@ -175,6 +178,24 @@ spec: regexp: '.*' result: oss + - name: usagePrometheusByPodMonitorXmetrics + base: + apiVersion: apiextensions.crossplane.io/v1alpha1 + kind: Usage + spec: + of: + apiVersion: helm.crossplane.io/v1beta1 + kind: Release + resourceSelector: + matchControllerRef: true + by: + apiVersion: kubernetes.crossplane.io/v1alpha1 + kind: Object + resourceSelector: + matchControllerRef: true + matchLabels: + type: podMonitorXmetrics + - name: usagePrometheusByPodMonitorCrossplaneRbacManager base: apiVersion: apiextensions.crossplane.io/v1alpha1 From e98005076682474f11e3aa119ccdbf15717dc715 Mon Sep 17 00:00:00 2001 From: humoflife Date: Tue, 7 Nov 2023 13:28:40 -0800 Subject: [PATCH 20/29] x-metrics port name is metrics --- apis/oss/composition.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apis/oss/composition.yaml b/apis/oss/composition.yaml index acbb115..d1b49ac 100644 --- a/apis/oss/composition.yaml +++ b/apis/oss/composition.yaml @@ -22,7 +22,7 @@ spec: apiVersion: kubernetes.crossplane.io/v1alpha1 kind: Object metadata: - labels: + labels: type: podMonitorCrossplaneRbacManager spec: forProvider: @@ -53,7 +53,7 @@ spec: apiVersion: kubernetes.crossplane.io/v1alpha1 kind: Object metadata: - labels: + labels: type: podMonitorCrossplane spec: forProvider: @@ -84,7 +84,7 @@ spec: apiVersion: kubernetes.crossplane.io/v1alpha1 kind: Object metadata: - labels: + labels: type: podMonitorCrossplaneProviders spec: forProvider: @@ -114,6 +114,9 @@ spec: base: apiVersion: kubernetes.crossplane.io/v1alpha1 kind: Object + metadata: + labels: + type: podMonitorXmetrics spec: forProvider: manifest: @@ -127,12 +130,14 @@ spec: spec: namespaceSelector: matchNames: + - crossplane-system + - upbound-system - x-metrics selector: matchLabels: app: x-metrics podMetricsEndpoints: - - port: http-prom + - port: metrics path: "/x-metrics" patches: - type: PatchSet From 8be1e6a90ec6ebc65b987cbdf1a449ab8329d743 Mon Sep 17 00:00:00 2001 From: humoflife Date: Tue, 7 Nov 2023 15:57:27 -0800 Subject: [PATCH 21/29] added x-metrics install --- Makefile | 2 +- apis/oss/composition.yaml | 16 ++++++++++++++++ examples/xmetrics.yaml | 22 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 examples/xmetrics.yaml diff --git a/Makefile b/Makefile index b71aa54..82c7d3b 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ build.init: $(UP) # You can check the basic implementation here: https://github.com/upbound/uptest/blob/main/internal/templates/01-delete.yaml.tmpl. uptest: $(UPTEST) $(KUBECTL) $(KUTTL) @$(INFO) running automated tests - @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/folder-grafana.yaml,examples/dashboard-grafana-crossplane-health.yaml,examples/dashboard-grafana-crossplane-mr.yaml,examples/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboard-grafana-crossplane-sli-metrics.yaml,examples/dashboard-grafana-crossplane-top-level.yaml,examples/dashboard-grafana-crossplane-xmetrics.yaml,examples/oss.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL) + @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/folder-grafana.yaml,examples/dashboard-grafana-crossplane-health.yaml,examples/dashboard-grafana-crossplane-mr.yaml,examples/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboard-grafana-crossplane-sli-metrics.yaml,examples/dashboard-grafana-crossplane-top-level.yaml,examples/dashboard-grafana-crossplane-xmetrics.yaml,examples/oss.yaml,examples/xmetrics.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL) @$(OK) running automated tests # This target requires the following environment variables to be set: diff --git a/apis/oss/composition.yaml b/apis/oss/composition.yaml index d1b49ac..f35a43e 100644 --- a/apis/oss/composition.yaml +++ b/apis/oss/composition.yaml @@ -254,3 +254,19 @@ spec: matchControllerRef: true matchLabels: type: podMonitorCrossplaneProviders + + - name: releaseXMetrics + base: + apiVersion: helm.crossplane.io/v1beta1 + kind: Release + spec: + rollbackLimit: 3 + forProvider: + namespace: x-metrics + chart: + name: x-metrics + repository: https://crossplane-contrib.github.io/x-metrics + version: "0.1.3" + patches: + - type: PatchSet + patchSetName: common diff --git a/examples/xmetrics.yaml b/examples/xmetrics.yaml new file mode 100644 index 0000000..6ebdd1e --- /dev/null +++ b/examples/xmetrics.yaml @@ -0,0 +1,22 @@ +--- +apiVersion: metrics.crossplane.io/v1 +kind: ClusterMetric +metadata: + name: clustermetric-sample +spec: + matchName: ".crossplane.io" +--- +apiVersion: metrics.crossplane.io/v1 +kind: Metric +metadata: + name: metric-sample + namespace: upbound-system +spec: + matchName: "metrics.metrics.crossplane.io" +--- +apiVersion: metrics.crossplane.io/v1 +kind: ClusterMetric +metadata: + name: upbound-metric-sample +spec: + matchName: ".upbound.io" From d23526070ca63b0a3546a25ecd79937e3df46800 Mon Sep 17 00:00:00 2001 From: humoflife Date: Tue, 7 Nov 2023 16:13:08 -0800 Subject: [PATCH 22/29] updated Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 82c7d3b..b71aa54 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ build.init: $(UP) # You can check the basic implementation here: https://github.com/upbound/uptest/blob/main/internal/templates/01-delete.yaml.tmpl. uptest: $(UPTEST) $(KUBECTL) $(KUTTL) @$(INFO) running automated tests - @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/folder-grafana.yaml,examples/dashboard-grafana-crossplane-health.yaml,examples/dashboard-grafana-crossplane-mr.yaml,examples/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboard-grafana-crossplane-sli-metrics.yaml,examples/dashboard-grafana-crossplane-top-level.yaml,examples/dashboard-grafana-crossplane-xmetrics.yaml,examples/oss.yaml,examples/xmetrics.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL) + @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/folder-grafana.yaml,examples/dashboard-grafana-crossplane-health.yaml,examples/dashboard-grafana-crossplane-mr.yaml,examples/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboard-grafana-crossplane-sli-metrics.yaml,examples/dashboard-grafana-crossplane-top-level.yaml,examples/dashboard-grafana-crossplane-xmetrics.yaml,examples/oss.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL) @$(OK) running automated tests # This target requires the following environment variables to be set: From 1a9e31217354242f8f5a544f72e815a442ee7a5b Mon Sep 17 00:00:00 2001 From: humoflife Date: Tue, 7 Nov 2023 16:56:06 -0800 Subject: [PATCH 23/29] updated README.md and moved dashboards --- Makefile | 2 +- README.md | 22 +++++++++---------- .../dashboard-grafana-crossplane-health.yaml | 0 .../dashboard-grafana-crossplane-mr.yaml | 0 ...oard-grafana-crossplane-resources-ttr.yaml | 0 ...hboard-grafana-crossplane-sli-metrics.yaml | 0 ...ashboard-grafana-crossplane-top-level.yaml | 0 ...dashboard-grafana-crossplane-xmetrics.yaml | 0 examples/{ => dashboards}/folder-grafana.yaml | 0 9 files changed, 12 insertions(+), 12 deletions(-) rename examples/{ => dashboards}/dashboard-grafana-crossplane-health.yaml (100%) rename examples/{ => dashboards}/dashboard-grafana-crossplane-mr.yaml (100%) rename examples/{ => dashboards}/dashboard-grafana-crossplane-resources-ttr.yaml (100%) rename examples/{ => dashboards}/dashboard-grafana-crossplane-sli-metrics.yaml (100%) rename examples/{ => dashboards}/dashboard-grafana-crossplane-top-level.yaml (100%) rename examples/{ => dashboards}/dashboard-grafana-crossplane-xmetrics.yaml (100%) rename examples/{ => dashboards}/folder-grafana.yaml (100%) diff --git a/Makefile b/Makefile index b71aa54..dd431a3 100644 --- a/Makefile +++ b/Makefile @@ -69,7 +69,7 @@ build.init: $(UP) # You can check the basic implementation here: https://github.com/upbound/uptest/blob/main/internal/templates/01-delete.yaml.tmpl. uptest: $(UPTEST) $(KUBECTL) $(KUTTL) @$(INFO) running automated tests - @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/folder-grafana.yaml,examples/dashboard-grafana-crossplane-health.yaml,examples/dashboard-grafana-crossplane-mr.yaml,examples/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboard-grafana-crossplane-sli-metrics.yaml,examples/dashboard-grafana-crossplane-top-level.yaml,examples/dashboard-grafana-crossplane-xmetrics.yaml,examples/oss.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL) + @KUBECTL=$(KUBECTL) KUTTL=$(KUTTL) $(UPTEST) e2e examples/dashboards/folder-grafana.yaml,examples/dashboards/dashboard-grafana-crossplane-health.yaml,examples/dashboards/dashboard-grafana-crossplane-mr.yaml,examples/dashboards/dashboard-grafana-crossplane-resources-ttr.yaml,examples/dashboards/dashboard-grafana-crossplane-sli-metrics.yaml,examples/dashboards/dashboard-grafana-crossplane-top-level.yaml,examples/dashboards/dashboard-grafana-crossplane-xmetrics.yaml,examples/oss.yaml --setup-script=test/setup.sh --default-timeout=2400 || $(FAIL) @$(OK) running automated tests # This target requires the following environment variables to be set: diff --git a/README.md b/README.md index 15e2600..7649c03 100644 --- a/README.md +++ b/README.md @@ -34,9 +34,17 @@ at the conclusion of the tests by default. Apply the resource claim as follows to re-create the namespace, Prometheus, Grafana and dependencies for further -exploration. +exploration. Note that the xmetrics configuration examples +rely on the CRDs to be installed through the oss composition +first. ``` kubectl apply -f examples/oss.yaml +kubectl apply -f examples/dashboards +``` +Wait until xmetrics CRDs have been installed, then apply +the xmetrics configuration to see metrics flowing. +``` +kubectl apply -f examples/xmetrics.yaml ``` To load dashboards that are part of this configuration repository, @@ -51,20 +59,12 @@ kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-sli-metrics.ya Use the following to forward localhost:9090 to the Prometheus pod. ``` -PROMETHEUS_POD_NAME=$(k -n operators get pods|\ - awk '{print $1}'|\ - tail +2|\ - grep prometheus-0) -kubectl -n operators port-forward ${PROMETHEUS_POD_NAME} 9090 +kubectl -n operators port-forward prometheus-oss-kube-prometheus-stack-prometheus-0 9090 ``` Use the following to forward localhost:3000 to the Grafana pod. ``` -GRAFANA_POD_NAME=$(k -n operators get pods|\ - awk '{print $1}'|\ - tail +2|\ - grep grafana) -kubectl -n operators port-forward ${GRAFANA_POD_NAME} 3000 +kubectl -n operators port-forward svc/oss-grafana 3000:80 ``` Log in to Grafana at http://localhost:3000 with the credentials diff --git a/examples/dashboard-grafana-crossplane-health.yaml b/examples/dashboards/dashboard-grafana-crossplane-health.yaml similarity index 100% rename from examples/dashboard-grafana-crossplane-health.yaml rename to examples/dashboards/dashboard-grafana-crossplane-health.yaml diff --git a/examples/dashboard-grafana-crossplane-mr.yaml b/examples/dashboards/dashboard-grafana-crossplane-mr.yaml similarity index 100% rename from examples/dashboard-grafana-crossplane-mr.yaml rename to examples/dashboards/dashboard-grafana-crossplane-mr.yaml diff --git a/examples/dashboard-grafana-crossplane-resources-ttr.yaml b/examples/dashboards/dashboard-grafana-crossplane-resources-ttr.yaml similarity index 100% rename from examples/dashboard-grafana-crossplane-resources-ttr.yaml rename to examples/dashboards/dashboard-grafana-crossplane-resources-ttr.yaml diff --git a/examples/dashboard-grafana-crossplane-sli-metrics.yaml b/examples/dashboards/dashboard-grafana-crossplane-sli-metrics.yaml similarity index 100% rename from examples/dashboard-grafana-crossplane-sli-metrics.yaml rename to examples/dashboards/dashboard-grafana-crossplane-sli-metrics.yaml diff --git a/examples/dashboard-grafana-crossplane-top-level.yaml b/examples/dashboards/dashboard-grafana-crossplane-top-level.yaml similarity index 100% rename from examples/dashboard-grafana-crossplane-top-level.yaml rename to examples/dashboards/dashboard-grafana-crossplane-top-level.yaml diff --git a/examples/dashboard-grafana-crossplane-xmetrics.yaml b/examples/dashboards/dashboard-grafana-crossplane-xmetrics.yaml similarity index 100% rename from examples/dashboard-grafana-crossplane-xmetrics.yaml rename to examples/dashboards/dashboard-grafana-crossplane-xmetrics.yaml diff --git a/examples/folder-grafana.yaml b/examples/dashboards/folder-grafana.yaml similarity index 100% rename from examples/folder-grafana.yaml rename to examples/dashboards/folder-grafana.yaml From 554b2c6746e540a53ae2a6a3281fc920d53fa3fe Mon Sep 17 00:00:00 2001 From: humoflife Date: Tue, 7 Nov 2023 17:14:29 -0800 Subject: [PATCH 24/29] updated README.md --- README.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 7649c03..580172f 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,6 @@ rely on the CRDs to be installed through the oss composition first. ``` kubectl apply -f examples/oss.yaml -kubectl apply -f examples/dashboards ``` Wait until xmetrics CRDs have been installed, then apply the xmetrics configuration to see metrics flowing. @@ -50,11 +49,7 @@ kubectl apply -f examples/xmetrics.yaml To load dashboards that are part of this configuration repository, please apply the following dashboard resource claims. ``` -kubectl apply -f examples/dashboards/folder-grafana.yaml -kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-health.yaml -kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-mr.yaml -kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-resources-ttr.yaml -kubectl apply -f examples/dashboards/dashboard-grafana-crossplane-sli-metrics.yaml +kubectl apply -f examples/dashboards ``` Use the following to forward localhost:9090 to the Prometheus pod. From b692476b56db4c2ac5df0e169a3c78a735fb0626 Mon Sep 17 00:00:00 2001 From: humoflife Date: Mon, 13 Nov 2023 16:38:15 -0800 Subject: [PATCH 25/29] updated Makefile --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index dd431a3..4bce84c 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,8 @@ PLATFORMS ?= linux_amd64 UP_VERSION = v0.21.0 UP_CHANNEL = stable UPTEST_VERSION = v0.6.1 +UXP_INSTALL_OPTS = "--unstable" +UXP_VERSION = 1.14.0-up.1.rc.2" -include build/makelib/k8s_tools.mk # ==================================================================================== From 658dde8d84c6abad14b2f08e2602f264e6563e9d Mon Sep 17 00:00:00 2001 From: humoflife Date: Wed, 15 Nov 2023 08:44:34 -0800 Subject: [PATCH 26/29] replaced generic metrics example with smaller scoped ones --- examples/xmetrics.yaml | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/examples/xmetrics.yaml b/examples/xmetrics.yaml index 6ebdd1e..96524f1 100644 --- a/examples/xmetrics.yaml +++ b/examples/xmetrics.yaml @@ -17,6 +17,27 @@ spec: apiVersion: metrics.crossplane.io/v1 kind: ClusterMetric metadata: - name: upbound-metric-sample + name: upbound-metric-sample-aws-ec2 spec: - matchName: ".upbound.io" + matchName: ".ec2.aws.upbound.io" +--- +apiVersion: metrics.crossplane.io/v1 +kind: ClusterMetric +metadata: + name: upbound-metric-sample-aws-iam +spec: + matchName: ".iam.aws.upbound.io" +--- +apiVersion: metrics.crossplane.io/v1 +kind: ClusterMetric +metadata: + name: upbound-metric-sample-aws-rds +spec: + matchName: ".rds.aws.upbound.io" +--- +apiVersion: metrics.crossplane.io/v1 +kind: ClusterMetric +metadata: + name: upbound-metric-sample-aws-s3 +spec: + matchName: ".s3.aws.upbound.io" From 7cb4f683073f29f155243045bd5bfffc0a753f3a Mon Sep 17 00:00:00 2001 From: humoflife Date: Wed, 15 Nov 2023 10:02:48 -0800 Subject: [PATCH 27/29] added make cluster option and updated README disclaimers --- Makefile | 3 +++ README.md | 55 +++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 4bce84c..2c45b89 100644 --- a/Makefile +++ b/Makefile @@ -36,6 +36,7 @@ XPKGS = $(PROJECT_NAME) CROSSPLANE_NAMESPACE = upbound-system CROSSPLANE_ARGS = "--enable-usages" +KIND_CLUSTER_NAME = "crossplane-local-dev" -include build/makelib/local.xpkg.mk -include build/makelib/controlplane.mk @@ -78,4 +79,6 @@ uptest: $(UPTEST) $(KUBECTL) $(KUTTL) # - UPTEST_CLOUD_CREDENTIALS, cloud credentials for the provider being tested, e.g. export UPTEST_CLOUD_CREDENTIALS=$(cat ~/.aws/credentials) e2e: build controlplane.up local.xpkg.deploy.configuration.$(PROJECT_NAME) uptest +cluster: build controlplane.up local.xpkg.deploy.configuration.$(PROJECT_NAME) + .PHONY: uptest e2e diff --git a/README.md b/README.md index 580172f..9154c0d 100644 --- a/README.md +++ b/README.md @@ -5,19 +5,28 @@ with open source software integrations such as Prometheus and Grafana. Observability is a measure of how well platform performance can be inferred from knowledge of its metrics, logs and traces outputs. -**Warning** -## Disclaimer: Management Cluster Resource Use -Prometheus and Grafana may require significant cluster resources in relation -to the amount of metrics scraped, processed and visualized. This may impact -cluster operations. Consult the respective Prometheus Operator and -Grafana documentation for set up guidance prior to using this configuration -on mission critical Crossplane management clusters. - -**Warning** -## Disclaimer: Metric Stability -Crossplane has no concept of metric stability. This implies -that metrics used in this configuration may be absent in future versions -of Crossplane and / or its providers. +**Note** +## Disclaimer: Happily Operational Management Cluster +This configuration provides useful insights into the +health of Crossplane and its providers. To do so, +it installs 3rd party open source software as part of +its package. This software includes Prometheus and Grafana. +Both are tunable to accomodate the arbitrary scale that +may be needed based on the amount of resources for which +metrics are collected and visualized. Take a look +at the [Prometheus configuration options](https://prometheus.io/docs/prometheus/latest/configuration/configuration/) +prior to applying this Crossplane observability +configuration on mission critical clusters. Tune as appropriate +for your use case to help keep your control planes happy +and operational. + +**Note** +## Disclaimer: Using Metrics With Confidence +We are blessed with Crossplane and provider metrics endpoints +that help us gain insight about their performance. +Similar to early Kubernetes metrics APIs, +Crossplane does not yet distinguish between alpha, beta and v1 +metrics endpoints. Metrics API evolution is expected over time. ## Purpose The goal for configuration-observability-oss is to complement @@ -26,14 +35,11 @@ other configurations such as configuration-caas. See the additional configurations. ## Usage -Run `make e2e` directly to exercise end to end tests -for the observability integrations. After running the -tests, the kind cluster will remain but the tests will -clean up the operator namespace and delete the pods in it -at the conclusion of the tests by default. +Run `make cluster` to spin up a cluster with a +Crossplane control plane. -Apply the resource claim as follows to re-create -the namespace, Prometheus, Grafana and dependencies for further +Apply the resource claim as follows to create +the namespace, Prometheus, Grafana and dependencies for exploration. Note that the xmetrics configuration examples rely on the CRDs to be installed through the oss composition first. @@ -68,6 +74,15 @@ obtained from running the following. scripts/grafana-get-creds.sh ``` +#### Uptest +Run `make e2e` to exercise end to end tests +for the observability integrations. `make e2e` +has no prerequisites, that is it does not require +a previously created cluster. After running the +tests, the kind cluster will remain but the tests will +clean up the operator namespace and delete the pods in it +at the conclusion of the tests by default. + See example dashboards below. #### Crossplane MR Dashboard From a4dc31767a815fa254fbad3cefc126dd812a002a Mon Sep 17 00:00:00 2001 From: humoflife Date: Wed, 15 Nov 2023 10:11:12 -0800 Subject: [PATCH 28/29] updated README.md --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9154c0d..e8b76a2 100644 --- a/README.md +++ b/README.md @@ -52,18 +52,20 @@ the xmetrics configuration to see metrics flowing. kubectl apply -f examples/xmetrics.yaml ``` -To load dashboards that are part of this configuration repository, -please apply the following dashboard resource claims. +The following command will apply all the dashboard +resource claims located in the `dashboards` folder. +Each claim installs a respective Grafana dashboard. ``` kubectl apply -f examples/dashboards ``` -Use the following to forward localhost:9090 to the Prometheus pod. +To access the Prometheus dashboard, port-forward +to the the Prometheus services on port 9090. ``` -kubectl -n operators port-forward prometheus-oss-kube-prometheus-stack-prometheus-0 9090 +kubectl -n operators port-forward svc/oss-kube-prometheus-stack-prometheus 9090:9090 ``` -Use the following to forward localhost:3000 to the Grafana pod. +To access the Grafana dashboard, port-forward to the Grafana service on port 80. ``` kubectl -n operators port-forward svc/oss-grafana 3000:80 ``` From f5b61c390a612a30c2fbc648f3016276110dd3be Mon Sep 17 00:00:00 2001 From: humoflife Date: Wed, 15 Nov 2023 10:51:07 -0800 Subject: [PATCH 29/29] replace disclaimer with note --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e8b76a2..7a174e8 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,7 @@ with open source software integrations such as Prometheus and Grafana. Observability is a measure of how well platform performance can be inferred from knowledge of its metrics, logs and traces outputs. -**Note** -## Disclaimer: Happily Operational Management Cluster +## Note: Happily Operational Management Cluster This configuration provides useful insights into the health of Crossplane and its providers. To do so, it installs 3rd party open source software as part of @@ -20,8 +19,7 @@ configuration on mission critical clusters. Tune as appropriate for your use case to help keep your control planes happy and operational. -**Note** -## Disclaimer: Using Metrics With Confidence +## Note: Using Metrics With Confidence We are blessed with Crossplane and provider metrics endpoints that help us gain insight about their performance. Similar to early Kubernetes metrics APIs,