summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2015-12-28 20:00:57 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2015-12-28 20:00:57 +0000
commitaf00558d38806eda2fa70c8fdc34be98fced44a4 (patch)
treea4b8ed0a000e5c3607307f7d1598b63da39fa85f /config
parent47fbba447423f274211173ddb60ade4d14961cb3 (diff)
parent4d925f2147884812e349031a19f0d7ced9d5fdaf (diff)
downloadgitlab-ce-af00558d38806eda2fa70c8fdc34be98fced44a4.tar.gz
Merge branch 'relocate-influxdb-settings' into 'master'
Move InfluxDB settings to ApplicationSetting This moves the settings from the YAML files to the database. cc @sytses See merge request !2228
Diffstat (limited to 'config')
-rw-r--r--config/gitlab.yml.example21
-rw-r--r--config/initializers/metrics.rb13
2 files changed, 10 insertions, 24 deletions
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index a26002ec07d..84f0dfb64c8 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -449,26 +449,9 @@ production: &base
#
# Ban an IP for one hour (3600s) after too many auth attempts
# bantime: 3600
- metrics:
- host: localhost
- enabled: false
- # The name of the InfluxDB database to store metrics in.
- database: gitlab
- # Credentials to use for logging in to InfluxDB.
- # username:
- # password:
- # The amount of InfluxDB connections to open.
- # pool_size: 16
- # The timeout of a connection in seconds.
- # timeout: 10
- # The minimum amount of milliseconds a method call has to take before it's
- # tracked. Defaults to 10.
- # method_call_threshold: 10
development:
<<: *base
- metrics:
- enabled: false
test:
<<: *base
@@ -511,10 +494,6 @@ test:
user_filter: ''
group_base: 'ou=groups,dc=example,dc=com'
admin_group: ''
- metrics:
- enabled: false
staging:
<<: *base
- metrics:
- enabled: false
diff --git a/config/initializers/metrics.rb b/config/initializers/metrics.rb
index a47d2bf59a6..2e4908192a1 100644
--- a/config/initializers/metrics.rb
+++ b/config/initializers/metrics.rb
@@ -32,10 +32,17 @@ if Gitlab::Metrics.enabled?
)
Gitlab::Metrics::Instrumentation.
- instrument_class_hierarchy(ActiveRecord::Base) do |_, method|
- loc = method.source_location
+ instrument_class_hierarchy(ActiveRecord::Base) do |klass, method|
+ # Instrumenting the ApplicationSetting class can lead to an infinite
+ # loop. Since the data is cached any way we don't really need to
+ # instrument it.
+ if klass == ApplicationSetting
+ false
+ else
+ loc = method.source_location
- loc && loc[0].start_with?(models) && method.source =~ regex
+ loc && loc[0].start_with?(models) && method.source =~ regex
+ end
end
end