Skip to content

Always display environment selector in Metrics dashboard

Reuben Pereira requested to merge always-display-environment-selector into master

What does this MR do?

The bug (https://gitlab.com/gitlab-org/gitlab-ee/issues/11164)

A customer had dev, staging and production environments, but deployments were done only to dev and staging. When the customer opened the monitoring/metrics dashboard (Operations > Metrics), they saw no metrics (probably the "No data found" empty state) even though dev and staging should have had metrics.

What caused it

Opening Operations > Metrics redirects to the production environment's Metrics dashboard, if there is a production environment. If there is no production environment, it redirects to the oldest environment's metrics dashboard. Due to this, the production environment's metrics dashboard was being opened for the above customer. Since there was no deployment to the production environment, it displayed the "No data found" empty state.

The "No data found" empty state (and the "Failed to connect to the prometheus server" state) do not display the environment selector dropdown, which makes it difficult to change to another environment's metrics dashboard. It also makes it difficult to know which environment's metrics dashboard one is currently viewing.

More details at https://gitlab.com/gitlab-org/gitlab-ee/issues/11164#note_181074520.

What this MR does

This MR causes the environment selector to be displayed in the "No data found" and "Failed to connect to the prometheus server" states. This should make it easy for the user to see which environment's metrics dashboard they are currently viewing and change it if necessary (after this bug is solved).

Before After
metrics_dashboard_no_data metrics_dashboard_no_data_with_selector

This does not affect Cluster Health graphs:

cluster_health_without_environment_selector

Does this MR meet the acceptance criteria?

Conformity

Performance 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