diff options
author | Andrey Tocko <andrejs.tocko@zabbix.com> | 2022-10-24 21:54:22 +0300 |
---|---|---|
committer | Andrey Tocko <andrejs.tocko@zabbix.com> | 2022-10-24 21:54:22 +0300 |
commit | afb51603d55b32a22abfeb29ce642d384608363b (patch) | |
tree | 1f4ceaa906b862b5961939c101b72d5d3558bd24 /templates | |
parent | 14a1b1788c8f720911810dd56eb8f74196932d0c (diff) | |
parent | db3e39dc4ed326c683d64fe1cbc3d15b7aefeb86 (diff) |
.........T [ZBXNEXT-8018] added token authentication in Template GitLab by HTTP
Merge in ZBX/zabbix from feature/ZBXNEXT-8018-6.3 to master
* commit 'db3e39dc4ed326c683d64fe1cbc3d15b7aefeb86':
.........T [ZBXNEXT-8018] added token authentication in Template GitLab by HTTP
Diffstat (limited to 'templates')
-rw-r--r-- | templates/app/gitlab_http/README.md | 41 | ||||
-rw-r--r-- | templates/app/gitlab_http/template_app_gitlab_http.yaml | 39 |
2 files changed, 43 insertions, 37 deletions
diff --git a/templates/app/gitlab_http/README.md b/templates/app/gitlab_http/README.md index 1ca0c5d8a45..fc8d1be3405 100644 --- a/templates/app/gitlab_http/README.md +++ b/templates/app/gitlab_http/README.md @@ -3,11 +3,11 @@ ## Overview -For Zabbix version: 6.2 and higher -The template to monitor GitLab by Zabbix that works without any external scripts. +For Zabbix version: 6.2 and higher. +This template is designed to monitor GitLab by Zabbix that works without any external scripts. Most of the metrics are collected in one go, thanks to Zabbix bulk data collection. -Template `GitLab by HTTP` — collects metrics by HTTP agent from GitLab /metrics endpoint. +The template `GitLab by HTTP` — collects metrics by an HTTP agent from the GitLab `/-/metrics` endpoint. See https://docs.gitlab.com/ee/administration/monitoring/prometheus/gitlab_metrics.html. @@ -18,11 +18,13 @@ This template was tested on: ## Setup -> See [Zabbix template operation](https://www.zabbix.com/documentation/6.2/manual/config/templates_out_of_the_box/http) for basic instructions. +> See [Zabbix template operation](https://www.zabbix.com/documentation/6.4/manual/config/templates_out_of_the_box/http) for basic instructions. -This template works with self-hosted GitLab instances. Internal service metrics are collected from GitLab /-/metrics endpoint. -To access the metrics, the client IP address must be [explicitly allowed](https://docs.gitlab.com/ee/administration/monitoring/ip_whitelist.html). -Don't forget to change the macros {$GITLAB.URL}. +This template works with self-hosted GitLab instances. Internal service metrics are collected from the GitLab `/-/metrics` endpoint. +To access metrics following two methods are available: +1. Explicitly allow monitoring instance IP address in gitlab [whitelist configuration](https://docs.gitlab.com/ee/administration/monitoring/ip_whitelist.html). +2. Get token from Gitlab `Admin -> Monitoring -> Health check` page: http://your.gitlab.address/admin/health_check; Use this token in macro `{$GITLAB.HEALTH.TOKEN}` as variable path, like: `?token=your_token`. +Remember to change the macros `{$GITLAB.URL}`. Also, see the Macros section for a list of macros used to set trigger values. *NOTE.* Some metrics may not be collected depending on your Gitlab instance version and configuration. See [Gitlab's documentation](https://docs.gitlab.com/ee/administration/monitoring/prometheus/gitlab_metrics.html) for further information about its metric collection. @@ -36,14 +38,15 @@ No specific Zabbix configuration is required. |Name|Description|Default| |----|-----------|-------| -|{$GITLAB.HTTP.FAIL.MAX.WARN} |<p>Maximum number of HTTP requests failures for trigger expression.</p> |`2` | -|{$GITLAB.OPEN.FDS.MAX.WARN} |<p>Maximum percentage of used file descriptors for trigger expression.</p> |`90` | -|{$GITLAB.PUMA.QUEUE.MAX.WARN} |<p>Maximum number of Puma queued requests for trigger expression.</p> |`1` | -|{$GITLAB.PUMA.UTILIZATION.MAX.WARN} |<p>Maximum percentage of used Puma thread utilization for trigger expression.</p> |`90` | -|{$GITLAB.REDIS.FAIL.MAX.WARN} |<p>Maximum number of Redis client exceptions for trigger expression.</p> |`2` | -|{$GITLAB.UNICORN.QUEUE.MAX.WARN} |<p>Maximum number of Unicorn queued requests for trigger expression.</p> |`1` | -|{$GITLAB.UNICORN.UTILIZATION.MAX.WARN} |<p>Maximum percentage of used Unicorn workers utilization for trigger expression.</p> |`90` | -|{$GITLAB.URL} |<p>GitLab instance URL</p> |`http://localhost` | +|{$GITLAB.HEALTH.TOKEN} |<p>The token path for Gitlab health check. Example `?token=your_token`</p> |`` | +|{$GITLAB.HTTP.FAIL.MAX.WARN} |<p>The maximum number of HTTP request failures for a trigger expression.</p> |`2` | +|{$GITLAB.OPEN.FDS.MAX.WARN} |<p>The maximum percentage of used file descriptors for a trigger expression.</p> |`90` | +|{$GITLAB.PUMA.QUEUE.MAX.WARN} |<p>The maximum number of PUMA queued requests for a trigger expression.</p> |`1` | +|{$GITLAB.PUMA.UTILIZATION.MAX.WARN} |<p>The maximum percentage of PUMA thread utilization for a trigger expression.</p> |`90` | +|{$GITLAB.REDIS.FAIL.MAX.WARN} |<p>The maximum number of Redis client exceptions for a trigger expression.</p> |`2` | +|{$GITLAB.UNICORN.QUEUE.MAX.WARN} |<p>The maximum number of Unicorn queued requests for a trigger expression.</p> |`1` | +|{$GITLAB.UNICORN.UTILIZATION.MAX.WARN} |<p>The maximum percentage of Unicorn workers utilization for a trigger expression.</p> |`90` | +|{$GITLAB.URL} |<p>URL of a GitLab instance.</p> |`http://localhost` | ## Template links @@ -123,11 +126,11 @@ There are no template links in this template. |----|-----------|----|----|----| |GitLab: Gitlab instance is not able to accept traffic |<p>-</p> |`last(/GitLab by HTTP/gitlab.readiness)=0` |HIGH |<p>**Depends on**:</p><p>- GitLab: Liveness check was failed</p> | |GitLab: Liveness check was failed |<p>The application server is not running or Rails Controllers are deadlocked.</p> |`last(/GitLab by HTTP/gitlab.liveness)=0` |HIGH | | -|GitLab: Version has changed |<p>GitLab version has changed. Ack to close.</p> |`last(/GitLab by HTTP/gitlab.deployments.version,#1)<>last(/GitLab by HTTP/gitlab.deployments.version,#2) and length(last(/GitLab by HTTP/gitlab.deployments.version))>0` |INFO |<p>Manual close: YES</p> | +|GitLab: Version has changed |<p>The GitLab version has changed. Perform Ack to close.</p> |`last(/GitLab by HTTP/gitlab.deployments.version,#1)<>last(/GitLab by HTTP/gitlab.deployments.version,#2) and length(last(/GitLab by HTTP/gitlab.deployments.version))>0` |INFO |<p>Manual close: YES</p> | |GitLab: Too many Redis queues client exceptions |<p>"Too many Redis client exceptions during the requests to Redis instance queues."</p> |`min(/GitLab by HTTP/gitlab.redis.client_exceptions.queues.rate,5m)>{$GITLAB.REDIS.FAIL.MAX.WARN}` |WARNING | | |GitLab: Too many Redis cache client exceptions |<p>"Too many Redis client exceptions during the requests to Redis instance cache."</p> |`min(/GitLab by HTTP/gitlab.redis.client_exceptions.cache.rate,5m)>{$GITLAB.REDIS.FAIL.MAX.WARN}` |WARNING | | |GitLab: Too many Redis shared_state client exceptions |<p>"Too many Redis client exceptions during the requests to Redis instance shared_state."</p> |`min(/GitLab by HTTP/gitlab.redis.client_exceptions.shared_state.rate,5m)>{$GITLAB.REDIS.FAIL.MAX.WARN}` |WARNING | | -|GitLab: Failed to fetch info data |<p>Zabbix has not received data for metrics for the last 30 minutes</p> |`nodata(/GitLab by HTTP/gitlab.ruby.threads_running,30m)=1` |WARNING |<p>Manual close: YES</p><p>**Depends on**:</p><p>- GitLab: Liveness check was failed</p> | +|GitLab: Failed to fetch info data |<p>Zabbix has not received a metrics data for the last 30 minutes</p> |`nodata(/GitLab by HTTP/gitlab.ruby.threads_running,30m)=1` |WARNING |<p>Manual close: YES</p><p>**Depends on**:</p><p>- GitLab: Liveness check was failed</p> | |GitLab: Current number of open files is too high |<p>-</p> |`min(/GitLab by HTTP/gitlab.ruby.file_descriptors.max,5m)/last(/GitLab by HTTP/gitlab.ruby.process_max_fds)*100>{$GITLAB.OPEN.FDS.MAX.WARN}` |WARNING | | |GitLab: Too many HTTP requests failures |<p>"Too many requests failed on GitLab instance with 5xx HTTP code"</p> |`min(/GitLab by HTTP/gitlab.http.requests.5xx.rate,5m)>{$GITLAB.HTTP.FAIL.MAX.WARN}` |WARNING | | |GitLab: Puma instance thread utilization is too high |<p>-</p> |`min(/GitLab by HTTP/gitlab.puma.active_connections[{#SINGLETON}],5m)/last(/GitLab by HTTP/gitlab.puma.max_threads[{#SINGLETON}])*100>{$GITLAB.PUMA.UTILIZATION.MAX.WARN}` |WARNING | | @@ -137,7 +140,7 @@ There are no template links in this template. ## Feedback -Please report any issues with the template at https://support.zabbix.com +Please report any issues with the template at https://support.zabbix.com. -You can also provide feedback, discuss the template or ask for help with it at [ZABBIX forums](https://www.zabbix.com/forum/zabbix-suggestions-and-feedback). +You can also provide feedback, discuss the template, or ask for help at [ZABBIX forums](https://www.zabbix.com/forum/zabbix-suggestions-and-feedback). diff --git a/templates/app/gitlab_http/template_app_gitlab_http.yaml b/templates/app/gitlab_http/template_app_gitlab_http.yaml index f220fa185bd..621d25bf1b9 100644 --- a/templates/app/gitlab_http/template_app_gitlab_http.yaml +++ b/templates/app/gitlab_http/template_app_gitlab_http.yaml @@ -1,7 +1,7 @@ zabbix_export: version: '6.2' - date: '2022-06-07T19:33:21Z' - template_groups: + date: '2022-10-20T15:04:55Z' + groups: - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6 name: Templates/Applications @@ -14,7 +14,7 @@ zabbix_export: Get GitLab metrics by HTTP agent from Prometheus metrics endpoint. To access the metrics, the client IP address must be explicitly allowed. See https://docs.gitlab.com/ee/administration/monitoring/ip_whitelist.html. - + Or second method, using token variable from http://your.gitlab.address/admin/health_check (fill {$GITLAB.HEALTH.TOKEN} macro with variable path like "?token=your_token"). Don't forget change macros {$GITLAB.URL}. Some metrics may not be collected depending on your Gitlab instance version and configuration. See (Gitlab's documentation[)https://docs.gitlab.com/ee/administration/monitoring/prometheus/gitlab_metrics.html] for further information about its metric collection. @@ -219,7 +219,7 @@ zabbix_export: name: 'GitLab: Version has changed' event_name: 'GitLab: Version has changed (new version: {ITEM.VALUE})' priority: INFO - description: 'GitLab version has changed. Ack to close.' + description: 'The GitLab version has changed. Perform Ack to close.' manual_close: 'YES' tags: - @@ -262,7 +262,7 @@ zabbix_export: type: PROMETHEUS_TO_JSON parameters: - '' - url: '{$GITLAB.URL}/-/metrics' + url: '{$GITLAB.URL}/-/metrics{$GITLAB.HEALTH.TOKEN}' tags: - tag: component @@ -392,7 +392,7 @@ zabbix_export: type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 30m - url: '{$GITLAB.URL}/-/liveness' + url: '{$GITLAB.URL}/-/liveness{$GITLAB.HEALTH.TOKEN}' tags: - tag: component @@ -561,7 +561,7 @@ zabbix_export: type: DISCARD_UNCHANGED_HEARTBEAT parameters: - 30m - url: '{$GITLAB.URL}/-/readiness' + url: '{$GITLAB.URL}/-/readiness{$GITLAB.HEALTH.TOKEN}' tags: - tag: component @@ -1012,7 +1012,7 @@ zabbix_export: name: 'GitLab: Failed to fetch info data' event_name: 'GitLab: Failed to fetch info data (or no data for 30m)' priority: WARNING - description: 'Zabbix has not received data for metrics for the last 30 minutes' + description: 'Zabbix has not received a metrics data for the last 30 minutes' manual_close: 'YES' dependencies: - @@ -1330,7 +1330,7 @@ zabbix_export: - tag: scope value: capacity - url: '{$GITLAB.URL}/-/metrics' + url: '{$GITLAB.URL}/-/metrics{$GITLAB.HEALTH.TOKEN}' preprocessing: - type: PROMETHEUS_TO_JSON @@ -1427,7 +1427,7 @@ zabbix_export: - tag: scope value: capacity - url: '{$GITLAB.URL}/-/metrics' + url: '{$GITLAB.URL}/-/metrics{$GITLAB.HEALTH.TOKEN}' preprocessing: - type: PROMETHEUS_TO_JSON @@ -1447,37 +1447,40 @@ zabbix_export: value: gitlab macros: - + macro: '{$GITLAB.HEALTH.TOKEN}' + description: 'The token path for Gitlab health check. Example `?token=your_token`' + - macro: '{$GITLAB.HTTP.FAIL.MAX.WARN}' value: '2' - description: 'Maximum number of HTTP requests failures for trigger expression.' + description: 'The maximum number of HTTP request failures for a trigger expression.' - macro: '{$GITLAB.OPEN.FDS.MAX.WARN}' value: '90' - description: 'Maximum percentage of used file descriptors for trigger expression.' + description: 'The maximum percentage of used file descriptors for a trigger expression.' - macro: '{$GITLAB.PUMA.QUEUE.MAX.WARN}' value: '1' - description: 'Maximum number of Puma queued requests for trigger expression.' + description: 'The maximum number of Puma queued requests for a trigger expression.' - macro: '{$GITLAB.PUMA.UTILIZATION.MAX.WARN}' value: '90' - description: 'Maximum percentage of used Puma thread utilization for trigger expression.' + description: 'The maximum percentage of Puma thread utilization for a trigger expression.' - macro: '{$GITLAB.REDIS.FAIL.MAX.WARN}' value: '2' - description: 'Maximum number of Redis client exceptions for trigger expression.' + description: 'The maximum number of Redis client exceptions for a trigger expression.' - macro: '{$GITLAB.UNICORN.QUEUE.MAX.WARN}' value: '1' - description: 'Maximum number of Unicorn queued requests for trigger expression.' + description: 'The maximum number of Unicorn queued requests for a trigger expression.' - macro: '{$GITLAB.UNICORN.UTILIZATION.MAX.WARN}' value: '90' - description: 'Maximum percentage of used Unicorn workers utilization for trigger expression.' + description: 'The maximum percentage of Unicorn workers utilization for a trigger expression.' - macro: '{$GITLAB.URL}' value: 'http://localhost' - description: 'GitLab instance URL' + description: 'URL of a GitLab instance.' valuemaps: - uuid: 3b40391bb8b6472e9c3fd8e1f001fe04 |