From 433492791bf8aec914feedc24586752b1548f4f3 Mon Sep 17 00:00:00 2001 From: Patrick Ruckstuhl Date: Tue, 23 Feb 2021 21:50:25 +0100 Subject: [PATCH] Add example podMonitor for prometheus Signed-off-by: Patrick Ruckstuhl --- docs/guides/monitoring.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/guides/monitoring.md b/docs/guides/monitoring.md index 76e032aa..c02f24fe 100644 --- a/docs/guides/monitoring.md +++ b/docs/guides/monitoring.md @@ -54,7 +54,24 @@ If you wish to use your own Prometheus and Grafana instances, then you can impor !!! hint Note that the toolkit controllers expose the `/metrics` endpoint on port `8080`. - When using Prometheus Operator you should create `PodMonitor` objects to configure scraping. + When using Prometheus Operator you should create a `PodMonitor` object for each controller to configure scraping. + +```yaml +apiVersion: monitoring.coreos.com/v1 +kind: PodMonitor +metadata: + name: source-controller + namespace: flux-system +spec: + namespaceSelector: + matchNames: + - flux-system + selector: + matchLabels: + app: source-controller + podMetricsEndpoints: + - port: http-prom +``` ## Metrics