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

45 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-06-23 00:09:42 +05:30
DASHBOARD_NAME = N_('Default dashboard')
2019-10-12 21:52:04 +05:30
2020-07-28 23:09:34 +05:30
# SHA256 hash of dashboard content
DASHBOARD_VERSION = '4685fe386c25b1a786b3be18f79bb2ee9828019003e003816284cdb634fa3e13'
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::Sorter,
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