Class: Metrics::Dashboard::ClusterDashboardService

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

Constant Summary collapse

DASHBOARD_PATH =
'config/prometheus/cluster_metrics.yml'
DASHBOARD_NAME =
'Cluster'
DASHBOARD_VERSION =

SHA256 hash of dashboard content

'e1a4f8cc2c044cf32273af2cd775eb484729baac0995db687d81d92686bf588e'
SEQUENCE =
[
  STAGES::ClusterEndpointInserter,
  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

Instance Method Summary collapse

Methods inherited from PredefinedDashboardService

matching_dashboard?, out_of_the_box_dashboard?, #raw_dashboard

Methods inherited from BaseService

all_dashboard_paths, #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

.valid_params?(params) ⇒ Boolean

Returns:

  • (Boolean)

20
21
22
23
24
# File 'app/services/metrics/dashboard/cluster_dashboard_service.rb', line 20

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

Instance Method Details

#allowed?Boolean

Permissions are handled at the controller level

Returns:

  • (Boolean)

28
29
30
# File 'app/services/metrics/dashboard/cluster_dashboard_service.rb', line 28

def allowed?
  true
end