Skip to content

Use Gitlab::Config::Loader::Yaml to load yaml in metrics dashboard code

What does this MR do?

Use Gitlab::Config::Loader::Yaml to load metrics dashboard YAML files:

  1. Add a load_yaml method to app/services/metrics/dashboard/base_service.rb so that it is available to all services.

  2. Use the load_yaml method in app/services/metrics/dashboard/predefined_dashboard_service.rb, which handles all out of the box dashboards. And in app/services/metrics/dashboard/custom_dashboard_service.rb which handles custom dashboards.

  3. Create a shared_example in spec/support/shared_examples/services/metrics/dashboard_shared_examples.rb.

  4. Use the above shared_example in spec/services/metrics/dashboard/system_dashboard_service_spec.rb, spec/services/metrics/dashboard/self_monitoring_dashboard_service_spec.rb, spec/services/metrics/dashboard/pod_dashboard_service_spec.rb and spec/services/metrics/dashboard/custom_dashboard_service_spec.rb.

Issue: https://gitlab.com/gitlab-org/gitlab/-/issues/14934

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

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
Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading