debian-mirror-gitlab/app/graphql/resolvers/metrics/dashboards/annotation_resolver.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
883 B
Ruby
Raw Normal View History

2020-04-22 19:07:51 +05:30
# frozen_string_literal: true
module Resolvers
module Metrics
module Dashboards
class AnnotationResolver < Resolvers::BaseResolver
argument :from, Types::TimeType,
required: true,
2021-03-08 18:12:59 +05:30
description: "Timestamp marking date and time from which annotations need to be fetched."
2020-04-22 19:07:51 +05:30
argument :to, Types::TimeType,
required: false,
2021-03-08 18:12:59 +05:30
description: "Timestamp marking date and time to which annotations need to be fetched."
2020-04-22 19:07:51 +05:30
type Types::Metrics::Dashboards::AnnotationType, null: true
alias_method :dashboard, :object
def resolve(**args)
2023-07-09 08:55:56 +05:30
return if Feature.enabled?(:remove_monitor_metrics)
2020-04-22 19:07:51 +05:30
return [] unless dashboard
::Metrics::Dashboards::AnnotationsFinder.new(dashboard: dashboard, params: args).execute
end
end
end
end
end