Skip to content
Snippets Groups Projects
Commit 1be5668a authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Added host option for InfluxDB

parent db7bbadf
No related branches found
No related tags found
1 merge request!2042Storing of application metrics in InfluxDB
Pipeline #
Loading
@@ -422,6 +422,7 @@ production: &base
Loading
@@ -422,6 +422,7 @@ production: &base
# Ban an IP for one hour (3600s) after too many auth attempts # Ban an IP for one hour (3600s) after too many auth attempts
# bantime: 3600 # bantime: 3600
metrics: metrics:
host: localhost
enabled: false enabled: false
# The name of the InfluxDB database to store metrics in. # The name of the InfluxDB database to store metrics in.
database: gitlab database: gitlab
Loading
Loading
Loading
@@ -52,11 +52,12 @@ module Gitlab
Loading
@@ -52,11 +52,12 @@ module Gitlab
# "@foo ||= bar" is _not_ thread-safe. # "@foo ||= bar" is _not_ thread-safe.
if enabled? if enabled?
@pool = ConnectionPool.new(size: pool_size, timeout: timeout) do @pool = ConnectionPool.new(size: pool_size, timeout: timeout) do
host = Settings.metrics['host']
db = Settings.metrics['database'] db = Settings.metrics['database']
user = Settings.metrics['username'] user = Settings.metrics['username']
pw = Settings.metrics['password'] pw = Settings.metrics['password']
   
InfluxDB::Client.new(db, username: user, password: pw) InfluxDB::Client.new(db, host: host, username: user, password: pw)
end end
end end
end end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment