From febb83c69f3d79fa570f91918e1a8580af56a97c Mon Sep 17 00:00:00 2001 From: Pardeep Bhatt Date: Sun, 26 Feb 2023 00:41:03 +0530 Subject: [PATCH] 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.