Commit 946633c6 authored by Shinya Maeda's avatar Shinya Maeda
Browse files

Rescue Kubeclient::HttpError when generating prometheus_client

parent f28943c50809
......@@ -49,6 +49,11 @@ def prometheus_client
# ensures headers containing auth data are appended to original k8s client options
options = kube_client.rest_client.options.merge(headers: kube_client.headers), options)
rescue Kubeclient::HttpError
# If users have mistakenly set parameters or removed the depended clusters,
# `proxy_url` could raise an exception because gitlab can not communicate with the cluster.
# Since `PrometheusAdapter#can_query?` is eargely loaded on environement pages in gitlab,
# we need to silence the exceptions
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment