Skip to content

Commit

Permalink
docs(metrics): available metrics, metrics enablement (runatlantis#3171)
Browse files Browse the repository at this point in the history
* docs: documentation for available metrics/stats

* docs: refactored as per comments

* docs: update metrics description

* docs: add empty lines between blocks

* docs: add note section

* docs: add missing dot

* Apply suggestions from code review

---------

Co-authored-by: Pardeep Bhatt <pardeep.bhatt@gojek.com>
Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
  • Loading branch information
3 people authored and ijames-gc committed Feb 13, 2024
1 parent 960cffa commit 071f76d
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions runatlantis.io/docs/stats.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,59 @@ 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

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
# 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
.....
.....
.....
```


::: 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) | 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. |

::: tip NOTE
There are plenty of additional metrics exposed by atlantis that are not described above.
:::

0 comments on commit 071f76d

Please sign in to comment.