diff options
author | Thong Kuah <tkuah@gitlab.com> | 2019-07-04 08:26:37 +0300 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2019-07-08 00:14:37 +0300 |
commit | c85d6b0c744e9a971fafdf58328f907dfa0de127 (patch) | |
tree | 5d65b622c5bc40ec0cc0deb66be33edb660383a7 /app/models/deployment_metrics.rb | |
parent | 25ba11a2aad9571e4759cdc711199634e3392c5b (diff) |
Restore fallback to deployment_platform_cluster
In 12.2 we will remove this fallback.
Diffstat (limited to 'app/models/deployment_metrics.rb')
-rw-r--r-- | app/models/deployment_metrics.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/app/models/deployment_metrics.rb b/app/models/deployment_metrics.rb index 2056c8bc59c..cfe762ca25e 100644 --- a/app/models/deployment_metrics.rb +++ b/app/models/deployment_metrics.rb @@ -44,7 +44,18 @@ class DeploymentMetrics end end + # TODO remove fallback case to deployment_platform_cluster. + # Otherwise we will continue to pay the performance penalty described in + # https://gitlab.com/gitlab-org/gitlab-ce/issues/63475 + # + # Removal issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/64105 def cluster_prometheus - cluster.application_prometheus if cluster&.application_prometheus_available? + cluster_with_fallback = cluster || deployment_platform_cluster + + cluster_with_fallback.application_prometheus if cluster_with_fallback&.application_prometheus_available? + end + + def deployment_platform_cluster + deployment.environment.deployment_platform&.cluster end end |