From febb83c69f3d79fa570f91918e1a8580af56a97c Mon Sep 17 00:00:00 2001 From: Pardeep Bhatt Date: Sun, 26 Feb 2023 00:41:03 +0530 Subject: [PATCH 1/7] docs: documentation for available metrics/stats --- runatlantis.io/docs/stats.md | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/runatlantis.io/docs/stats.md b/runatlantis.io/docs/stats.md index b4f12c4b60..4e5e9968a8 100644 --- a/runatlantis.io/docs/stats.md +++ b/runatlantis.io/docs/stats.md @@ -9,3 +9,45 @@ Currently Statsd and Prometheus is supported. See configuration below for detail ## Configuration Metrics are configured through the [Server Side Config](server-side-repo-config.html#metrics). + +## Available Metrics/Stats + +There are plenty of metrics which are exposed by atlantis service. Let's say you have exposed metrics from a endpoint `/metrics` from your [Server Side Config](server-side-repo-config.html#metrics) +``` +metrics: + prometheus: + endpoint: "/metrics" +``` +then on making curl request to your atlantis server on path `/metrics` will list down all the metrics exposed from atlantis service. +``` +curl localhost:4141/metrics +# HELP atlantis_cmd_autoplan_builder_execution_error atlantis_cmd_autoplan_builder_execution_error counter +# TYPE atlantis_cmd_autoplan_builder_execution_error counter +atlantis_cmd_autoplan_builder_execution_error 0 +# HELP atlantis_cmd_autoplan_builder_execution_success atlantis_cmd_autoplan_builder_execution_success counter +# TYPE atlantis_cmd_autoplan_builder_execution_success counter +atlantis_cmd_autoplan_builder_execution_success 10 +# HELP atlantis_cmd_autoplan_builder_execution_time atlantis_cmd_autoplan_builder_execution_time summary +# TYPE atlantis_cmd_autoplan_builder_execution_time summary +atlantis_cmd_autoplan_builder_execution_time{quantile="0.5"} NaN +atlantis_cmd_autoplan_builder_execution_time{quantile="0.75"} NaN +atlantis_cmd_autoplan_builder_execution_time{quantile="0.95"} NaN +atlantis_cmd_autoplan_builder_execution_time{quantile="0.99"} NaN +atlantis_cmd_autoplan_builder_execution_time{quantile="0.999"} NaN +atlantis_cmd_autoplan_builder_execution_time_sum 11.42403017 +atlantis_cmd_autoplan_builder_execution_time_count 10 +..... +..... +..... +``` +Some of the important metrics which you would like to monitor are + +| Metric Name | Metric Type | Purpose | +|----------------------------------------------|----------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------| +| atlantis_cmd_autoplan_execution_error | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | since starting of atlantis server, the number of times when [autoplan](autoplanning.html#autoplanning) on the MR’s has thrown error. | +| atlantis_cmd_comment_plan_execution_error | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | since starting of atlantis server, the number of times when on commenting `atlantis plan` on the MR’s has thrown error. | +| atlantis_cmd_autoplan_execution_success | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | since starting of atlantis server, the number of times when [autoplan](autoplanning.html#autoplanning) on the MR’s has run successfully. | +| atlantis_cmd_comment_apply_execution_error | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | since starting of atlantis server, the number of times when on commenting `atlantis apply` on the MR’s has thrown error. | +| atlantis_cmd_comment_apply_execution_success | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | since starting of atlantis server, the number of times when on commenting `atlantis apply` on the MR’s has run successfully. | + +Since there are a plenty of metrics exposed by atlantis, so you can go through them all and çan monitor the one's which are well suited for you. From 9f83eceeccd26d2b80323f7ec66b6f26be5a507e Mon Sep 17 00:00:00 2001 From: Pardeep Bhatt Date: Sun, 26 Feb 2023 20:00:16 +0530 Subject: [PATCH 2/7] docs: refactored as per comments --- runatlantis.io/docs/stats.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runatlantis.io/docs/stats.md b/runatlantis.io/docs/stats.md index 4e5e9968a8..67e63a37c3 100644 --- a/runatlantis.io/docs/stats.md +++ b/runatlantis.io/docs/stats.md @@ -10,16 +10,16 @@ Currently Statsd and Prometheus is supported. See configuration below for detail Metrics are configured through the [Server Side Config](server-side-repo-config.html#metrics). -## Available Metrics/Stats +## Available Metrics -There are plenty of metrics which are exposed by atlantis service. Let's say you have exposed metrics from a endpoint `/metrics` from your [Server Side Config](server-side-repo-config.html#metrics) -``` +Assuming metrics are exposed from the endpoint `/metrics` from the [metrics](server-side-repo-config.html#metrics) server side config e.g. +```yaml metrics: prometheus: endpoint: "/metrics" ``` -then on making curl request to your atlantis server on path `/metrics` will list down all the metrics exposed from atlantis service. -``` +To see all the metrics exposed from atlantis service, make a GET request to the `/metrics` endpoint. +```bash curl localhost:4141/metrics # HELP atlantis_cmd_autoplan_builder_execution_error atlantis_cmd_autoplan_builder_execution_error counter # TYPE atlantis_cmd_autoplan_builder_execution_error counter From af82da23f9d13cedab96d6d20541984d5aa48bf6 Mon Sep 17 00:00:00 2001 From: Pardeep Bhatt Date: Wed, 1 Mar 2023 20:38:46 +0530 Subject: [PATCH 3/7] docs: update metrics description --- runatlantis.io/docs/stats.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/runatlantis.io/docs/stats.md b/runatlantis.io/docs/stats.md index 67e63a37c3..4a1c556ccb 100644 --- a/runatlantis.io/docs/stats.md +++ b/runatlantis.io/docs/stats.md @@ -40,14 +40,18 @@ atlantis_cmd_autoplan_builder_execution_time_count 10 ..... ..... ``` -Some of the important metrics which you would like to monitor are +::: tip NOTE +The output shown above is trimmed, since with every new version release this metric set will need to be updated accordingly as there may be a case if some metrics are added/modified/deprecated, so the output shown above just gives a brief idea of how these metrics look like and rest can be explored. +::: + +Important metrics to monitor are -| Metric Name | Metric Type | Purpose | -|----------------------------------------------|----------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------| -| atlantis_cmd_autoplan_execution_error | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | since starting of atlantis server, the number of times when [autoplan](autoplanning.html#autoplanning) on the MR’s has thrown error. | -| atlantis_cmd_comment_plan_execution_error | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | since starting of atlantis server, the number of times when on commenting `atlantis plan` on the MR’s has thrown error. | -| atlantis_cmd_autoplan_execution_success | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | since starting of atlantis server, the number of times when [autoplan](autoplanning.html#autoplanning) on the MR’s has run successfully. | -| atlantis_cmd_comment_apply_execution_error | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | since starting of atlantis server, the number of times when on commenting `atlantis apply` on the MR’s has thrown error. | -| atlantis_cmd_comment_apply_execution_success | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | since starting of atlantis server, the number of times when on commenting `atlantis apply` on the MR’s has run successfully. | +| Metric Name | Metric Type | Purpose | +|------------------------------------------------|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------| +| `atlantis_cmd_autoplan_execution_error` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when [autoplan](autoplanning.html#autoplanning) has thrown error. | +| `atlantis_cmd_comment_plan_execution_error` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when on commenting `atlantis plan` has thrown error. | +| `atlantis_cmd_autoplan_execution_success` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when [autoplan](autoplanning.html#autoplanning) has run successfully. | +| `atlantis_cmd_comment_apply_execution_error` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when on commenting `atlantis apply` has thrown error. | +| `atlantis_cmd_comment_apply_execution_success` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when on commenting `atlantis apply` has run successfully. | -Since there are a plenty of metrics exposed by atlantis, so you can go through them all and çan monitor the one's which are well suited for you. +Since there are a plenty of metrics exposed by atlantis, so one can go through them all and çan monitor the one's which are well suited for them. From d55f879ec9c11c8fb3e5896c396dc1e5ded4318b Mon Sep 17 00:00:00 2001 From: Pardeep Bhatt Date: Wed, 1 Mar 2023 20:51:29 +0530 Subject: [PATCH 4/7] docs: add empty lines between blocks --- runatlantis.io/docs/stats.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runatlantis.io/docs/stats.md b/runatlantis.io/docs/stats.md index 4a1c556ccb..8c95ce100b 100644 --- a/runatlantis.io/docs/stats.md +++ b/runatlantis.io/docs/stats.md @@ -13,12 +13,15 @@ Metrics are configured through the [Server Side Config](server-side-repo-config. ## Available Metrics Assuming metrics are exposed from the endpoint `/metrics` from the [metrics](server-side-repo-config.html#metrics) server side config e.g. + ```yaml metrics: prometheus: endpoint: "/metrics" ``` + To see all the metrics exposed from atlantis service, make a GET request to the `/metrics` endpoint. + ```bash curl localhost:4141/metrics # HELP atlantis_cmd_autoplan_builder_execution_error atlantis_cmd_autoplan_builder_execution_error counter @@ -40,6 +43,7 @@ atlantis_cmd_autoplan_builder_execution_time_count 10 ..... ..... ``` + ::: tip NOTE The output shown above is trimmed, since with every new version release this metric set will need to be updated accordingly as there may be a case if some metrics are added/modified/deprecated, so the output shown above just gives a brief idea of how these metrics look like and rest can be explored. ::: From 0055e5dfd1d3a81ec75dee5c090ef30c4e793ff6 Mon Sep 17 00:00:00 2001 From: Pardeep Bhatt Date: Wed, 1 Mar 2023 20:56:21 +0530 Subject: [PATCH 5/7] docs: add note section --- runatlantis.io/docs/stats.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runatlantis.io/docs/stats.md b/runatlantis.io/docs/stats.md index 8c95ce100b..b25999da91 100644 --- a/runatlantis.io/docs/stats.md +++ b/runatlantis.io/docs/stats.md @@ -58,4 +58,6 @@ Important metrics to monitor are | `atlantis_cmd_comment_apply_execution_error` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when on commenting `atlantis apply` has thrown error. | | `atlantis_cmd_comment_apply_execution_success` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when on commenting `atlantis apply` has run successfully. | -Since there are a plenty of metrics exposed by atlantis, so one can go through them all and çan monitor the one's which are well suited for them. +::: tip NOTE +There are plenty of additional metrics exposed by atlantis that are not described above +::: From 9fa6149b450ce356a9ce7249e4f5e00057d34fd4 Mon Sep 17 00:00:00 2001 From: Pardeep Bhatt Date: Wed, 1 Mar 2023 20:58:38 +0530 Subject: [PATCH 6/7] docs: add missing dot --- runatlantis.io/docs/stats.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runatlantis.io/docs/stats.md b/runatlantis.io/docs/stats.md index b25999da91..d50e22b6f0 100644 --- a/runatlantis.io/docs/stats.md +++ b/runatlantis.io/docs/stats.md @@ -59,5 +59,5 @@ Important metrics to monitor are | `atlantis_cmd_comment_apply_execution_success` | [counter](https://prometheus.io/docs/concepts/metric_types/#counter) | number of times when on commenting `atlantis apply` has run successfully. | ::: tip NOTE -There are plenty of additional metrics exposed by atlantis that are not described above +There are plenty of additional metrics exposed by atlantis that are not described above. ::: From 8aa5fc81a9ffc81ae5fbce972691745b1af8e800 Mon Sep 17 00:00:00 2001 From: nitrocode <7775707+nitrocode@users.noreply.github.com> Date: Wed, 1 Mar 2023 11:23:10 -0600 Subject: [PATCH 7/7] Apply suggestions from code review --- runatlantis.io/docs/stats.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/runatlantis.io/docs/stats.md b/runatlantis.io/docs/stats.md index d50e22b6f0..a2980c5634 100644 --- a/runatlantis.io/docs/stats.md +++ b/runatlantis.io/docs/stats.md @@ -14,14 +14,17 @@ Metrics are configured through the [Server Side Config](server-side-repo-config. Assuming metrics are exposed from the endpoint `/metrics` from the [metrics](server-side-repo-config.html#metrics) server side config e.g. + ```yaml metrics: prometheus: endpoint: "/metrics" ``` + To see all the metrics exposed from atlantis service, make a GET request to the `/metrics` endpoint. + ```bash curl localhost:4141/metrics # HELP atlantis_cmd_autoplan_builder_execution_error atlantis_cmd_autoplan_builder_execution_error counter @@ -44,6 +47,7 @@ atlantis_cmd_autoplan_builder_execution_time_count 10 ..... ``` + ::: tip NOTE The output shown above is trimmed, since with every new version release this metric set will need to be updated accordingly as there may be a case if some metrics are added/modified/deprecated, so the output shown above just gives a brief idea of how these metrics look like and rest can be explored. :::