def start_wsgi_server(port, addr=''):
    class PrometheusMetricsServer(threading.Thread):
        def run(self):
            httpd = make_server(addr, port, make_wsgi_app())
            httpd.serve_forever()
    t = PrometheusMetricsServer()
    t.daemon = True
    t.start()
Starts a WSGI server for prometheus metrics as a daemon thread.
dataset/ETHPy150Open prometheus/client_python/prometheus_client/exposition.py/start_wsgi_server