Move Cluster Metrics to Prometheus Endpoint?
Summary
In attempting to address https://gitlab.com/gitlab-org/gitlab-ee/issues/5456 I noticed we support a couple different ways of dealing with metrics and we are currently building a new way as outlined by @syasonik:
1. User hits `#metrics`, which responds with the frame of the metrics dashboard. Basically no content.
2. FE hits `#metrics_dashboard`, which responds with the layout of the metrics dashboard (taken from `common_metrics` or a user-defined dashboard, then inserts DB-info).
3. FE makes requests to `PrometheusApiController#proxy` for each query provided in the `#metrics_dashboard` content. Data from the responses is rendered in the charts.
I think it would be beneficial if we could support only one way of fetching/storing/alerting metrics.
Digging through the new code, it seems like the pattern is pretty integrated to environment
metrics, i.e. a lot of it depends on having an environment and project.
Does it make sense to move environment and cluster metrics to the same pattern? Is there a reason why that might not be a good idea?