From e4a8405de7672b9896571bb4dc060f61fca5befc Mon Sep 17 00:00:00 2001 From: Erich Blume Date: Thu, 22 Jan 2026 13:51:01 -0800 Subject: [PATCH] Observability cleanup and k8s service monitoring (#43) (#43) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary - Remove stale `/opt/homebrew/var/loki` from borgmatic backup (Loki migrated to k8s) - Add Alloy k8s DaemonSet for automatic pod log collection with auto-discovery - Add blackbox probes for miniflux, kiwix, transmission, devpi, argocd - Add transmission-exporter sidecar for full metrics (speed, torrent counts, ratios) - Replace stale devpi dashboard with probe-based metrics (status, response time, uptime) - Add unified "K8s Services Health" dashboard for service uptime/response monitoring ## Manual cleanup already performed - Deleted stale textfile metrics on indri: `devpi.prom`, `transmission.prom` - Deleted stale data directories on indri: `/opt/homebrew/var/loki/`, `/opt/homebrew/var/prometheus/` ## Deployment and Testing - [x] Sync `apps` application to pick up new alloy-k8s app - [x] Deploy alloy-k8s on feature branch: `argocd app set alloy-k8s --revision feature/observability-cleanup && argocd app sync alloy-k8s` - [x] Deploy torrent on feature branch (for transmission exporter): `argocd app set torrent --revision feature/observability-cleanup && argocd app sync torrent` - [x] Deploy prometheus on feature branch (for new scrape config): `argocd app set prometheus --revision feature/observability-cleanup && argocd app sync prometheus` - [x] Deploy grafana-config on feature branch (for dashboards): `argocd app set grafana-config --revision feature/observability-cleanup && argocd app sync grafana-config` - [x] Verify pod logs appear in Loki/Grafana - [x] Verify transmission metrics appear in Prometheus - [x] Verify service probe metrics appear in Prometheus - [x] Run `mise run provision-indri -- --tags borgmatic` to update borgmatic config - [ ] After merge, reset apps to main and resync 🤖 Generated with [Claude Code](https://claude.com/claude-code) Reviewed-on: https://forge.tail8d86e.ts.net/eblume/blumeops/pulls/43 --- ansible/roles/borgmatic/defaults/main.yml | 2 - argocd/apps/alloy-k8s.yaml | 17 + argocd/apps/kube-state-metrics.yaml | 17 + argocd/manifests/alloy-k8s/configmap.yaml | 158 ++++ argocd/manifests/alloy-k8s/daemonset.yaml | 67 ++ argocd/manifests/alloy-k8s/kustomization.yaml | 7 + argocd/manifests/alloy-k8s/namespace.yaml | 4 + argocd/manifests/alloy-k8s/rbac.yaml | 35 + .../dashboards/configmap-devpi.yaml | 389 ++------- .../dashboards/configmap-macos.yaml | 4 +- .../dashboards/configmap-minikube.yaml | 552 ++++-------- .../dashboards/configmap-services.yaml | 145 ++++ .../dashboards/configmap-transmission.yaml | 814 ------------------ .../grafana-config/kustomization.yaml | 2 +- .../kube-state-metrics/deployment.yaml | 53 ++ .../kube-state-metrics/kustomization.yaml | 6 + argocd/manifests/kube-state-metrics/rbac.yaml | 79 ++ .../manifests/kube-state-metrics/service.yaml | 17 + argocd/manifests/prometheus/configmap.yaml | 5 + 19 files changed, 818 insertions(+), 1555 deletions(-) create mode 100644 argocd/apps/alloy-k8s.yaml create mode 100644 argocd/apps/kube-state-metrics.yaml create mode 100644 argocd/manifests/alloy-k8s/configmap.yaml create mode 100644 argocd/manifests/alloy-k8s/daemonset.yaml create mode 100644 argocd/manifests/alloy-k8s/kustomization.yaml create mode 100644 argocd/manifests/alloy-k8s/namespace.yaml create mode 100644 argocd/manifests/alloy-k8s/rbac.yaml create mode 100644 argocd/manifests/grafana-config/dashboards/configmap-services.yaml delete mode 100644 argocd/manifests/grafana-config/dashboards/configmap-transmission.yaml create mode 100644 argocd/manifests/kube-state-metrics/deployment.yaml create mode 100644 argocd/manifests/kube-state-metrics/kustomization.yaml create mode 100644 argocd/manifests/kube-state-metrics/rbac.yaml create mode 100644 argocd/manifests/kube-state-metrics/service.yaml diff --git a/ansible/roles/borgmatic/defaults/main.yml b/ansible/roles/borgmatic/defaults/main.yml index 49816d9..14aa046 100644 --- a/ansible/roles/borgmatic/defaults/main.yml +++ b/ansible/roles/borgmatic/defaults/main.yml @@ -11,14 +11,12 @@ borgmatic_schedule_hour: 2 borgmatic_schedule_minute: 0 # Source directories to back up -# NOTE: devpi removed - now hosted in k8s (PVC handles persistence) borgmatic_source_directories: - /Users/erichblume/code/personal/zk - /opt/homebrew/var/forgejo - /Users/erichblume/.config/borgmatic - /Users/erichblume/Documents - /Users/erichblume/Pictures - - /opt/homebrew/var/loki # Backup repository borgmatic_repositories: diff --git a/argocd/apps/alloy-k8s.yaml b/argocd/apps/alloy-k8s.yaml new file mode 100644 index 0000000..29d996c --- /dev/null +++ b/argocd/apps/alloy-k8s.yaml @@ -0,0 +1,17 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: alloy-k8s + namespace: argocd +spec: + project: default + source: + repoURL: ssh://forgejo@indri.tail8d86e.ts.net:2200/eblume/blumeops.git + targetRevision: main + path: argocd/manifests/alloy-k8s + destination: + server: https://kubernetes.default.svc + namespace: alloy + syncPolicy: + syncOptions: + - CreateNamespace=true diff --git a/argocd/apps/kube-state-metrics.yaml b/argocd/apps/kube-state-metrics.yaml new file mode 100644 index 0000000..91df2cd --- /dev/null +++ b/argocd/apps/kube-state-metrics.yaml @@ -0,0 +1,17 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: kube-state-metrics + namespace: argocd +spec: + project: default + source: + repoURL: ssh://forgejo@indri.tail8d86e.ts.net:2200/eblume/blumeops.git + targetRevision: main + path: argocd/manifests/kube-state-metrics + destination: + server: https://kubernetes.default.svc + namespace: monitoring + syncPolicy: + syncOptions: + - CreateNamespace=true diff --git a/argocd/manifests/alloy-k8s/configmap.yaml b/argocd/manifests/alloy-k8s/configmap.yaml new file mode 100644 index 0000000..2a12cd9 --- /dev/null +++ b/argocd/manifests/alloy-k8s/configmap.yaml @@ -0,0 +1,158 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: alloy-config + namespace: alloy +data: + config.alloy: | + // Alloy k8s configuration - collects pod logs from all namespaces + + // ============== K8S POD LOG DISCOVERY ============== + + // Discover all pods in the cluster + discovery.kubernetes "pods" { + role = "pod" + } + + // Relabel to extract useful metadata + discovery.relabel "pods" { + targets = discovery.kubernetes.pods.targets + + // Keep only running pods + rule { + source_labels = ["__meta_kubernetes_pod_phase"] + regex = "Pending|Succeeded|Failed|Unknown" + action = "drop" + } + + // Set namespace label + rule { + source_labels = ["__meta_kubernetes_namespace"] + target_label = "namespace" + } + + // Set pod name label + rule { + source_labels = ["__meta_kubernetes_pod_name"] + target_label = "pod" + } + + // Set container name label + rule { + source_labels = ["__meta_kubernetes_pod_container_name"] + target_label = "container" + } + + // Set app label from pod labels + rule { + source_labels = ["__meta_kubernetes_pod_label_app"] + target_label = "app" + } + + // Fallback: use app.kubernetes.io/name if no app label + rule { + source_labels = ["__meta_kubernetes_pod_label_app_kubernetes_io_name"] + target_label = "app" + regex = "(.+)" + action = "replace" + } + + // Set node name + rule { + source_labels = ["__meta_kubernetes_pod_node_name"] + target_label = "node" + } + + // Build the log path for the pod container + rule { + source_labels = ["__meta_kubernetes_pod_uid", "__meta_kubernetes_pod_container_name"] + target_label = "__path__" + separator = "/" + replacement = "/var/log/pods/*$1/$2/*.log" + } + } + + // Tail pod logs + loki.source.kubernetes "pods" { + targets = discovery.relabel.pods.output + forward_to = [loki.process.pods.receiver] + } + + // Process logs - parse JSON if present, add labels + loki.process "pods" { + forward_to = [loki.write.loki.receiver] + + // Try to parse JSON logs + stage.json { + expressions = { + level = "level", + message = "msg", + time = "time", + } + } + + // Extract level from parsed JSON if available + stage.labels { + values = { + level = "", + } + } + } + + // Write logs to Loki + loki.write "loki" { + endpoint { + url = "http://loki.monitoring.svc.cluster.local:3100/loki/api/v1/push" + } + } + + // ============== SERVICE HEALTH PROBES ============== + + // Blackbox-style HTTP probes for k8s services + prometheus.exporter.blackbox "services" { + config = "{ modules: { http_2xx: { prober: http, timeout: 5s } } }" + + target { + name = "miniflux" + address = "http://miniflux.miniflux.svc.cluster.local:8080/healthcheck" + module = "http_2xx" + } + + target { + name = "kiwix" + address = "http://kiwix.kiwix.svc.cluster.local:80/" + module = "http_2xx" + } + + target { + name = "transmission" + address = "http://transmission.torrent.svc.cluster.local:9091/transmission/web/" + module = "http_2xx" + } + + target { + name = "devpi" + address = "http://devpi.devpi.svc.cluster.local:3141/+api" + module = "http_2xx" + } + + target { + name = "argocd" + address = "http://argocd-server.argocd.svc.cluster.local:80/healthz" + module = "http_2xx" + } + } + + // Scrape blackbox probe results + prometheus.scrape "blackbox" { + targets = prometheus.exporter.blackbox.services.targets + scrape_interval = "30s" + forward_to = [prometheus.remote_write.prometheus.receiver] + } + + // Push metrics to Prometheus + prometheus.remote_write "prometheus" { + endpoint { + url = "http://prometheus.monitoring.svc.cluster.local:9090/api/v1/write" + } + } diff --git a/argocd/manifests/alloy-k8s/daemonset.yaml b/argocd/manifests/alloy-k8s/daemonset.yaml new file mode 100644 index 0000000..95f780b --- /dev/null +++ b/argocd/manifests/alloy-k8s/daemonset.yaml @@ -0,0 +1,67 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: alloy + namespace: alloy + labels: + app: alloy +spec: + selector: + matchLabels: + app: alloy + template: + metadata: + labels: + app: alloy + spec: + serviceAccountName: alloy + securityContext: + fsGroup: 473 # alloy user group + containers: + - name: alloy + image: grafana/alloy:v1.5.1 + args: + - run + - --server.http.listen-addr=0.0.0.0:12345 + - --storage.path=/var/lib/alloy/data + - /etc/alloy/config.alloy + ports: + - containerPort: 12345 + name: http + env: + - name: HOSTNAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + resources: + requests: + cpu: 50m + memory: 128Mi + limits: + cpu: 500m + memory: 512Mi + volumeMounts: + - name: config + mountPath: /etc/alloy + - name: varlog + mountPath: /var/log + readOnly: true + - name: data + mountPath: /var/lib/alloy/data + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: + drop: + - ALL + tolerations: + - operator: Exists + volumes: + - name: config + configMap: + name: alloy-config + - name: varlog + hostPath: + path: /var/log + - name: data + emptyDir: {} diff --git a/argocd/manifests/alloy-k8s/kustomization.yaml b/argocd/manifests/alloy-k8s/kustomization.yaml new file mode 100644 index 0000000..17cd3c4 --- /dev/null +++ b/argocd/manifests/alloy-k8s/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - namespace.yaml + - rbac.yaml + - configmap.yaml + - daemonset.yaml diff --git a/argocd/manifests/alloy-k8s/namespace.yaml b/argocd/manifests/alloy-k8s/namespace.yaml new file mode 100644 index 0000000..94f62be --- /dev/null +++ b/argocd/manifests/alloy-k8s/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: alloy diff --git a/argocd/manifests/alloy-k8s/rbac.yaml b/argocd/manifests/alloy-k8s/rbac.yaml new file mode 100644 index 0000000..58a31df --- /dev/null +++ b/argocd/manifests/alloy-k8s/rbac.yaml @@ -0,0 +1,35 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: alloy + namespace: alloy +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: alloy +rules: + - apiGroups: [""] + resources: ["nodes", "nodes/proxy", "nodes/metrics", "services", "endpoints", "pods", "pods/log", "namespaces"] + verbs: ["get", "list", "watch"] + - apiGroups: [""] + resources: ["configmaps"] + verbs: ["get"] + - apiGroups: ["discovery.k8s.io"] + resources: ["endpointslices"] + verbs: ["get", "list", "watch"] + - nonResourceURLs: ["/metrics", "/metrics/cadvisor"] + verbs: ["get"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: alloy +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: alloy +subjects: + - kind: ServiceAccount + name: alloy + namespace: alloy diff --git a/argocd/manifests/grafana-config/dashboards/configmap-devpi.yaml b/argocd/manifests/grafana-config/dashboards/configmap-devpi.yaml index 68dd32d..acb062a 100644 --- a/argocd/manifests/grafana-config/dashboards/configmap-devpi.yaml +++ b/argocd/manifests/grafana-config/dashboards/configmap-devpi.yaml @@ -8,9 +8,7 @@ metadata: data: devpi.json: | { - "annotations": { - "list": [] - }, + "annotations": { "list": [] }, "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, @@ -18,154 +16,94 @@ data: "links": [], "panels": [ { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { "color": "red", "value": null }, - { "color": "green", "value": 1 } - ] - }, + "color": { "mode": "thresholds" }, + "mappings": [ + { "options": { "0": { "color": "red", "text": "DOWN" }, "1": { "color": "green", "text": "UP" } }, "type": "value" } + ], + "thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "green", "value": 1 }] }, "unit": "short" }, "overrides": [] }, - "gridPos": { "h": 4, "w": 4, "x": 0, "y": 0 }, + "gridPos": { "h": 6, "w": 8, "x": 0, "y": 0 }, "id": 1, "options": { - "colorMode": "value", + "colorMode": "background", "graphMode": "none", - "justifyMode": "auto", + "justifyMode": "center", "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "value" }, - "pluginVersion": "10.0.0", + "pluginVersion": "11.0.0", "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "devpi_up", - "refId": "A" - } + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "probe_success{job=\\"integrations/blackbox/devpi\\"}", "refId": "A" } ], "title": "Devpi Status", "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { "color": "green", "value": null }, - { "color": "yellow", "value": 100 }, - { "color": "red", "value": 1000 } - ] - }, - "unit": "short" + "color": { "mode": "thresholds" }, + "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }, { "color": "yellow", "value": 0.5 }, { "color": "red", "value": 1 }] }, + "unit": "s" }, "overrides": [] }, - "gridPos": { "h": 4, "w": 4, "x": 4, "y": 0 }, + "gridPos": { "h": 6, "w": 8, "x": 8, "y": 0 }, "id": 2, "options": { "colorMode": "value", "graphMode": "area", - "justifyMode": "auto", + "justifyMode": "center", "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "value" }, - "pluginVersion": "10.0.0", + "pluginVersion": "11.0.0", "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "devpi_web_whoosh_index_queue_size", - "refId": "A" - } + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "probe_duration_seconds{job=\\"integrations/blackbox/devpi\\"}", "refId": "A" } ], - "title": "Search Index Queue", + "title": "Response Time", "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "green", "value": null }] - }, - "unit": "short" + "color": { "mode": "thresholds" }, + "thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "yellow", "value": 0.95 }, { "color": "green", "value": 0.99 }] }, + "unit": "percentunit" }, "overrides": [] }, - "gridPos": { "h": 4, "w": 4, "x": 8, "y": 0 }, + "gridPos": { "h": 6, "w": 8, "x": 16, "y": 0 }, "id": 3, "options": { "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", + "graphMode": "area", + "justifyMode": "center", "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" + "reduceOptions": { "calcs": ["mean"], "fields": "", "values": false }, + "textMode": "value" }, - "pluginVersion": "10.0.0", + "pluginVersion": "11.0.0", "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "devpi_serial", - "refId": "A" - } + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "avg_over_time(probe_success{job=\\"integrations/blackbox/devpi\\"}[$__range])", "refId": "A" } ], - "title": "Changelog Serial", + "title": "Uptime (selected period)", "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, + "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, @@ -188,261 +126,30 @@ data: "thresholdsStyle": { "mode": "off" } }, "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "green", "value": null }] - }, - "unit": "short" + "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }, + "unit": "s" }, "overrides": [] }, - "gridPos": { "h": 8, "w": 12, "x": 0, "y": 4 }, + "gridPos": { "h": 8, "w": 24, "x": 0, "y": 6 }, "id": 4, "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, - "pluginVersion": "10.0.0", + "pluginVersion": "11.0.0", "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "rate(devpi_server_storage_cache_hits[5m])", - "legendFormat": "Storage Cache Hits", - "refId": "A" - }, - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "rate(devpi_server_storage_cache_misses[5m])", - "legendFormat": "Storage Cache Misses", - "refId": "B" - } + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "probe_duration_seconds{job=\\"integrations/blackbox/devpi\\"}", "legendFormat": "Response Time", "refId": "A" } ], - "title": "Storage Cache Hit/Miss Rate", + "title": "Response Time Over Time", "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { "legend": false, "tooltip": false, "viz": false }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { "type": "linear" }, - "showPoints": "never", - "spanNulls": false, - "stacking": { "group": "A", "mode": "none" }, - "thresholdsStyle": { "mode": "off" } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "green", "value": null }] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 8, "w": 12, "x": 12, "y": 4 }, - "id": 5, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { "mode": "single", "sort": "none" } - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "rate(devpi_server_changelog_cache_hits[5m])", - "legendFormat": "Changelog Cache Hits", - "refId": "A" - }, - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "rate(devpi_server_changelog_cache_misses[5m])", - "legendFormat": "Changelog Cache Misses", - "refId": "B" - } - ], - "title": "Changelog Cache Hit/Miss Rate", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { "legend": false, "tooltip": false, "viz": false }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { "type": "linear" }, - "showPoints": "never", - "spanNulls": false, - "stacking": { "group": "A", "mode": "none" }, - "thresholdsStyle": { "mode": "off" } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "green", "value": null }] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 8, "w": 12, "x": 0, "y": 12 }, - "id": 6, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { "mode": "single", "sort": "none" } - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "devpi_web_whoosh_index_queue_size", - "legendFormat": "Index Queue Size", - "refId": "A" - }, - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "devpi_web_whoosh_index_error_queue_size", - "legendFormat": "Index Error Queue Size", - "refId": "B" - } - ], - "title": "Search Index Queue Over Time", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "green", "value": null }] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 8, "w": 12, "x": 12, "y": 12 }, - "id": 7, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "horizontal", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "devpi_server_storage_cache_size", - "legendFormat": "Storage Cache Size", - "refId": "A" - }, - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "devpi_server_changelog_cache_size", - "legendFormat": "Changelog Cache Size", - "refId": "B" - }, - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "devpi_server_changelog_cache_items", - "legendFormat": "Changelog Cache Items", - "refId": "C" - }, - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "devpi_server_relpath_cache_size", - "legendFormat": "Relpath Cache Size", - "refId": "D" - }, - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "devpi_server_relpath_cache_items", - "legendFormat": "Relpath Cache Items", - "refId": "E" - } - ], - "title": "Cache Sizes", - "type": "stat" } ], "refresh": "30s", "schemaVersion": 38, "tags": ["devpi", "pypi"], - "templating": { - "list": [] - }, - "time": { - "from": "now-6h", - "to": "now" - }, + "templating": { "list": [] }, + "time": { "from": "now-6h", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Devpi PyPI Proxy", diff --git a/argocd/manifests/grafana-config/dashboards/configmap-macos.yaml b/argocd/manifests/grafana-config/dashboards/configmap-macos.yaml index aea4192..a9089f0 100644 --- a/argocd/manifests/grafana-config/dashboards/configmap-macos.yaml +++ b/argocd/manifests/grafana-config/dashboards/configmap-macos.yaml @@ -1263,7 +1263,7 @@ data: { "current": {}, "datasource": { "type": "prometheus", "uid": "prometheus" }, - "definition": "label_values(node_uname_info, instance)", + "definition": "label_values(node_memory_wired_bytes, instance)", "hide": 0, "includeAll": false, "label": "Instance", @@ -1271,7 +1271,7 @@ data: "name": "instance", "options": [], "query": { - "query": "label_values(node_uname_info, instance)", + "query": "label_values(node_memory_wired_bytes, instance)", "refId": "StandardVariableQuery" }, "refresh": 1, diff --git a/argocd/manifests/grafana-config/dashboards/configmap-minikube.yaml b/argocd/manifests/grafana-config/dashboards/configmap-minikube.yaml index 6d4df71..2b1956f 100644 --- a/argocd/manifests/grafana-config/dashboards/configmap-minikube.yaml +++ b/argocd/manifests/grafana-config/dashboards/configmap-minikube.yaml @@ -8,9 +8,7 @@ metadata: data: minikube.json: | { - "annotations": { - "list": [] - }, + "annotations": { "list": [] }, "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, @@ -18,424 +16,173 @@ data: "links": [], "panels": [ { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [ - { - "options": { - "0": { "color": "red", "index": 0, "text": "DOWN" } - }, - "type": "value" - }, - { - "options": { - "1": { "color": "green", "index": 1, "text": "UP" } - }, - "type": "value" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { "color": "red", "value": null }, - { "color": "green", "value": 1 } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 4, "w": 4, "x": 0, "y": 0 }, - "id": 1, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "minikube_up", - "refId": "A" + "color": { "mode": "thresholds" }, + "mappings": [{ "options": { "0": { "color": "red", "text": "DOWN" }, "1": { "color": "green", "text": "UP" } }, "type": "value" }], + "thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "green", "value": 1 }] } } - ], - "title": "Minikube Status", + }, + "gridPos": { "h": 3, "w": 3, "x": 0, "y": 0 }, + "id": 1, + "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "value" }, + "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "minikube_up", "refId": "A" }], + "title": "Cluster", "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [ - { - "options": { - "0": { "color": "red", "index": 0, "text": "DOWN" } - }, - "type": "value" - }, - { - "options": { - "1": { "color": "green", "index": 1, "text": "UP" } - }, - "type": "value" - } - ], - "thresholds": { - "mode": "absolute", - "steps": [ - { "color": "red", "value": null }, - { "color": "green", "value": 1 } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 4, "w": 4, "x": 4, "y": 0 }, - "id": 2, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "minikube_apiserver_up", - "refId": "A" + "color": { "mode": "thresholds" }, + "mappings": [{ "options": { "0": { "color": "red", "text": "DOWN" }, "1": { "color": "green", "text": "UP" } }, "type": "value" }], + "thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "green", "value": 1 }] } } - ], + }, + "gridPos": { "h": 3, "w": 3, "x": 3, "y": 0 }, + "id": 2, + "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "value" }, + "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "minikube_apiserver_up", "refId": "A" }], "title": "API Server", "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { "color": "red", "value": null }, - { "color": "green", "value": 1 } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 4, "w": 4, "x": 8, "y": 0 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] } } }, + "gridPos": { "h": 3, "w": 3, "x": 6, "y": 0 }, "id": 3, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "minikube_node_count", - "refId": "A" - } - ], - "title": "Node Count", + "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "value" }, + "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "count(kube_pod_info{namespace=~\"$namespace\"})", "refId": "A" }], + "title": "Pods", "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "green", "value": null }] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 4, "w": 4, "x": 12, "y": 0 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] } } }, + "gridPos": { "h": 3, "w": 3, "x": 9, "y": 0 }, "id": 4, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "minikube_pod_count", - "refId": "A" - } - ], - "title": "Pod Count", + "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "value" }, + "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "count(kube_deployment_created{namespace=~\"$namespace\"})", "refId": "A" }], + "title": "Deployments", "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "green", "value": null }] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 4, "w": 4, "x": 16, "y": 0 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] } } }, + "gridPos": { "h": 3, "w": 3, "x": 12, "y": 0 }, "id": 5, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "minikube_namespace_count", - "refId": "A" - } - ], + "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "value" }, + "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "count(kube_statefulset_created{namespace=~\"$namespace\"})", "refId": "A" }], + "title": "StatefulSets", + "type": "stat" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] } } }, + "gridPos": { "h": 3, "w": 3, "x": 15, "y": 0 }, + "id": 6, + "options": { "colorMode": "value", "graphMode": "none", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "value" }, + "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "count(kube_namespace_created)", "refId": "A" }], "title": "Namespaces", "type": "stat" }, { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { "legend": false, "tooltip": false, "viz": false }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { "type": "linear" }, - "showPoints": "never", - "spanNulls": false, - "stacking": { "group": "A", "mode": "none" }, - "thresholdsStyle": { "mode": "off" } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "green", "value": null }] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 8, "w": 12, "x": 0, "y": 4 }, - "id": 6, - "options": { - "legend": { - "calcs": ["lastNotNull"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { "mode": "multi", "sort": "desc" } - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "minikube_up", - "legendFormat": "Minikube", - "refId": "A" - }, - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "minikube_apiserver_up", - "legendFormat": "API Server", - "refId": "B" - } - ], - "title": "Cluster Health Over Time", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { "legend": false, "tooltip": false, "viz": false }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { "type": "linear" }, - "showPoints": "never", - "spanNulls": false, - "stacking": { "group": "A", "mode": "none" }, - "thresholdsStyle": { "mode": "off" } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "green", "value": null }] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 8, "w": 12, "x": 12, "y": 4 }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "unit": "bytes", "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] } } }, + "gridPos": { "h": 3, "w": 3, "x": 18, "y": 0 }, "id": 7, - "options": { - "legend": { - "calcs": ["lastNotNull", "max"], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { "mode": "multi", "sort": "desc" } - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "minikube_pod_count", - "legendFormat": "Pods", - "refId": "A" - }, - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "minikube_namespace_count", - "legendFormat": "Namespaces", - "refId": "B" + "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "value" }, + "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(kube_pod_container_resource_requests{resource=\"memory\",namespace=~\"$namespace\"})", "refId": "A" }], + "title": "Memory Requests", + "type": "stat" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "unit": "short", "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] } } }, + "gridPos": { "h": 3, "w": 3, "x": 21, "y": 0 }, + "id": 8, + "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "center", "orientation": "auto", "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, "textMode": "value" }, + "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum(kube_pod_container_resource_requests{resource=\"cpu\",namespace=~\"$namespace\"})", "refId": "A" }], + "title": "CPU Requests (cores)", + "type": "stat" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "bars", "fillOpacity": 80, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, + "mappings": [], + "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }, + "unit": "short" } - ], - "title": "Resource Counts Over Time", + }, + "gridPos": { "h": 8, "w": 12, "x": 0, "y": 3 }, + "id": 9, + "options": { "legend": { "calcs": ["lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true, "sortBy": "Last *", "sortDesc": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "count by (namespace) (kube_pod_info{namespace=~\"$namespace\"})", "legendFormat": "{{namespace}}", "refId": "A" }], + "title": "Pods by Namespace", "type": "timeseries" }, { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "gridPos": { "h": 10, "w": 24, "x": 0, "y": 12 }, - "id": 8, - "options": { - "dedupStrategy": "none", - "enableLogDetails": true, - "prettifyLogMessage": false, - "showCommonLabels": false, - "showLabels": false, - "showTime": true, - "sortOrder": "Descending", - "wrapLogMessage": false - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "loki", "uid": "loki" }, - "expr": "{host=\"indri\"} |= \"minikube\" or {host=\"indri\"} |= \"kube\"", - "refId": "A" + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "bars", "fillOpacity": 80, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "normal" }, "thresholdsStyle": { "mode": "off" } }, + "mappings": [], + "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }, + "unit": "bytes" } + }, + "gridPos": { "h": 8, "w": 12, "x": 12, "y": 3 }, + "id": 10, + "options": { "legend": { "calcs": ["lastNotNull"], "displayMode": "table", "placement": "right", "showLegend": true, "sortBy": "Last *", "sortDesc": true }, "tooltip": { "mode": "multi", "sort": "desc" } }, + "targets": [{ "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (namespace) (kube_pod_container_resource_requests{resource=\"memory\",namespace=~\"$namespace\"})", "legendFormat": "{{namespace}}", "refId": "A" }], + "title": "Memory Requests by Namespace", + "type": "timeseries" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "inspect": false }, + "mappings": [], + "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] } + }, + "overrides": [ + { "matcher": { "id": "byName", "options": "Memory Requests" }, "properties": [{ "id": "unit", "value": "bytes" }] }, + { "matcher": { "id": "byName", "options": "Memory Limits" }, "properties": [{ "id": "unit", "value": "bytes" }] }, + { "matcher": { "id": "byName", "options": "CPU Requests" }, "properties": [{ "id": "unit", "value": "short" }] }, + { "matcher": { "id": "byName", "options": "CPU Limits" }, "properties": [{ "id": "unit", "value": "short" }] } + ] + }, + "gridPos": { "h": 8, "w": 24, "x": 0, "y": 11 }, + "id": 11, + "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": ["sum"], "show": false }, "showHeader": true, "sortBy": [{ "desc": true, "displayName": "Pods" }] }, + "targets": [ + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "count by (namespace) (kube_pod_info{namespace=~\"$namespace\"})", "format": "table", "instant": true, "refId": "pods" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (namespace) (kube_pod_container_resource_requests{resource=\"memory\",namespace=~\"$namespace\"})", "format": "table", "instant": true, "refId": "mem_req" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (namespace) (kube_pod_container_resource_limits{resource=\"memory\",namespace=~\"$namespace\"})", "format": "table", "instant": true, "refId": "mem_lim" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (namespace) (kube_pod_container_resource_requests{resource=\"cpu\",namespace=~\"$namespace\"})", "format": "table", "instant": true, "refId": "cpu_req" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "sum by (namespace) (kube_pod_container_resource_limits{resource=\"cpu\",namespace=~\"$namespace\"})", "format": "table", "instant": true, "refId": "cpu_lim" } ], - "title": "Kubernetes Related Logs", + "title": "Namespace Resource Summary", + "transformations": [ + { "id": "seriesToColumns", "options": { "byField": "namespace" } }, + { "id": "organize", "options": { "excludeByName": { "Time": true, "Time 1": true, "Time 2": true, "Time 3": true, "Time 4": true, "Time 5": true }, "renameByName": { "Value #pods": "Pods", "Value #mem_req": "Memory Requests", "Value #mem_lim": "Memory Limits", "Value #cpu_req": "CPU Requests", "Value #cpu_lim": "CPU Limits", "namespace": "Namespace" } } } + ], + "type": "table" + }, + { + "datasource": { "type": "loki", "uid": "loki" }, + "gridPos": { "h": 8, "w": 24, "x": 0, "y": 19 }, + "id": 12, + "options": { "dedupStrategy": "none", "enableLogDetails": true, "prettifyLogMessage": false, "showCommonLabels": false, "showLabels": true, "showTime": true, "sortOrder": "Descending", "wrapLogMessage": false }, + "targets": [{ "datasource": { "type": "loki", "uid": "loki" }, "expr": "{namespace=~\"$namespace\"}", "refId": "A" }], + "title": "Pod Logs", "type": "logs" } ], @@ -443,16 +190,31 @@ data: "schemaVersion": 38, "tags": ["minikube", "kubernetes", "k8s"], "templating": { - "list": [] - }, - "time": { - "from": "now-6h", - "to": "now" + "list": [ + { + "current": { "selected": true, "text": "All", "value": "$__all" }, + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "definition": "label_values(kube_namespace_created, namespace)", + "hide": 0, + "includeAll": true, + "label": "Namespace", + "multi": true, + "name": "namespace", + "options": [], + "query": { "query": "label_values(kube_namespace_created, namespace)", "refId": "StandardVariableQuery" }, + "refresh": 2, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "type": "query" + } + ] }, + "time": { "from": "now-6h", "to": "now" }, "timepicker": {}, - "timezone": "", + "timezone": "browser", "title": "Minikube Kubernetes", "uid": "minikube", - "version": 1, + "version": 2, "weekStart": "" } diff --git a/argocd/manifests/grafana-config/dashboards/configmap-services.yaml b/argocd/manifests/grafana-config/dashboards/configmap-services.yaml new file mode 100644 index 0000000..241212a --- /dev/null +++ b/argocd/manifests/grafana-config/dashboards/configmap-services.yaml @@ -0,0 +1,145 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: grafana-dashboard-services + namespace: monitoring + labels: + grafana_dashboard: "1" +data: + services.json: | + { + "annotations": { "list": [] }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [], + "panels": [ + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "mappings": [ + { "options": { "0": { "color": "red", "text": "DOWN" }, "1": { "color": "green", "text": "UP" } }, "type": "value" } + ], + "thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "green", "value": 1 }] }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { "h": 6, "w": 24, "x": 0, "y": 0 }, + "id": 1, + "options": { + "colorMode": "background", + "graphMode": "none", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { "calcs": ["lastNotNull"], "fields": "", "values": false }, + "textMode": "value_and_name" + }, + "pluginVersion": "11.0.0", + "targets": [ + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "probe_success{job=\"integrations/blackbox/miniflux\"}", "legendFormat": "Miniflux", "refId": "A" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "probe_success{job=\"integrations/blackbox/kiwix\"}", "legendFormat": "Kiwix", "refId": "B" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "probe_success{job=\"integrations/blackbox/transmission\"}", "legendFormat": "Transmission", "refId": "C" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "probe_success{job=\"integrations/blackbox/devpi\"}", "legendFormat": "Devpi", "refId": "D" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "probe_success{job=\"integrations/blackbox/argocd\"}", "legendFormat": "ArgoCD", "refId": "E" } + ], + "title": "Service Status", + "type": "stat" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { "legend": false, "tooltip": false, "viz": false }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { "type": "linear" }, + "showPoints": "never", + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" }, + "thresholdsStyle": { "mode": "off" } + }, + "mappings": [], + "thresholds": { "mode": "absolute", "steps": [{ "color": "green", "value": null }] }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { "h": 8, "w": 24, "x": 0, "y": 6 }, + "id": 2, + "options": { + "legend": { "calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true }, + "tooltip": { "mode": "multi", "sort": "desc" } + }, + "pluginVersion": "11.0.0", + "targets": [ + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "probe_duration_seconds{job=\"integrations/blackbox/miniflux\"}", "legendFormat": "Miniflux", "refId": "A" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "probe_duration_seconds{job=\"integrations/blackbox/kiwix\"}", "legendFormat": "Kiwix", "refId": "B" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "probe_duration_seconds{job=\"integrations/blackbox/transmission\"}", "legendFormat": "Transmission", "refId": "C" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "probe_duration_seconds{job=\"integrations/blackbox/devpi\"}", "legendFormat": "Devpi", "refId": "D" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "probe_duration_seconds{job=\"integrations/blackbox/argocd\"}", "legendFormat": "ArgoCD", "refId": "E" } + ], + "title": "Response Time", + "type": "timeseries" + }, + { + "datasource": { "type": "prometheus", "uid": "prometheus" }, + "fieldConfig": { + "defaults": { + "color": { "mode": "thresholds" }, + "mappings": [], + "thresholds": { "mode": "absolute", "steps": [{ "color": "red", "value": null }, { "color": "yellow", "value": 0.95 }, { "color": "green", "value": 0.99 }] }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { "h": 6, "w": 24, "x": 0, "y": 14 }, + "id": 3, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "center", + "orientation": "horizontal", + "reduceOptions": { "calcs": ["mean"], "fields": "", "values": false }, + "textMode": "value_and_name" + }, + "pluginVersion": "11.0.0", + "targets": [ + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "avg_over_time(probe_success{job=\"integrations/blackbox/miniflux\"}[$__range])", "legendFormat": "Miniflux", "refId": "A" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "avg_over_time(probe_success{job=\"integrations/blackbox/kiwix\"}[$__range])", "legendFormat": "Kiwix", "refId": "B" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "avg_over_time(probe_success{job=\"integrations/blackbox/transmission\"}[$__range])", "legendFormat": "Transmission", "refId": "C" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "avg_over_time(probe_success{job=\"integrations/blackbox/devpi\"}[$__range])", "legendFormat": "Devpi", "refId": "D" }, + { "datasource": { "type": "prometheus", "uid": "prometheus" }, "expr": "avg_over_time(probe_success{job=\"integrations/blackbox/argocd\"}[$__range])", "legendFormat": "ArgoCD", "refId": "E" } + ], + "title": "Uptime (selected period)", + "type": "stat" + } + ], + "refresh": "30s", + "schemaVersion": 38, + "tags": ["services", "health"], + "templating": { "list": [] }, + "time": { "from": "now-24h", "to": "now" }, + "timepicker": {}, + "timezone": "browser", + "title": "K8s Services Health", + "uid": "k8s-services", + "version": 1, + "weekStart": "" + } diff --git a/argocd/manifests/grafana-config/dashboards/configmap-transmission.yaml b/argocd/manifests/grafana-config/dashboards/configmap-transmission.yaml deleted file mode 100644 index 3563ff5..0000000 --- a/argocd/manifests/grafana-config/dashboards/configmap-transmission.yaml +++ /dev/null @@ -1,814 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: grafana-dashboard-transmission - namespace: monitoring - labels: - grafana_dashboard: "1" -data: - transmission.json: | - { - "annotations": { - "list": [] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": null, - "links": [], - "panels": [ - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { "color": "red", "value": null }, - { "color": "green", "value": 1 } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 4, "w": 4, "x": 0, "y": 0 }, - "id": 1, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "transmission_up", - "refId": "A" - } - ], - "title": "Transmission Status", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "green", "value": null }] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 4, "w": 4, "x": 4, "y": 0 }, - "id": 2, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "transmission_torrents_total", - "refId": "A" - } - ], - "title": "Total Torrents", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "blue", "value": null }] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 4, "w": 4, "x": 8, "y": 0 }, - "id": 3, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "transmission_torrents_active", - "refId": "A" - } - ], - "title": "Active Torrents", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "orange", "value": null }] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 4, "w": 4, "x": 12, "y": 0 }, - "id": 4, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "transmission_torrents_paused", - "refId": "A" - } - ], - "title": "Paused Torrents", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "green", "value": null }] - }, - "unit": "decbytes" - }, - "overrides": [] - }, - "gridPos": { "h": 4, "w": 4, "x": 16, "y": 0 }, - "id": 5, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "transmission_downloaded_bytes_total", - "refId": "A" - } - ], - "title": "Total Downloaded", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "purple", "value": null }] - }, - "unit": "decbytes" - }, - "overrides": [] - }, - "gridPos": { "h": 4, "w": 4, "x": 20, "y": 0 }, - "id": 6, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "transmission_uploaded_bytes_total", - "refId": "A" - } - ], - "title": "Total Uploaded", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { "color": "red", "value": null }, - { "color": "yellow", "value": 0.5 }, - { "color": "green", "value": 1 } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { "h": 4, "w": 8, "x": 0, "y": 4 }, - "id": 11, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "increase(transmission_uploaded_bytes_total[$__range]) / increase(transmission_downloaded_bytes_total[$__range])", - "refId": "A" - } - ], - "title": "Upload/Download Ratio (Period)", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "green", - "mode": "fixed" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "green", "value": null }] - }, - "unit": "decbytes" - }, - "overrides": [] - }, - "gridPos": { "h": 4, "w": 8, "x": 8, "y": 4 }, - "id": 12, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "increase(transmission_downloaded_bytes_total[$__range])", - "refId": "A" - } - ], - "title": "Downloaded (Period)", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "blue", - "mode": "fixed" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "blue", "value": null }] - }, - "unit": "decbytes" - }, - "overrides": [] - }, - "gridPos": { "h": 4, "w": 8, "x": 16, "y": 4 }, - "id": 13, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": ["lastNotNull"], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "increase(transmission_uploaded_bytes_total[$__range])", - "refId": "A" - } - ], - "title": "Uploaded (Period)", - "type": "stat" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": 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 }] - }, - "unit": "Bps" - }, - "overrides": [ - { - "matcher": { "id": "byName", "options": "Download" }, - "properties": [ - { - "id": "color", - "value": { "fixedColor": "green", "mode": "fixed" } - } - ] - }, - { - "matcher": { "id": "byName", "options": "Upload" }, - "properties": [ - { - "id": "color", - "value": { "fixedColor": "blue", "mode": "fixed" } - } - ] - } - ] - }, - "gridPos": { "h": 8, "w": 12, "x": 0, "y": 8 }, - "id": 7, - "options": { - "legend": { - "calcs": ["mean", "max"], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "transmission_download_speed_bytes", - "legendFormat": "Download", - "refId": "A" - }, - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "transmission_upload_speed_bytes", - "legendFormat": "Upload", - "refId": "B" - } - ], - "title": "Transfer Speed", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": 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 }] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { "h": 8, "w": 12, "x": 12, "y": 8 }, - "id": 8, - "options": { - "legend": { - "calcs": ["mean", "max"], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "transmission_torrents_total", - "legendFormat": "Total", - "refId": "A" - }, - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "transmission_torrents_active", - "legendFormat": "Active", - "refId": "B" - }, - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "transmission_torrents_paused", - "legendFormat": "Paused", - "refId": "C" - } - ], - "title": "Torrent Count", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 10, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": 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 }] - }, - "unit": "Bps" - }, - "overrides": [ - { - "matcher": { "id": "byName", "options": "Download Rate" }, - "properties": [ - { - "id": "color", - "value": { "fixedColor": "green", "mode": "fixed" } - } - ] - }, - { - "matcher": { "id": "byName", "options": "Upload Rate" }, - "properties": [ - { - "id": "color", - "value": { "fixedColor": "blue", "mode": "fixed" } - } - ] - } - ] - }, - "gridPos": { "h": 8, "w": 24, "x": 0, "y": 16 }, - "id": 9, - "options": { - "legend": { - "calcs": ["mean", "max", "lastNotNull"], - "displayMode": "table", - "placement": "right", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "rate(transmission_downloaded_bytes_total[5m])", - "legendFormat": "Download Rate", - "refId": "A" - }, - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "rate(transmission_uploaded_bytes_total[5m])", - "legendFormat": "Upload Rate", - "refId": "B" - } - ], - "title": "Cumulative Transfer Rate (5m avg)", - "type": "timeseries" - }, - { - "datasource": { - "type": "prometheus", - "uid": "prometheus" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "fixed", - "fixedColor": "semi-dark-purple" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "opacity", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 2, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "never", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [{ "color": "green", "value": null }] - }, - "unit": "decbytes" - }, - "overrides": [] - }, - "gridPos": { "h": 8, "w": 24, "x": 0, "y": 24 }, - "id": 10, - "options": { - "legend": { - "calcs": ["lastNotNull", "min", "max"], - "displayMode": "table", - "placement": "right", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { "type": "prometheus", "uid": "prometheus" }, - "expr": "transmission_torrents_size_bytes", - "legendFormat": "Total Torrent Size", - "refId": "A" - } - ], - "title": "Total Torrent Size", - "type": "timeseries" - } - ], - "refresh": "30s", - "schemaVersion": 38, - "tags": ["transmission", "bittorrent"], - "templating": { - "list": [] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timepicker": {}, - "timezone": "browser", - "title": "Transmission", - "uid": "transmission", - "version": 1, - "weekStart": "" - } diff --git a/argocd/manifests/grafana-config/kustomization.yaml b/argocd/manifests/grafana-config/kustomization.yaml index d897b1d..e10f437 100644 --- a/argocd/manifests/grafana-config/kustomization.yaml +++ b/argocd/manifests/grafana-config/kustomization.yaml @@ -13,5 +13,5 @@ resources: - dashboards/configmap-minikube.yaml - dashboards/configmap-plex.yaml - dashboards/configmap-postgresql.yaml - - dashboards/configmap-transmission.yaml + - dashboards/configmap-services.yaml - dashboards/configmap-zot.yaml diff --git a/argocd/manifests/kube-state-metrics/deployment.yaml b/argocd/manifests/kube-state-metrics/deployment.yaml new file mode 100644 index 0000000..69d3bd2 --- /dev/null +++ b/argocd/manifests/kube-state-metrics/deployment.yaml @@ -0,0 +1,53 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: kube-state-metrics + namespace: monitoring + labels: + app: kube-state-metrics +spec: + replicas: 1 + selector: + matchLabels: + app: kube-state-metrics + template: + metadata: + labels: + app: kube-state-metrics + spec: + serviceAccountName: kube-state-metrics + containers: + - name: kube-state-metrics + image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.13.0 + ports: + - containerPort: 8080 + name: http-metrics + - containerPort: 8081 + name: telemetry + livenessProbe: + httpGet: + path: /healthz + port: 8080 + initialDelaySeconds: 5 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: / + port: 8080 + initialDelaySeconds: 5 + timeoutSeconds: 5 + resources: + requests: + cpu: 10m + memory: 64Mi + limits: + cpu: 100m + memory: 256Mi + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + runAsNonRoot: true + runAsUser: 65534 + capabilities: + drop: + - ALL diff --git a/argocd/manifests/kube-state-metrics/kustomization.yaml b/argocd/manifests/kube-state-metrics/kustomization.yaml new file mode 100644 index 0000000..bc60c0b --- /dev/null +++ b/argocd/manifests/kube-state-metrics/kustomization.yaml @@ -0,0 +1,6 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - rbac.yaml + - deployment.yaml + - service.yaml diff --git a/argocd/manifests/kube-state-metrics/rbac.yaml b/argocd/manifests/kube-state-metrics/rbac.yaml new file mode 100644 index 0000000..36193ac --- /dev/null +++ b/argocd/manifests/kube-state-metrics/rbac.yaml @@ -0,0 +1,79 @@ +apiVersion: v1 +kind: ServiceAccount +metadata: + name: kube-state-metrics + namespace: monitoring +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: kube-state-metrics +rules: + - apiGroups: [""] + resources: + - configmaps + - secrets + - nodes + - pods + - services + - serviceaccounts + - resourcequotas + - replicationcontrollers + - limitranges + - persistentvolumeclaims + - persistentvolumes + - namespaces + - endpoints + verbs: ["list", "watch"] + - apiGroups: ["apps"] + resources: + - statefulsets + - daemonsets + - deployments + - replicasets + verbs: ["list", "watch"] + - apiGroups: ["batch"] + resources: + - cronjobs + - jobs + verbs: ["list", "watch"] + - apiGroups: ["autoscaling"] + resources: + - horizontalpodautoscalers + verbs: ["list", "watch"] + - apiGroups: ["networking.k8s.io"] + resources: + - networkpolicies + - ingresses + verbs: ["list", "watch"] + - apiGroups: ["coordination.k8s.io"] + resources: + - leases + verbs: ["list", "watch"] + - apiGroups: ["certificates.k8s.io"] + resources: + - certificatesigningrequests + verbs: ["list", "watch"] + - apiGroups: ["storage.k8s.io"] + resources: + - storageclasses + - volumeattachments + verbs: ["list", "watch"] + - apiGroups: ["admissionregistration.k8s.io"] + resources: + - mutatingwebhookconfigurations + - validatingwebhookconfigurations + verbs: ["list", "watch"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: kube-state-metrics +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: kube-state-metrics +subjects: + - kind: ServiceAccount + name: kube-state-metrics + namespace: monitoring diff --git a/argocd/manifests/kube-state-metrics/service.yaml b/argocd/manifests/kube-state-metrics/service.yaml new file mode 100644 index 0000000..3a804df --- /dev/null +++ b/argocd/manifests/kube-state-metrics/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: kube-state-metrics + namespace: monitoring + labels: + app: kube-state-metrics +spec: + selector: + app: kube-state-metrics + ports: + - name: http-metrics + port: 8080 + targetPort: http-metrics + - name: telemetry + port: 8081 + targetPort: telemetry diff --git a/argocd/manifests/prometheus/configmap.yaml b/argocd/manifests/prometheus/configmap.yaml index 7ae945a..cc43999 100644 --- a/argocd/manifests/prometheus/configmap.yaml +++ b/argocd/manifests/prometheus/configmap.yaml @@ -36,3 +36,8 @@ data: - job_name: "loki" static_configs: - targets: ["loki.monitoring.svc.cluster.local:3100"] + + # Kubernetes state metrics (pods, deployments, resource usage, etc.) + - job_name: "kube-state-metrics" + static_configs: + - targets: ["kube-state-metrics.monitoring.svc.cluster.local:8080"]