Port of 'pawel/connect_to_prometheus_through_proxy-30480' to EE
Port of gitlab-org/gitlab-ce!16182 which resolves conflicts due to gitlab-org/gitlab-ce!16937 which existed in CE-master, but not EE-master.
Port of gitlab-org/gitlab-ce!16182 which resolves conflicts due to gitlab-org/gitlab-ce!16937 which existed in CE-master, but not EE-master.