From 9d0d0dedeb23a7adfb825332374752a6273fca92 Mon Sep 17 00:00:00 2001 From: Aleksandr Kurlov Date: Fri, 12 Jul 2024 10:12:44 +0200 Subject: [PATCH] Add emailsender metrics --- resources/index.json | 3 +- .../rhacs-emailsender-metrics.yaml | 30 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 resources/prometheus/pod_monitors/rhacs-emailsender-metrics.yaml diff --git a/resources/index.json b/resources/index.json index f4f56526..fef12064 100644 --- a/resources/index.json +++ b/resources/index.json @@ -6,7 +6,8 @@ "prometheus/pod_monitors/prometheus-self-metrics.yaml", "prometheus/pod_monitors/rhacs-cloudwatch-exporter.yaml", "prometheus/pod_monitors/rhacs-fleetshard-sync-metrics.yaml", - "prometheus/pod_monitors/rhacs-tenant-metrics.yaml" + "prometheus/pod_monitors/rhacs-tenant-metrics.yaml", + "prometheus/pod_monitors/rhacs-emailsender-metrics.yaml" ], "rules": [ "prometheus/billing-rules.yaml", diff --git a/resources/prometheus/pod_monitors/rhacs-emailsender-metrics.yaml b/resources/prometheus/pod_monitors/rhacs-emailsender-metrics.yaml new file mode 100644 index 00000000..71c99f7a --- /dev/null +++ b/resources/prometheus/pod_monitors/rhacs-emailsender-metrics.yaml @@ -0,0 +1,30 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: rhacs-emailsender-metrics + labels: + app: rhacs +spec: + selector: + matchLabels: + app: "emailsender" + namespaceSelector: + any: true + podMetricsEndpoints: + - path: /metrics + port: monitoring + relabelings: + - action: labeldrop + regex: endpoint + + - sourceLabels: [container] + action: replace + 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}