Class: Metrics::Dashboard::GitlabAlertEmbedService
- Inherits:
-
BaseEmbedService
- Object
- BaseService
- BaseService
- BaseEmbedService
- Metrics::Dashboard::GitlabAlertEmbedService
- Defined in:
- app/services/metrics/dashboard/gitlab_alert_embed_service.rb
Constant Summary collapse
Constants included from Gitlab::Metrics::Dashboard::Defaults
Gitlab::Metrics::Dashboard::Defaults::DEFAULT_PANEL_TYPE
Constants inherited from BaseService
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
-
.valid_params?(params) ⇒ Boolean
Determines whether the provided params are sufficient to uniquely identify a panel composed of user-defined custom metrics from the DB.
Instance Method Summary collapse
Methods included from Gitlab::Utils::StrongMemoize
#clear_memoization, #strong_memoize, #strong_memoized?
Methods inherited from BaseEmbedService
Methods inherited from BaseService
all_dashboard_paths, #get_dashboard, out_of_the_box_dashboard?
Methods included from Gitlab::Metrics::Dashboard::Errors
#handle_errors, #panels_not_found!
Methods inherited from BaseService
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
Constructor Details
This class inherits a constructor from BaseService
Class Method Details
.valid_params?(params) ⇒ Boolean
Determines whether the provided params are sufficient to uniquely identify a panel composed of user-defined custom metrics from the DB.
23 24 25 26 27 28 |
# File 'app/services/metrics/dashboard/gitlab_alert_embed_service.rb', line 23 def valid_params?(params) [ (params[:embedded]), params[:prometheus_alert_id].is_a?(Integer) ].all? end |
Instance Method Details
#raw_dashboard ⇒ Object
31 32 33 34 35 |
# File 'app/services/metrics/dashboard/gitlab_alert_embed_service.rb', line 31 def raw_dashboard panels_not_found!(alert_id: alert_id) unless alert && prometheus_metric { 'panel_groups' => [{ 'panels' => [panel] }] } end |