2020-07-08 08:09:33 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Fetches the system metrics dashboard and formats the output.
|
|
|
|
# Use Gitlab::Metrics::Dashboard::Finder to retrive dashboards.
|
|
|
|
module Metrics
|
|
|
|
module Dashboard
|
|
|
|
class ClusterDashboardService < ::Metrics::Dashboard::PredefinedDashboardService
|
|
|
|
DASHBOARD_PATH = 'config/prometheus/cluster_metrics.yml'
|
|
|
|
DASHBOARD_NAME = 'Cluster'
|
|
|
|
|
2020-07-16 17:10:05 -04:00
|
|
|
# SHA256 hash of dashboard content
|
2020-08-05 08:09:45 -04:00
|
|
|
DASHBOARD_VERSION = 'e1a4f8cc2c044cf32273af2cd775eb484729baac0995db687d81d92686bf588e'
|
2020-07-16 17:10:05 -04:00
|
|
|
|
2020-07-08 08:09:33 -04:00
|
|
|
SEQUENCE = [
|
|
|
|
STAGES::ClusterEndpointInserter,
|
2020-08-12 08:10:25 -04:00
|
|
|
STAGES::PanelIdsInserter
|
2020-07-08 08:09:33 -04:00
|
|
|
].freeze
|
|
|
|
|
|
|
|
class << self
|
|
|
|
def valid_params?(params)
|
|
|
|
# support selecting this service by cluster id via .find
|
|
|
|
# Use super to support selecting this service by dashboard_path via .find_raw
|
|
|
|
(params[:cluster].present? && params[:embedded] != 'true') || super
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# Permissions are handled at the controller level
|
|
|
|
def allowed?
|
|
|
|
true
|
|
|
|
end
|
2020-07-16 17:10:05 -04:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def dashboard_version
|
|
|
|
DASHBOARD_VERSION
|
|
|
|
end
|
2020-07-08 08:09:33 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|