From 8736eb62ab18c6498c043a552887f04a74b753b2 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Thu, 27 Jul 2023 10:10:08 +0200 Subject: [PATCH] feat(metrics): Add prometheus scraping --- manifests/grafana/deployment.yaml | 3 +-- manifests/grafana/kustomization.yaml | 1 + manifests/grafana/service.yaml | 2 ++ manifests/grafana/servicemonitor.yaml | 14 ++++++++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 manifests/grafana/servicemonitor.yaml diff --git a/manifests/grafana/deployment.yaml b/manifests/grafana/deployment.yaml index 8e18c46..2881a6e 100644 --- a/manifests/grafana/deployment.yaml +++ b/manifests/grafana/deployment.yaml @@ -18,8 +18,7 @@ spec: - 0 containers: - name: grafana - image: grafana/grafana:10.0.1 - imagePullPolicy: IfNotPresent + image: grafana/grafana:10.0.3 ports: - containerPort: 3000 readinessProbe: diff --git a/manifests/grafana/kustomization.yaml b/manifests/grafana/kustomization.yaml index f9b471f..a8a1b91 100644 --- a/manifests/grafana/kustomization.yaml +++ b/manifests/grafana/kustomization.yaml @@ -5,6 +5,7 @@ resources: - pvc.yaml - service.yaml - ingress.yaml + - servicemonitor.yaml - database.yaml - datasources.yaml - deployment.yaml diff --git a/manifests/grafana/service.yaml b/manifests/grafana/service.yaml index 029e9a5..7a14ea2 100644 --- a/manifests/grafana/service.yaml +++ b/manifests/grafana/service.yaml @@ -3,6 +3,8 @@ kind: Service metadata: name: grafana-svc namespace: monitoring + labels: + app.kubernetes.io/name: grafana spec: ports: - name: http diff --git a/manifests/grafana/servicemonitor.yaml b/manifests/grafana/servicemonitor.yaml new file mode 100644 index 0000000..a6fe236 --- /dev/null +++ b/manifests/grafana/servicemonitor.yaml @@ -0,0 +1,14 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: grafana + namespace: monitoring + labels: + team: core +spec: + selector: + matchLabels: + app.kubernetes.io/name: grafana + endpoints: + - port: http + path: /metrics