diff --git a/resources/grafana/generated/dashboards/rhacs-central-slo-configmap.yaml b/resources/grafana/generated/dashboards/rhacs-central-slo-configmap.yaml index b7b0833c..01962278 100644 --- a/resources/grafana/generated/dashboards/rhacs-central-slo-configmap.yaml +++ b/resources/grafana/generated/dashboards/rhacs-central-slo-configmap.yaml @@ -29,6 +29,28 @@ data: "type": "dashboard" }, "type": "dashboard" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "enable": true, + "iconColor": "purple", + "expr": "count (count by (git_version) (label_replace(kubernetes_build_info{job!~\"kube-dns|coredns\"}, \"git_version\", \"$1\", \"git_version\", \"(v[0-9]*.[0-9]*).*\"))) > 1", + "name": "Kubernetes Upgrade", + "textFormat": "Kubernetes Upgrade" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "enable": true, + "iconColor": "red", + "expr": "count (count by (gitVersion) (openshift_apiserver_build_info)) > 1", + "name": "OpenShift Upgrade", + "textFormat": "OpenShift Upgrade" } ] }, diff --git a/resources/grafana/generated/dashboards/rhacs-central-slo-dashboard.yaml b/resources/grafana/generated/dashboards/rhacs-central-slo-dashboard.yaml index c89ecba2..ff27bad0 100644 --- a/resources/grafana/generated/dashboards/rhacs-central-slo-dashboard.yaml +++ b/resources/grafana/generated/dashboards/rhacs-central-slo-dashboard.yaml @@ -29,6 +29,28 @@ spec: "type": "dashboard" }, "type": "dashboard" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "enable": true, + "iconColor": "purple", + "expr": "count (count by (git_version) (label_replace(kubernetes_build_info{job!~\"kube-dns|coredns\"}, \"git_version\", \"$1\", \"git_version\", \"(v[0-9]*.[0-9]*).*\"))) > 1", + "name": "Kubernetes Upgrade", + "textFormat": "Kubernetes Upgrade" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "enable": true, + "iconColor": "red", + "expr": "count (count by (gitVersion) (openshift_apiserver_build_info)) > 1", + "name": "OpenShift Upgrade", + "textFormat": "OpenShift Upgrade" } ] }, diff --git a/resources/grafana/generated/dashboards/rhacs-cluster-overview-configmap.yaml b/resources/grafana/generated/dashboards/rhacs-cluster-overview-configmap.yaml index 8c10d07c..bfa11a11 100644 --- a/resources/grafana/generated/dashboards/rhacs-cluster-overview-configmap.yaml +++ b/resources/grafana/generated/dashboards/rhacs-cluster-overview-configmap.yaml @@ -29,6 +29,28 @@ data: "type": "dashboard" }, "type": "dashboard" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "enable": true, + "iconColor": "purple", + "expr": "count (count by (git_version) (label_replace(kubernetes_build_info{job!~\"kube-dns|coredns\"}, \"git_version\", \"$1\", \"git_version\", \"(v[0-9]*.[0-9]*).*\"))) > 1", + "name": "Kubernetes Upgrade", + "textFormat": "Kubernetes Upgrade" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "enable": true, + "iconColor": "red", + "expr": "count (count by (gitVersion) (openshift_apiserver_build_info)) > 1", + "name": "OpenShift Upgrade", + "textFormat": "OpenShift Upgrade" } ] }, diff --git a/resources/grafana/generated/dashboards/rhacs-cluster-overview-dashboard.yaml b/resources/grafana/generated/dashboards/rhacs-cluster-overview-dashboard.yaml index e7e3091e..6ea35bf0 100644 --- a/resources/grafana/generated/dashboards/rhacs-cluster-overview-dashboard.yaml +++ b/resources/grafana/generated/dashboards/rhacs-cluster-overview-dashboard.yaml @@ -29,6 +29,28 @@ spec: "type": "dashboard" }, "type": "dashboard" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "enable": true, + "iconColor": "purple", + "expr": "count (count by (git_version) (label_replace(kubernetes_build_info{job!~\"kube-dns|coredns\"}, \"git_version\", \"$1\", \"git_version\", \"(v[0-9]*.[0-9]*).*\"))) > 1", + "name": "Kubernetes Upgrade", + "textFormat": "Kubernetes Upgrade" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "enable": true, + "iconColor": "red", + "expr": "count (count by (gitVersion) (openshift_apiserver_build_info)) > 1", + "name": "OpenShift Upgrade", + "textFormat": "OpenShift Upgrade" } ] }, diff --git a/resources/grafana/sources/rhacs-central-slo.json b/resources/grafana/sources/rhacs-central-slo.json index 45db8f0d..caa3c5a3 100644 --- a/resources/grafana/sources/rhacs-central-slo.json +++ b/resources/grafana/sources/rhacs-central-slo.json @@ -18,6 +18,28 @@ "type": "dashboard" }, "type": "dashboard" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "enable": true, + "iconColor": "purple", + "expr": "count (count by (git_version) (label_replace(kubernetes_build_info{job!~\"kube-dns|coredns\"}, \"git_version\", \"$1\", \"git_version\", \"(v[0-9]*.[0-9]*).*\"))) > 1", + "name": "Kubernetes Upgrade", + "textFormat": "Kubernetes Upgrade" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "enable": true, + "iconColor": "red", + "expr": "count (count by (gitVersion) (openshift_apiserver_build_info)) > 1", + "name": "OpenShift Upgrade", + "textFormat": "OpenShift Upgrade" } ] }, diff --git a/resources/grafana/sources/rhacs-cluster-overview.json b/resources/grafana/sources/rhacs-cluster-overview.json index 0841eb42..8969a623 100644 --- a/resources/grafana/sources/rhacs-cluster-overview.json +++ b/resources/grafana/sources/rhacs-cluster-overview.json @@ -18,6 +18,28 @@ "type": "dashboard" }, "type": "dashboard" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "enable": true, + "iconColor": "purple", + "expr": "count (count by (git_version) (label_replace(kubernetes_build_info{job!~\"kube-dns|coredns\"}, \"git_version\", \"$1\", \"git_version\", \"(v[0-9]*.[0-9]*).*\"))) > 1", + "name": "Kubernetes Upgrade", + "textFormat": "Kubernetes Upgrade" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "enable": true, + "iconColor": "red", + "expr": "count (count by (gitVersion) (openshift_apiserver_build_info)) > 1", + "name": "OpenShift Upgrade", + "textFormat": "OpenShift Upgrade" } ] }, diff --git a/resources/index.json b/resources/index.json index f9f20e9d..73f1389f 100644 --- a/resources/index.json +++ b/resources/index.json @@ -4,10 +4,9 @@ "prometheus": { "pod_monitors": [ "prometheus/pod_monitors/prometheus-self-metrics.yaml", - "prometheus/pod_monitors/rhacs-central-metrics.yaml", "prometheus/pod_monitors/rhacs-cloudwatch-exporter.yaml", "prometheus/pod_monitors/rhacs-fleetshard-sync-metrics.yaml", - "prometheus/pod_monitors/rhacs-scanner-metrics.yaml" + "prometheus/pod_monitors/rhacs-tenant-metrics.yaml" ], "rules": [ "prometheus/billing-rules.yaml", diff --git a/resources/prometheus/federation-config-base.yaml b/resources/prometheus/federation-config-base.yaml index 33a70c2f..60b16a5b 100644 --- a/resources/prometheus/federation-config-base.yaml +++ b/resources/prometheus/federation-config-base.yaml @@ -3,3 +3,4 @@ match[]: # This is an example. - up{job!~"central|scanner"} + - openshift_apiserver_build_info diff --git a/resources/prometheus/federation-config.yaml b/resources/prometheus/federation-config.yaml index c63da907..11b05d7c 100644 --- a/resources/prometheus/federation-config.yaml +++ b/resources/prometheus/federation-config.yaml @@ -154,6 +154,7 @@ match[]: - node_netstat_Tcp_RetransSegs{job!~"central|scanner"} - node_quantile:kubelet_pleg_relist_duration_seconds:histogram_quantile{job!~"central|scanner"} - obs_operator:prometheus_remote_storage_succeeded_samples:ratio_rate1h{job!~"central|scanner"} + - openshift_apiserver_build_info - process_cpu_seconds_total{job!~"central|scanner"} - process_resident_memory_bytes{job!~"central|scanner"} - prometheus_remote_storage_samples_failed_total{job!~"central|scanner"} diff --git a/resources/prometheus/pod_monitors/rhacs-scanner-metrics.yaml b/resources/prometheus/pod_monitors/rhacs-scanner-metrics.yaml deleted file mode 100644 index 8dcb01e9..00000000 --- a/resources/prometheus/pod_monitors/rhacs-scanner-metrics.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: monitoring.coreos.com/v1 -kind: PodMonitor -metadata: - name: rhacs-scanner-metrics - labels: - app: rhacs -spec: - selector: - matchLabels: - app: "scanner" - namespaceSelector: - any: true - podMetricsEndpoints: - - path: /metrics - port: monitoring - relabelings: - - action: labeldrop - regex: endpoint - - - sourceLabels: [container] - targetLabel: job - - - action: labelmap - regex: __meta_kubernetes_pod_annotation_rhacs_redhat_com_(.+) - replacement: rhacs_${1} - - - action: labelmap - regex: __meta_kubernetes_pod_label_rhacs_redhat_com_(.+) - replacement: rhacs_${1} - - - sourceLabels: [rhacs_tenant] - targetLabel: rhacs_instance_id - - - action: labeldrop - regex: rhacs_tenant - - - sourceLabels: [__meta_kubernetes_pod_label_app_kubernetes_io_version] - targetLabel: rhacs_version diff --git a/resources/prometheus/pod_monitors/rhacs-central-metrics.yaml b/resources/prometheus/pod_monitors/rhacs-tenant-metrics.yaml similarity index 92% rename from resources/prometheus/pod_monitors/rhacs-central-metrics.yaml rename to resources/prometheus/pod_monitors/rhacs-tenant-metrics.yaml index 9d198015..a84287a0 100644 --- a/resources/prometheus/pod_monitors/rhacs-central-metrics.yaml +++ b/resources/prometheus/pod_monitors/rhacs-tenant-metrics.yaml @@ -1,13 +1,13 @@ apiVersion: monitoring.coreos.com/v1 kind: PodMonitor metadata: - name: rhacs-central-metrics + name: rhacs-tenant-metrics labels: app: rhacs spec: selector: matchLabels: - app: "central" + app.kubernetes.io/name: stackrox namespaceSelector: any: true podMetricsEndpoints: diff --git a/scripts/generate-federate-match.sh b/scripts/generate-federate-match.sh index f6c57feb..cc5a29cc 100755 --- a/scripts/generate-federate-match.sh +++ b/scripts/generate-federate-match.sh @@ -1,7 +1,11 @@ #!/usr/bin/env bash set -eou pipefail -shopt -s inherit_errexit + +# only if not OSX +if [[ $(uname) != "Darwin" ]]; then + shopt -s inherit_errexit +fi function log() { echo "$@" >&2