debian-mirror-gitlab/app/services/metrics/dashboard/system_dashboard_service.rb

44 lines
1.2 KiB
Ruby
Raw Normal View History

2019-10-12 21:52:04 +05:30
# frozen_string_literal: true
# Fetches the system metrics dashboard and formats the output.
2020-01-01 13:55:28 +05:30
# Use Gitlab::Metrics::Dashboard::Finder to retrieve dashboards.
2019-10-12 21:52:04 +05:30
module Metrics
module Dashboard
2020-01-01 13:55:28 +05:30
class SystemDashboardService < ::Metrics::Dashboard::PredefinedDashboardService
DASHBOARD_PATH = 'config/prometheus/common_metrics.yml'
2020-10-24 23:57:45 +05:30
DASHBOARD_NAME = N_('Overview')
2019-10-12 21:52:04 +05:30
2020-07-28 23:09:34 +05:30
# SHA256 hash of dashboard content
2020-10-24 23:57:45 +05:30
DASHBOARD_VERSION = 'ce9ae27d2913f637de851d61099bc4151583eae68b1386a2176339ef6e653223'
2020-07-28 23:09:34 +05:30
2019-12-04 20:38:33 +05:30
SEQUENCE = [
STAGES::CommonMetricsInserter,
2020-04-22 19:07:51 +05:30
STAGES::CustomMetricsInserter,
STAGES::CustomMetricsDetailsInserter,
2020-07-28 23:09:34 +05:30
STAGES::MetricEndpointInserter,
STAGES::VariableEndpointInserter,
2020-04-22 19:07:51 +05:30
STAGES::PanelIdsInserter,
STAGES::AlertsInserter
2019-12-04 20:38:33 +05:30
].freeze
2019-10-12 21:52:04 +05:30
class << self
def all_dashboard_paths(_project)
[{
2020-01-01 13:55:28 +05:30
path: DASHBOARD_PATH,
2020-06-23 00:09:42 +05:30
display_name: _(DASHBOARD_NAME),
2019-12-26 22:10:19 +05:30
default: true,
2020-07-28 23:09:34 +05:30
system_dashboard: true,
out_of_the_box_dashboard: out_of_the_box_dashboard?
2019-10-12 21:52:04 +05:30
}]
end
end
2020-07-28 23:09:34 +05:30
private
def dashboard_version
DASHBOARD_VERSION
end
2019-10-12 21:52:04 +05:30
end
end
end