client_python icon indicating copy to clipboard operation
client_python copied to clipboard

Debug request logging.

Open cirvladimir opened this issue 2 years ago • 2 comments

I'm trying to debug why Prometheus isn't pulling metrics from my client. Is there some way I can get this library to log each incoming http request, including the IP of the request?

Ideally it would be something like start_http_server(log_level="debug"), and then each request will be printed to stdout.

cirvladimir avatar Jun 13 '23 19:06 cirvladimir

That is not available today, I am not sure how I feel about the feature as a whole. I guess it would depend on the added complexity as we try to keep start_http_server very minimal. It should be pretty easy to create your own http server that has logging how you want it and use something like make_wsgi_app from this library to serve the results though?

Usually there is information in the Prometheus server for if you are not seeing metrics as well, either looking in Status > Targets, or enabling debug logging on the Prometheus server.

csmarchbanks avatar Jun 13 '23 20:06 csmarchbanks

I resorted to debugging by just standing up a simple http server with python.

I guess there are workarounds, and the feature I requested may not be useful to anyone else, so maybe this issue can be closed.

cirvladimir avatar Jun 20 '23 20:06 cirvladimir