diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-05-19 12:49:15 +0200 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-06-02 19:45:57 +0200 |
commit | c28546177e2b4d5f7f3cc0e5b3a7b404206565fb (patch) | |
tree | 3f539df45149ac841c4f7823653227a6ca78b186 /lib | |
parent | 6b9a091ceeb1c760be14f749956807bc429af46d (diff) | |
download | gitlab-ce-c28546177e2b4d5f7f3cc0e5b3a7b404206565fb.tar.gz |
Prometheus settings
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/settings.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/metrics.rb | 20 |
2 files changed, 11 insertions, 10 deletions
diff --git a/lib/api/settings.rb b/lib/api/settings.rb index 82f513c984e..25027c3b114 100644 --- a/lib/api/settings.rb +++ b/lib/api/settings.rb @@ -110,6 +110,7 @@ module API optional :default_artifacts_expire_in, type: String, desc: "Set the default expiration time for each job's artifacts" optional :max_pages_size, type: Integer, desc: 'Maximum size of pages in MB' optional :container_registry_token_expire_delay, type: Integer, desc: 'Authorization token duration (minutes)' + optional :prometheus_metrics_enabled, type: Boolean, desc: 'Enable Prometheus metrics' optional :metrics_enabled, type: Boolean, desc: 'Enable the InfluxDB metrics' given metrics_enabled: ->(val) { val } do requires :metrics_host, type: String, desc: 'The InfluxDB host' diff --git a/lib/gitlab/metrics.rb b/lib/gitlab/metrics.rb index e784ca785f0..6f50c0aa028 100644 --- a/lib/gitlab/metrics.rb +++ b/lib/gitlab/metrics.rb @@ -10,15 +10,15 @@ module Gitlab def self.settings @settings ||= { - enabled: current_application_settings[:metrics_enabled], - prometheus_metrics_enabled: true, - pool_size: current_application_settings[:metrics_pool_size], - timeout: current_application_settings[:metrics_timeout], - method_call_threshold: current_application_settings[:metrics_method_call_threshold], - host: current_application_settings[:metrics_host], - port: current_application_settings[:metrics_port], - sample_interval: current_application_settings[:metrics_sample_interval] || 15, - packet_size: current_application_settings[:metrics_packet_size] || 1 + enabled: current_application_settings[:metrics_enabled], + prometheus_metrics_enabled: current_application_settings[:prometheus_metrics_enabled], + pool_size: current_application_settings[:metrics_pool_size], + timeout: current_application_settings[:metrics_timeout], + method_call_threshold: current_application_settings[:metrics_method_call_threshold], + host: current_application_settings[:metrics_host], + port: current_application_settings[:metrics_port], + sample_interval: current_application_settings[:metrics_sample_interval] || 15, + packet_size: current_application_settings[:metrics_packet_size] || 1 } end @@ -31,7 +31,7 @@ module Gitlab end def self.enabled? - influx_metrics_enabled? || prometheus_metrics_enabled? || false + influx_metrics_enabled? || prometheus_metrics_enabled? end def self.mri? |