Question: I'm running a web app with address 127.0.0.1:5000 and am using the python client library for Prometheus. I use `start_http_server(8000)` from the example in their [docs](https://github.com/prometheus/client_python) to expose the metrics on that port. The application runs, but I get `[Errno 48] Address already in use` and the localhost:8000 doesn't connect to anything when I try hitting it.

If I can't start two servers from one web app, then what port should I pass into `start_http_server()` in order to expose the metrics?

There is nothing already running on either port before I start the app.

Answer: 
When flask's `debug` mode is set to `True`, the code reloads after the flask server is up, and a bind to the prometheus server is been called a second time

Set flask app `debug` argument to `False` to solve it
Maybe your 8000 port is occupied. You can change it to another port, such as 8001