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
diff options
context:
space:
mode:
authorDavid Wilkins <dwilkins@gitlab.com>2019-08-07 05:42:20 +0300
committerAsh McKenzie <amckenzie@gitlab.com>2019-08-07 05:42:20 +0300
commit467a411e8892ecd6a3be7cd2f6772665f2c63651 (patch)
treec7ee78a5f64224569be50ae2534e10ce566fe6df /app/models/concerns/prometheus_adapter.rb
parentb67ed9c96720864b9ddae973b34f7456c9321789 (diff)
Convert RestClient to Gitlab::HTTP for Prometheus Monitor
- Closes #60024 - Change PrometheusClient.new to accept a base url instead of an already created RestClient - Use Gitlab::HTTP in PrometheusClient instead of creating RestClient in PrometheusService - Move http_options from PrometheusService to PrometheusClient (follow_redirects: false) - ensure that base urls don't have the trailing slash - Created a `PrometheusClient#url` method that might not be strictly required - Change rescued exceptions from RestClient::* to HTTParty::ResponseError where possible and StandardError for the rest
Diffstat (limited to 'app/models/concerns/prometheus_adapter.rb')
-rw-r--r--app/models/concerns/prometheus_adapter.rb6
1 files changed, 1 insertions, 5 deletions
diff --git a/app/models/concerns/prometheus_adapter.rb b/app/models/concerns/prometheus_adapter.rb
index c2542dbe743..9ac4722c6b1 100644
--- a/app/models/concerns/prometheus_adapter.rb
+++ b/app/models/concerns/prometheus_adapter.rb
@@ -14,10 +14,6 @@ module PrometheusAdapter
raise NotImplementedError
end
- def prometheus_client_wrapper
- Gitlab::PrometheusClient.new(prometheus_client)
- end
-
def can_query?
prometheus_client.present?
end
@@ -35,7 +31,7 @@ module PrometheusAdapter
def calculate_reactive_cache(query_class_name, *args)
return unless prometheus_client
- data = Object.const_get(query_class_name, false).new(prometheus_client_wrapper).query(*args)
+ data = Object.const_get(query_class_name, false).new(prometheus_client).query(*args)
{
success: true,
data: data,