BigW Consortium Gitlab

metrics.md 2.13 KB
Newer Older
Joshua Lambert committed
1 2 3
# Prometheus Metrics library
> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/8935) in GitLab 9.0

4 5 6
GitLab offers automatic detection of select [Prometheus exporters](https://prometheus.io/docs/instrumenting/exporters/). Currently supported exporters are:
* [Kubernetes](kubernetes.md)
* [NGINX](nginx.md)
7
* [NGINX Ingress Controller](nginx_ingress.md)
8
* [HAProxy](haproxy.md)
9
* [Amazon Cloud Watch](cloudwatch.md)
Joshua Lambert committed
10

11
We have tried to surface the most important metrics for each exporter, and will be continuing to add support for additional exporters in future releases. If you would like to add support for other official exporters, [contributions](#adding-to-the-library) are welcome.
Joshua Lambert committed
12

13
## Identifying Environments
Joshua Lambert committed
14

15 16 17
GitLab retrieves performance data from the configured Prometheus server, and attempts to identifying the presence of known metrics. Once identified, GitLab then needs to be able to map the data to a particular environment.

In order to isolate and only display relevant metrics for a given environment, GitLab needs a method to detect which labels are associated. To do that,
18
GitLab uses the defined queries and fills in the environment specific variables. Typically this involves looking for the [$CI_ENVIRONMENT_SLUG](https://docs.gitlab.com/ee/ci/variables/#predefined-variables-environment-variables), but may also include other information such as the project's Kubernetes namespace. Each search query is defined in the [exporter specific documentation](#prometheus-metrics-library).
Joshua Lambert committed
19

20
## Adding to the library
Joshua Lambert committed
21

22
We strive to support the 2-4 most important metrics for each common system service that supports Prometheus. If you are looking for support for a particular exporter which has not yet been added to the library, additions can be made [to the `additional_metrics.yml`](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/prometheus/additional_metrics.yml) file.
Joshua Lambert committed
23

Joshua Lambert committed
24
> Note: The library is only for monitoring public, common, system services which all customers can benefit from. Support for monitoring [customer proprietary metrics](https://gitlab.com/gitlab-org/gitlab-ee/issues/2273) will be added in a subsequent release.