debian-mirror-gitlab/lib/gitlab/prometheus/query_variables.rb

19 lines
503 B
Ruby
Raw Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
module Gitlab
module Prometheus
module QueryVariables
def self.call(environment)
2019-07-31 22:56:46 +05:30
deployment_platform = environment.deployment_platform
2019-09-04 21:01:54 +05:30
namespace = deployment_platform&.kubernetes_namespace_for(environment.project) || ''
2019-07-31 22:56:46 +05:30
2019-02-15 15:39:39 +05:30
{
ci_environment_slug: environment.slug,
2019-07-31 22:56:46 +05:30
kube_namespace: namespace,
2019-02-15 15:39:39 +05:30
environment_filter: %{container_name!="POD",environment="#{environment.slug}"}
}
end
end
end
end