Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2015-12-28 20:00:32 +0300
committerYorick Peterse <yorickpeterse@gmail.com>2015-12-28 20:00:32 +0300
commit4d925f2147884812e349031a19f0d7ced9d5fdaf (patch)
treec15476c76ec6d6f0d2522b7362dec404aecb5dd9 /config
parent540eb0a9affef14329418b32be0dcd60f2b66e29 (diff)
Move InfluxDB settings to ApplicationSetting
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 da6d4005da6..79fc7423b31 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