Project-defined metrics dashboards always show 'No Data Found' state
Summary
When a correctly-defined project dashboard is committed to a project, & loaded from the metrics dashboard, the charts do not render, even though the prometheus api is returning data.
It's behind a feature flag? Why is this important?
- This is preventing us from enabling the feature flag.
- This blocks https://gitlab.com/gitlab-org/gitlab-ce/issues/30423 from being enabled.
Steps to reproduce
- Pre-req: A project with auto-deploy configured & prometheus installed.
- Enable the
environment_metrics_use_prometheus_endpoint
andenvironment_metrics_show_multiple_dashboards
feature flags. - Commit a suitable dashboard to
.gitlab/dashboards
& re-deploy. This one will work: gitlab_dashboards_test_dashboard.yml - Navigate to > Operations > *Metrics.
- Select the dashboard from the dropdown menu.
- No charts will render, but if you look it the network tab, the prometheus endpoint returns results for all of the queries.
Example Project
What is the current bug behavior?
Only the 'No Data' empty state renders.
What is the expected correct behavior?
The charts should render for each query.
Relevant logs and/or screenshots
Possible fixes
Metrics from dashboards do not have a DB id associated with them. So filtering out any metrics without a metricId will filter any metric from a dashboard.
This happens here: https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/assets/javascripts/monitoring/stores/mutations.js#L53