From 5c2e00e2ec4885da3b59fafccbd31099c5668a34 Mon Sep 17 00:00:00 2001 From: Silas Rech Date: Thu, 24 Aug 2017 16:50:32 +0200 Subject: [PATCH] Add monitoring keys --- assets/runtime/config/gitlabhq/gitlab.yml | 10 +++++----- assets/runtime/env-defaults | 7 +++++++ assets/runtime/functions | 13 +++++++++++++ 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/assets/runtime/config/gitlabhq/gitlab.yml b/assets/runtime/config/gitlabhq/gitlab.yml index 3c8925ef..053beec5 100644 --- a/assets/runtime/config/gitlabhq/gitlab.yml +++ b/assets/runtime/config/gitlabhq/gitlab.yml @@ -573,15 +573,15 @@ production: &base # Built in monitoring settings monitoring: # Time between sampling of unicorn socket metrics, in seconds - # unicorn_sampler_interval: 10 + unicorn_sampler_interval: {{GITLAB_MONITORING_UNICORN_SAMPLER_INTERVAL}} # IP whitelist to access monitoring endpoints ip_whitelist: - - 127.0.0.0/8 + - {{GITLAB_MONITORING_IP_WHITELIST}} # Sidekiq exporter is webserver built in to Sidekiq to expose Prometheus metrics sidekiq_exporter: - # enabled: true - # address: localhost - # port: 3807 + enabled: {{GITLAB_MONITORING_SIDEKIQ_EXPORTER_ENABLED}} + address: {{GITLAB_MONITORING_SIDEKIQ_EXPORTER_ADDRESS}} + port: {{GITLAB_MONITORING_SIDEKIQ_EXPORTER_PORT}} # # 5. Extra customization diff --git a/assets/runtime/env-defaults b/assets/runtime/env-defaults index 60ec6cfe..3ff322dd 100644 --- a/assets/runtime/env-defaults +++ b/assets/runtime/env-defaults @@ -383,3 +383,10 @@ GITALY_ENABLED=${GITALY_ENABLED:-true} GITALY_TOKEN=${GITALY_TOKEN:-} GITALY_SOCKET_PATH=${GITLAB_INSTALL_DIR}/tmp/sockets/private/gitaly.socket GITALY_ADDRESS=${GITALY_ADDRESS:-unix:$GITALY_SOCKET_PATH} + +## MONITORING +GITLAB_MONITORING_UNICORN_SAMPLER_INTERVAL=${GITLAB_MONITORING_UNICORN_SAMPLER_INTERVAL:-10} +GITLAB_MONITORING_IP_WHITELIST=${GITLAB_MONITORING_IP_WHITELIST:-"0.0.0.0/8"} +GITLAB_MONITORING_SIDEKIQ_EXPORTER_ENABLED=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_ENABLED:-true} +GITLAB_MONITORING_SIDEKIQ_EXPORTER_ADDRESS=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_ADDRESS:-"0.0.0.0"} +GITLAB_MONITORING_SIDEKIQ_EXPORTER_PORT=${GITLAB_MONITORING_SIDEKIQ_EXPORTER_PORT:-3807} diff --git a/assets/runtime/functions b/assets/runtime/functions index 69cd31b1..d7fd1b2e 100644 --- a/assets/runtime/functions +++ b/assets/runtime/functions @@ -287,6 +287,18 @@ gitlab_configure_gitaly() { } +gitlab_configure_monitoring() { + echo "Configuring gitlab::monitoring..." + + update_template ${GITLAB_CONFIG} \ + GITLAB_MONITORING_UNICORN_SAMPLER_INTERVAL \ + GITLAB_MONITORING_IP_WHITELIST \ + GITLAB_MONITORING_SIDEKIQ_EXPORTER_ENABLED \ + GITLAB_MONITORING_SIDEKIQ_EXPORTER_ADDRESS \ + GITLAB_MONITORING_SIDEKIQ_EXPORTER_PORT + +} + gitlab_configure_gitlab_workhorse() { echo "Configuring gitlab::gitlab-workhorse..." update_template /etc/supervisor/conf.d/gitlab-workhorse.conf \ @@ -1434,6 +1446,7 @@ configure_gitlab() { gitlab_configure_secrets gitlab_configure_sidekiq gitlab_configure_gitaly + gitlab_configure_monitoring gitlab_configure_gitlab_workhorse gitlab_configure_relative_url gitlab_configure_trusted_proxies