Commit c2854617 authored by Pawel Chojnacki's avatar Pawel Chojnacki

Prometheus settings

parent 6b9a091c
...@@ -149,6 +149,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController ...@@ -149,6 +149,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
:version_check_enabled, :version_check_enabled,
:terminal_max_session_time, :terminal_max_session_time,
:polling_interval_multiplier, :polling_interval_multiplier,
:prometheus_metrics_enabled,
:usage_ping_enabled, :usage_ping_enabled,
disabled_oauth_sign_in_sources: [], disabled_oauth_sign_in_sources: [],
......
...@@ -123,6 +123,7 @@ ActiveRecord::Schema.define(version: 20170525174156) do ...@@ -123,6 +123,7 @@ ActiveRecord::Schema.define(version: 20170525174156) do
t.integer "cached_markdown_version" t.integer "cached_markdown_version"
t.boolean "clientside_sentry_enabled", default: false, null: false t.boolean "clientside_sentry_enabled", default: false, null: false
t.string "clientside_sentry_dsn" t.string "clientside_sentry_dsn"
t.boolean "prometheus_metrics_enabled", default: false, null: false
end end
create_table "audit_events", force: :cascade do |t| create_table "audit_events", force: :cascade do |t|
......
...@@ -110,6 +110,7 @@ module API ...@@ -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 :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 :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 :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' optional :metrics_enabled, type: Boolean, desc: 'Enable the InfluxDB metrics'
given metrics_enabled: ->(val) { val } do given metrics_enabled: ->(val) { val } do
requires :metrics_host, type: String, desc: 'The InfluxDB host' requires :metrics_host, type: String, desc: 'The InfluxDB host'
......
...@@ -11,7 +11,7 @@ module Gitlab ...@@ -11,7 +11,7 @@ module Gitlab
def self.settings def self.settings
@settings ||= { @settings ||= {
enabled: current_application_settings[:metrics_enabled], enabled: current_application_settings[:metrics_enabled],
prometheus_metrics_enabled: true, prometheus_metrics_enabled: current_application_settings[:prometheus_metrics_enabled],
pool_size: current_application_settings[:metrics_pool_size], pool_size: current_application_settings[:metrics_pool_size],
timeout: current_application_settings[:metrics_timeout], timeout: current_application_settings[:metrics_timeout],
method_call_threshold: current_application_settings[:metrics_method_call_threshold], method_call_threshold: current_application_settings[:metrics_method_call_threshold],
...@@ -31,7 +31,7 @@ module Gitlab ...@@ -31,7 +31,7 @@ module Gitlab
end end
def self.enabled? def self.enabled?
influx_metrics_enabled? || prometheus_metrics_enabled? || false influx_metrics_enabled? || prometheus_metrics_enabled?
end end
def self.mri? def self.mri?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment