'Polls the metrics from the prometheus metrics endpoint provided.
Defaults to the protobuf format, but can use the formats specified by
the PrometheusFormat class.
Custom headers can be added to the default headers.
Returns the content-type of the response and the content of the reponse itself.'

def poll(self, endpoint, pFormat=PrometheusFormat.PROTOBUF, headers={}):

    if ('accept-encoding' not in headers):
        headers['accept-encoding'] = 'gzip'
    if (pFormat == PrometheusFormat.PROTOBUF):
        headers['accept'] = 'application/vnd.google.protobuf;    proto=io.prometheus.client.MetricFamily;    encoding=delimited'
    req = requests.get(endpoint, headers=headers)
    req.raise_for_status()
    return (req.headers['Content-Type'], req.content)
