title: Pushing metrics to Prometheus Pushgateway fails frequently
body: <p>I am using the <a href="https://github.com/prometheus/client_python" rel="nofollow noreferrer">Prometheus Client library</a> to push metrics to pushgateway. Frequently I am getting below error while pushing the metrics. How can I find the root cause of this issue?</p>
  <pre><code> push_to_gateway(
    File &quot;/usr/local/lib/python3.8/dist-packages/prometheus_client/exposition.py&quot;, line 285, in push_to_gateway
      _use_gateway('PUT', gateway, job, registry, grouping_key, timeout, handler)
    File &quot;/usr/local/lib/python3.8/dist-packages/prometheus_client/exposition.py&quot;, line 358, in _use_gateway
      handler(
    File &quot;/usr/local/lib/python3.8/dist-packages/prometheus_client/exposition.py&quot;, line 217, in handle
      resp = build_opener(HTTPHandler).open(request, timeout=timeout)
    File &quot;/usr/lib/python3.8/urllib/request.py&quot;, line 525, in open
      response = self._open(req, data)
    File &quot;/usr/lib/python3.8/urllib/request.py&quot;, line 542, in _open
      result = self._call_chain(self.handle_open, protocol, protocol +
    File &quot;/usr/lib/python3.8/urllib/request.py&quot;, line 502, in _call_chain
      result = func(*args)
    File &quot;/usr/lib/python3.8/urllib/request.py&quot;, line 1369, in https_open
      return self.do_open(http.client.HTTPSConnection, req,
    File &quot;/usr/lib/python3.8/urllib/request.py&quot;, line 1330, in do_open
      r = h.getresponse()
    File &quot;/usr/lib/python3.8/http/client.py&quot;, line 1332, in getresponse
      response.begin()
    File &quot;/usr/lib/python3.8/http/client.py&quot;, line 303, in begin
      version, status, reason = self._read_status()
    File &quot;/usr/lib/python3.8/http/client.py&quot;, line 272, in _read_status
      raise RemoteDisconnected(&quot;Remote end closed connection without&quot;
  http.client.RemoteDisconnected: Remote end closed connection without respons
  </code></pre>