rycus86 / prometheus_flask_exporter

Prometheus exporter for Flask applications
https://pypi.python.org/pypi/prometheus-flask-exporter
MIT License
646 stars 161 forks source link

Provide a message explaining that metrics are disabled when running i… #151

Closed yrro closed 1 year ago

yrro commented 1 year ago

…n the Flask development server with reloading enabled

I have to admit I'm not really sure why metrics are disabled--if you can suggest some better wording I'll update the message.

rycus86 commented 1 year ago

You can check issue #4 for more context. I agree it's a bit surprising when you want the opposite to happen. Rather than overriding the HTTP endpoint, I think it may be better to log a warning when this is detected? (instead of silently bailing out there)

What do you think?

yrro commented 1 year ago

Makes sense to me. To be honest I have read that issue and the README a couple of times and I don't really get what's going on... the README says that with DEBUG_METRICS set & after 0.5.1, "you will get metrics for the latest reloaded code." - I don't really understand what the use case for this setting is, unless the metrics are incomplete or wrong or something like that?

rycus86 commented 1 year ago

I don't really understand what the use case for this setting is, unless the metrics are incomplete or wrong or something like that?

Yeah, it's been a little while ago, so I don't remember the exact details, but if I remember correctly, the metrics endpoint is somehow unavailable when you run Flask with the reloader.

coveralls commented 1 year ago

Coverage Status

Coverage: 84.402% (-0.1%) from 84.526% when pulling b23d17843df07dbd5a9815f5ec3224bb605c4947 on yrro:debug-metrics-explainer into 73404e97185c843f714be0f8cb5d9f4ba911a3b1 on rycus86:master.

rycus86 commented 1 year ago

Thanks for this change! I'll merge this and release it later today if I get the chance.

yrro commented 1 year ago

Thanks :)