GEO: improve external integrations
Summary
In many cases, the secondary nodes do not have access to the primary ElasticSearch or InfluxDB. It would be helpful to allow for these to be configured independently of Geo. That would allow for the secondary to be able to define its own settings or allow for the secondary to not have the integration enabled.
Currently, when InfluxDB is setup, the secondary production logs are spammed with errors when it cannot access the InfluxDB.
E, [2018-05-23T07:24:04.077571 #11826] ERROR -- : Cannot resolve InfluxDB address. GitLab Performance Monitoring will not work.
E, [2018-05-23T07:24:04.077700 #11826] ERROR -- : getaddrinfo: Name or service not known (SocketError)
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/influxdb-0.2.3/lib/influxdb/writer/udp.rb:13:in `connect'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/influxdb-0.2.3/lib/influxdb/writer/udp.rb:13:in `initialize'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/influxdb-0.2.3/lib/influxdb/client.rb:64:in `new'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/influxdb-0.2.3/lib/influxdb/client.rb:64:in `initialize'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/influx_db.rb:169:in `new'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/influx_db.rb:169:in `block (2 levels) in pool'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/connection_pool-2.2.1/lib/connection_pool/timed_stack.rb:170:in `try_create'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/connection_pool-2.2.1/lib/connection_pool/timed_stack.rb:82:in `block (2 levels) in pop'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/connection_pool-2.2.1/lib/connection_pool/timed_stack.rb:78:in `loop'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/connection_pool-2.2.1/lib/connection_pool/timed_stack.rb:78:in `block in pop'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/connection_pool-2.2.1/lib/connection_pool/timed_stack.rb:77:in `synchronize'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/connection_pool-2.2.1/lib/connection_pool/timed_stack.rb:77:in `pop'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/connection_pool-2.2.1/lib/connection_pool.rb:89:in `checkout'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/connection_pool-2.2.1/lib/connection_pool.rb:61:in `block in with'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/connection_pool-2.2.1/lib/connection_pool.rb:60:in `handle_interrupt'
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/connection_pool-2.2.1/lib/connection_pool.rb:60:in `with'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/influx_db.rb:48:in `submit_metrics'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/samplers/influx_sampler.rb:39:in `flush'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/samplers/influx_sampler.rb:32:in `sample'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/samplers/base_sampler.rb:18:in `safe_sample'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/metrics/samplers/base_sampler.rb:53:in `start_working'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/daemon.rb:35:in `block (2 levels) in start'
Links
Customer ticket -> https://gitlab.zendesk.com/agent/tickets/96633 (internal)
Relates to https://gitlab.com/gitlab-org/gitlab-ee/issues/1186