debian-mirror-gitlab/lib/gitlab/prometheus/query_variables.rb
2019-07-31 17:26:46 +00:00

19 lines
543 B
Ruby

# frozen_string_literal: true
module Gitlab
module Prometheus
module QueryVariables
def self.call(environment)
deployment_platform = environment.deployment_platform
namespace = deployment_platform&.namespace_for(environment.project) ||
deployment_platform&.actual_namespace || ''
{
ci_environment_slug: environment.slug,
kube_namespace: namespace,
environment_filter: %{container_name!="POD",environment="#{environment.slug}"}
}
end
end
end
end