Class: Metrics::Dashboard::SelfMonitoringDashboardService

Inherits:
PredefinedDashboardService show all
Defined in:
app/services/metrics/dashboard/self_monitoring_dashboard_service.rb

Constant Summary collapse

DASHBOARD_PATH =
'config/prometheus/self_monitoring_default.yml'
DASHBOARD_NAME =
N_('Overview')
DASHBOARD_VERSION =

SHA256 hash of dashboard content

'0f7ade2022e09f1a1da8e883cc95d84b9557e1e0e9b015c51eb964296aa73098'
SEQUENCE =
[
  STAGES::CustomMetricsInserter,
  STAGES::MetricEndpointInserter,
  STAGES::VariableEndpointInserter,
  STAGES::PanelIdsInserter
].freeze

Constants inherited from BaseService

BaseService::STAGES

Constants included from Gitlab::Metrics::Dashboard::Errors

Gitlab::Metrics::Dashboard::Errors::DashboardProcessingError, Gitlab::Metrics::Dashboard::Errors::LayoutError, Gitlab::Metrics::Dashboard::Errors::MissingIntegrationError, Gitlab::Metrics::Dashboard::Errors::MissingQueryError, Gitlab::Metrics::Dashboard::Errors::NOT_FOUND_ERROR, Gitlab::Metrics::Dashboard::Errors::PanelNotFoundError

Instance Attribute Summary

Attributes inherited from BaseService

#current_user, #params, #project

Class Method Summary collapse

Methods inherited from PredefinedDashboardService

matching_dashboard?, out_of_the_box_dashboard?, #raw_dashboard

Methods inherited from BaseService

#get_dashboard, out_of_the_box_dashboard?, #raw_dashboard

Methods included from Gitlab::Metrics::Dashboard::Errors

#handle_errors, #panels_not_found!

Methods inherited from BaseService

#initialize

Methods included from BaseServiceUtility

#deny_visibility_level, #event_service, #log_error, #log_info, #notification_service, #system_hook_service, #todo_service, #visibility_level

Methods included from Gitlab::Allowable

#can?

Constructor Details

This class inherits a constructor from BaseService

Class Method Details

.all_dashboard_paths(_project) ⇒ Object


26
27
28
29
30
31
32
33
34
# File 'app/services/metrics/dashboard/self_monitoring_dashboard_service.rb', line 26

def all_dashboard_paths(_project)
  [{
    path: DASHBOARD_PATH,
    display_name: _(DASHBOARD_NAME),
    default: true,
    system_dashboard: true,
    out_of_the_box_dashboard: out_of_the_box_dashboard?
  }]
end

.self_monitoring_project?(params) ⇒ Boolean

Returns:

  • (Boolean)

36
37
38
# File 'app/services/metrics/dashboard/self_monitoring_dashboard_service.rb', line 36

def self_monitoring_project?(params)
  params[:dashboard_path].nil? && params[:environment]&.project&.self_monitoring?
end

.valid_params?(params) ⇒ Boolean

Returns:

  • (Boolean)

22
23
24
# File 'app/services/metrics/dashboard/self_monitoring_dashboard_service.rb', line 22

def valid_params?(params)
  matching_dashboard?(params[:dashboard_path]) || self_monitoring_project?(params)
end