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:
Diffstat (limited to 'lib/gitlab/metrics/dashboard/stages/endpoint_inserter.rb')
-rw-r--r--lib/gitlab/metrics/dashboard/stages/endpoint_inserter.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/metrics/dashboard/stages/endpoint_inserter.rb b/lib/gitlab/metrics/dashboard/stages/endpoint_inserter.rb
index 2a959854be0..c00ef208848 100644
--- a/lib/gitlab/metrics/dashboard/stages/endpoint_inserter.rb
+++ b/lib/gitlab/metrics/dashboard/stages/endpoint_inserter.rb
@@ -5,9 +5,9 @@ module Gitlab
module Dashboard
module Stages
class EndpointInserter < BaseStage
- MissingQueryError = Class.new(DashboardProcessingError)
-
def transform!
+ raise Errors::DashboardProcessingError.new('Environment is required for Stages::EndpointInserter') unless params[:environment]
+
for_metrics do |metric|
metric[:prometheus_endpoint_path] = endpoint_for_metric(metric)
end
@@ -18,7 +18,7 @@ module Gitlab
def endpoint_for_metric(metric)
Gitlab::Routing.url_helpers.prometheus_api_project_environment_path(
project,
- environment,
+ params[:environment],
proxy_path: query_type(metric),
query: query_for_metric(metric)
)
@@ -31,7 +31,7 @@ module Gitlab
def query_for_metric(metric)
query = metric[query_type(metric)]
- raise MissingQueryError.new('Each "metric" must define one of :query or :query_range') unless query
+ raise Errors::MissingQueryError.new('Each "metric" must define one of :query or :query_range') unless query
query
end