From 1c41afde203d148c09599324c0ad3f5dc63e2dd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Sun, 30 Mar 2025 19:53:01 +0200 Subject: [PATCH] update prom --- deploy/prometheus/deploy.jsonnet | 41 ------------------- .../manifests/prometheus-self-monitor.yaml | 18 -------- 2 files changed, 59 deletions(-) delete mode 100644 deploy/prometheus/manifests/prometheus-self-monitor.yaml diff --git a/deploy/prometheus/deploy.jsonnet b/deploy/prometheus/deploy.jsonnet index 4dbce38..1ede903 100644 --- a/deploy/prometheus/deploy.jsonnet +++ b/deploy/prometheus/deploy.jsonnet @@ -128,44 +128,3 @@ local kp = (import 'kube-prometheus/main.libsonnet') + { { ['prometheus-' + name]: kp.prometheus[name] for name in std.objectFields(kp.prometheus) } + { ['prometheus-adapter-' + name]: kp.prometheusAdapter[name] for name in std.objectFields(kp.prometheusAdapter) } + { [name + '-ingress']: kp.ingress[name] for name in std.objectFields(kp.ingress) } - -/* - Add a ServiceMonitor for Prometheus self-scrape. - The relabeling below forces the job label to be "prometheus", so that querying with: - up{job="prometheus"} - will return Prometheus's own metrics. - - NOTE: Adjust the matchLabels selector if your Prometheus service has different labels. -*/ - -{ 'prometheus-self-monitor': { - apiVersion: 'monitoring.coreos.com/v1', - kind: 'ServiceMonitor', - metadata: { - name: 'prometheus-self-monitor', - namespace: kp.values.common.namespace, - labels: { - release: 'prometheus', - }, - }, - spec: { - selector: { - matchLabels: { - // This selector should match labels on the Prometheus service. - // Here we assume the Prometheus service is labeled with: - // prometheus: "prometheus-k8s" - prometheus: 'prometheus-k8s', - }, - }, - endpoints: [{ - port: 'web', // Must match the name of the port exposed by the Prometheus service - path: '/metrics', - scheme: 'http', // Change to "https" if your Prometheus endpoint requires it - relabelings: [{ - targetLabel: 'job', - replacement: 'prometheus', - }], - }], - }, - }, -} \ No newline at end of file diff --git a/deploy/prometheus/manifests/prometheus-self-monitor.yaml b/deploy/prometheus/manifests/prometheus-self-monitor.yaml deleted file mode 100644 index 8968917..0000000 --- a/deploy/prometheus/manifests/prometheus-self-monitor.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: monitoring.coreos.com/v1 -kind: ServiceMonitor -metadata: - labels: - release: prometheus - name: prometheus-self-monitor - namespace: monitoring -spec: - endpoints: - - path: /metrics - port: web - relabelings: - - replacement: prometheus - targetLabel: job - scheme: http - selector: - matchLabels: - prometheus: prometheus-k8s