2019-07-29 23:03:59 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Fetches the system metrics dashboard and formats the output.
|
2019-11-27 12:06:30 +00:00
|
|
|
# Use Gitlab::Metrics::Dashboard::Finder to retrieve dashboards.
|
2019-07-29 23:03:59 +00:00
|
|
|
module Metrics
|
|
|
|
module Dashboard
|
2019-11-27 12:06:30 +00:00
|
|
|
class SystemDashboardService < ::Metrics::Dashboard::PredefinedDashboardService
|
|
|
|
DASHBOARD_PATH = 'config/prometheus/common_metrics.yml'
|
2020-07-30 21:09:35 +00:00
|
|
|
DASHBOARD_NAME = N_('Overview')
|
2019-07-29 23:03:59 +00:00
|
|
|
|
2020-07-16 21:10:05 +00:00
|
|
|
# SHA256 hash of dashboard content
|
2020-08-05 12:09:45 +00:00
|
|
|
DASHBOARD_VERSION = 'ce9ae27d2913f637de851d61099bc4151583eae68b1386a2176339ef6e653223'
|
2020-07-16 21:10:05 +00:00
|
|
|
|
2019-09-18 14:02:45 +00:00
|
|
|
SEQUENCE = [
|
|
|
|
STAGES::CommonMetricsInserter,
|
2020-03-19 12:09:33 +00:00
|
|
|
STAGES::CustomMetricsInserter,
|
|
|
|
STAGES::CustomMetricsDetailsInserter,
|
2020-06-18 15:08:45 +00:00
|
|
|
STAGES::MetricEndpointInserter,
|
|
|
|
STAGES::VariableEndpointInserter,
|
2020-04-10 15:09:50 +00:00
|
|
|
STAGES::PanelIdsInserter,
|
2020-04-13 12:10:03 +00:00
|
|
|
STAGES::AlertsInserter
|
2019-09-18 14:02:45 +00:00
|
|
|
].freeze
|
|
|
|
|
2019-07-29 23:03:59 +00:00
|
|
|
class << self
|
|
|
|
def all_dashboard_paths(_project)
|
|
|
|
[{
|
2019-11-27 12:06:30 +00:00
|
|
|
path: DASHBOARD_PATH,
|
2020-06-02 15:08:24 +00:00
|
|
|
display_name: _(DASHBOARD_NAME),
|
2019-11-13 00:06:18 +00:00
|
|
|
default: true,
|
2020-07-01 09:09:30 +00:00
|
|
|
system_dashboard: true,
|
|
|
|
out_of_the_box_dashboard: out_of_the_box_dashboard?
|
2019-07-29 23:03:59 +00:00
|
|
|
}]
|
|
|
|
end
|
|
|
|
end
|
2020-07-16 21:10:05 +00:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def dashboard_version
|
|
|
|
DASHBOARD_VERSION
|
|
|
|
end
|
2019-07-29 23:03:59 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|