debian-mirror-gitlab/lib/gitlab/prometheus/query_variables.rb
2019-09-04 21:01:54 +05:30

18 lines
503 B
Ruby

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