From 92097395fa5a3033e178d45f98d4aac416446ad5 Mon Sep 17 00:00:00 2001 From: Peter Kurfer Date: Sat, 18 May 2024 12:10:59 +0200 Subject: [PATCH] feat(garage): scrape metrics --- garage/kustomization.yaml | 1 + garage/resources/servicemonitor.yaml | 18 ++++++++++++++++++ garage/resources/services.yaml | 2 ++ 3 files changed, 21 insertions(+) create mode 100644 garage/resources/servicemonitor.yaml diff --git a/garage/kustomization.yaml b/garage/kustomization.yaml index 2a39b25..5081446 100644 --- a/garage/kustomization.yaml +++ b/garage/kustomization.yaml @@ -25,6 +25,7 @@ resources: - resources/api_routes.yaml - resources/web_routes.yaml - resources/pdb.yaml + - resources/servicemonitor.yaml - backup/ configMapGenerator: diff --git a/garage/resources/servicemonitor.yaml b/garage/resources/servicemonitor.yaml new file mode 100644 index 0000000..b54a76d --- /dev/null +++ b/garage/resources/servicemonitor.yaml @@ -0,0 +1,18 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: garage +spec: + endpoints: + - honorLabels: true + path: /metrics + port: metrics + scheme: http + scrapeTimeout: 30s + jobLabel: garage + namespaceSelector: + matchNames: + - garage + selector: + matchLabels: + app.kubernetes.io/component: metrics diff --git a/garage/resources/services.yaml b/garage/resources/services.yaml index dcca48b..7015fc2 100644 --- a/garage/resources/services.yaml +++ b/garage/resources/services.yaml @@ -17,6 +17,8 @@ apiVersion: v1 kind: Service metadata: name: garage-metrics + labels: + app.kubernetes.io/component: metrics spec: type: ClusterIP clusterIP: None