Refactor predefined dashboard services
What does this MR do?
We currently have two predefined dashboards: config/prometheus/common_metrics.yml
and config/prometheus/cluster_metrics.yml
. These dashboards are processed by Metrics::Dashboard::SystemDashboardService
and Metrics::Dashboard::ClusterDashboardService
respectively. These services have a lot in common. In preparation for adding another predefined dashboard in !20242 (merged), move out common code into a Metrics::Dashboard::PredefinedDashboardService
that SystemDashboardService
, ClusterDashboardService
and future predefined dashboard services can inherit from.
Changes that this MR contains:
-
Move common code from
Metrics::Dashboard::SystemDashboardService
andMetrics::Dashboard::ClusterDashboardService
into a new classMetrics::Dashboard::PredefinedDashboardService
. -
Rename the
SYSTEM_DASHBOARD_PATH
andSYSTEM_DASHBOARD_NAME
constants to beDASHBOARD_PATH
andDASHBOARD_NAME
instead. -
Move spec
caches the unprocessed dashboard for subsequent calls
intoMetricsDashboardHelpers
so that it can be reused in all dashboard service specs.
Issue: #35242 (closed)
Screenshots
Does this MR meet the acceptance criteria?
Conformity
Changelog entry-
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides Database guides-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team