Welcome to mirror list, hosted at ThFree Co, Russian Federation.

additional_metrics_deployment_query.rb « queries « prometheus « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7693772bf814c40a8372e1aa4b978d77a34ead9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module Gitlab::Prometheus::Queries
  class AdditionalMetricsDeploymentQuery < AdditionalMetricsQuery
    def query(deployment_id)
      deployment = Deployment.find_by(id: deployment_id)
      query_context = {
        environment_slug: deployment.environment.slug,
        environment_filter: %{container_name!="POD",environment="#{deployment.environment.slug}"},
        timeframe_start: (deployment.created_at - 30.minutes).to_f,
        timeframe_end: (deployment.created_at + 30.minutes).to_f
      }

      query_metrics(query_context)
    end
  end
end