diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-04 12:06:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-04 12:06:21 +0300 |
commit | 2b7a5214342baa2575b35868316ea9413d2afe1f (patch) | |
tree | f80a862f7fa382620b8f8a695d07b6d1734fc5f5 /lib/gitlab/database_importers | |
parent | 15a2d004be2f79160752d77f701c0f08e7f96973 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/database_importers')
-rw-r--r-- | lib/gitlab/database_importers/self_monitoring/project/create_service.rb | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/lib/gitlab/database_importers/self_monitoring/project/create_service.rb b/lib/gitlab/database_importers/self_monitoring/project/create_service.rb index dfef158cc1d..4677e984305 100644 --- a/lib/gitlab/database_importers/self_monitoring/project/create_service.rb +++ b/lib/gitlab/database_importers/self_monitoring/project/create_service.rb @@ -176,19 +176,11 @@ module Gitlab end def prometheus_enabled? - Gitlab.config.prometheus.enable if Gitlab.config.prometheus - rescue Settingslogic::MissingSetting - log_error('prometheus.enable is not present in config/gitlab.yml') - - false + ::Gitlab::Prometheus::Internal.prometheus_enabled? end def prometheus_listen_address - Gitlab.config.prometheus.listen_address.to_s if Gitlab.config.prometheus - rescue Settingslogic::MissingSetting - log_error('Prometheus listen_address is not present in config/gitlab.yml') - - nil + ::Gitlab::Prometheus::Internal.listen_address end def instance_admins @@ -231,23 +223,7 @@ module Gitlab end def internal_prometheus_listen_address_uri - if prometheus_listen_address.starts_with?('0.0.0.0:') - # 0.0.0.0:9090 - port = ':' + prometheus_listen_address.split(':').second - 'http://localhost' + port - - elsif prometheus_listen_address.starts_with?(':') - # :9090 - 'http://localhost' + prometheus_listen_address - - elsif prometheus_listen_address.starts_with?('http') - # https://localhost:9090 - prometheus_listen_address - - else - # localhost:9090 - 'http://' + prometheus_listen_address - end + ::Gitlab::Prometheus::Internal.uri end def prometheus_service_attributes |