Skip to content

Hide cluster health metrics when `remove_monitor_metrics` flag is true

Tristan Read requested to merge tr-hide-cluster-health-behind-flag into master

What does this MR do and why?

Part of the %16.0 breaking change removals.

Hides the cluster health metrics page behind the remove_monitor_metrics flag, in preparation to setting the flag to 'default: true'.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

For remove_monitor_metrics: false - no change.

For remove_monitor_metrics: true:

before after
Screenshot_2023-05-08_at_22.31.50 Screenshot_2023-05-08_at_22.28.43

How to set up and validate locally

  1. Set up a certificate based cluster.
  2. Install prometheus on to the cluster.
  3. Set the remove_monitor_metrics flag.
    • rails c -> Feature.enable(:remove_monitor_metrics)
  4. View the cluster health page.

Alternative:

  1. Apply this patch to load the cluster health page as part of a feature spec:
Click to expand
diff --git a/spec/features/clusters/cluster_health_dashboard_spec.rb b/spec/features/clusters/cluster_health_dashboard_spec.rb
index e932f8c6b98e..8c85199e49f7 100644
--- a/spec/features/clusters/cluster_health_dashboard_spec.rb
+++ b/spec/features/clusters/cluster_health_dashboard_spec.rb
@@ -38,12 +38,16 @@
     it 'does not show the cluster health tab' do
       visit cluster_path

+      live_debug
+
       expect(page).not_to have_text('Health')
     end

     it 'does not show the cluster health section' do
       visit project_cluster_path(clusterable, cluster, { tab: 'health' })

+      live_debug
+
       expect(page).not_to have_text('you must first enable Prometheus in the Integrations tab')
     end
   end
2. Run the spec in your terminal: `bin/rspec spec/features/clusters/cluster_health_dashboard_spec.rb` 3. Confirm that the cluster health tab and contents are not present.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #399231 (closed)

Edited by Tristan Read

Merge request reports