From 4b1040eb137a717ae2076786be7d20ba70635488 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 20 Jun 2023 19:27:13 +0000 Subject: [PATCH 1/5] docs: add prometheus scrape_config example --- docs/admin/prometheus.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/admin/prometheus.md b/docs/admin/prometheus.md index 5c9ed54efd247..a00954b7763f0 100644 --- a/docs/admin/prometheus.md +++ b/docs/admin/prometheus.md @@ -25,6 +25,19 @@ coderd_api_active_users_duration_hour 0 The Prometheus endpoint can be enabled in the [Helm chart's](https://github.com/coder/coder/tree/main/helm) `values.yml` by setting the environment variable `CODER_PROMETHEUS_ADDRESS` to `0.0.0.0:2112`. The environment variable `CODER_PROMETHEUS_ENABLE` will be enabled automatically. +### Prometheus configuration + +To allow Prometheus to scrape the Coder metrics, you will need to create a `scape_config` +in your `prometheus.yml` file, or in the Prometheus Helm chart values. Below is an +example `scrape_config`: + +```yaml +scrape_configs: + - job_name: 'coder' + static_configs: + - targets: [':2112'] # replcace with the the IP address of the Coder pod or server +``` + ## Available metrics From 6fe35998b9b35a103017811a342a8a2385909801 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 20 Jun 2023 19:36:43 +0000 Subject: [PATCH 2/5] make: fmt --- docs/admin/prometheus.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/admin/prometheus.md b/docs/admin/prometheus.md index a00954b7763f0..5c837aee5d525 100644 --- a/docs/admin/prometheus.md +++ b/docs/admin/prometheus.md @@ -33,9 +33,9 @@ example `scrape_config`: ```yaml scrape_configs: - - job_name: 'coder' + - job_name: "coder" static_configs: - - targets: [':2112'] # replcace with the the IP address of the Coder pod or server + - targets: [":2112"] # replcace with the the IP address of the Coder pod or server ``` ## Available metrics From 117921be7648d88e7f8fa09617e444f08ad72924 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 20 Jun 2023 20:56:07 +0000 Subject: [PATCH 3/5] add: label --- docs/admin/prometheus.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/admin/prometheus.md b/docs/admin/prometheus.md index 5c837aee5d525..faf8a09a8a33d 100644 --- a/docs/admin/prometheus.md +++ b/docs/admin/prometheus.md @@ -36,6 +36,8 @@ scrape_configs: - job_name: "coder" static_configs: - targets: [":2112"] # replcace with the the IP address of the Coder pod or server + labels: + apps: "coder" ``` ## Available metrics From d1b490015e44ff6e9226fabef26e4f329feb1820 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 20 Jun 2023 21:01:12 +0000 Subject: [PATCH 4/5] fix: spelling --- docs/admin/prometheus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/admin/prometheus.md b/docs/admin/prometheus.md index faf8a09a8a33d..25dad8c90470c 100644 --- a/docs/admin/prometheus.md +++ b/docs/admin/prometheus.md @@ -35,7 +35,7 @@ example `scrape_config`: scrape_configs: - job_name: "coder" static_configs: - - targets: [":2112"] # replcace with the the IP address of the Coder pod or server + - targets: [":2112"] # replace with the the IP address of the Coder pod or server labels: apps: "coder" ``` From 02994eebc3d5ec5177e3bd46934e1ad0dd2f192e Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 20 Jun 2023 21:04:20 +0000 Subject: [PATCH 5/5] scheme: http --- docs/admin/prometheus.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/admin/prometheus.md b/docs/admin/prometheus.md index 25dad8c90470c..af8928bed6ba0 100644 --- a/docs/admin/prometheus.md +++ b/docs/admin/prometheus.md @@ -34,6 +34,7 @@ example `scrape_config`: ```yaml scrape_configs: - job_name: "coder" + scheme: "http" static_configs: - targets: [":2112"] # replace with the the IP address of the Coder pod or server labels: