drogonframework / drogon

Drogon: A C++14/17/20 based HTTP web application framework running on Linux/macOS/Unix/Windows
MIT License
11.04k stars 1.06k forks source link

Documentation for Prometheus Plugin and metrics #2073

Open oferns opened 1 week ago

oferns commented 1 week ago

I cannot generate any metrics. The /metrics endpoint returns 200 but no metrics. I am assuming I am missing configuration but I cannot find any documentation about configuring it or about any in-built metrics.

an-tao commented 1 week ago

Sorry, the documentation on this topic is very lacking. I have added a prometheus example for your reference. #2076

oferns commented 1 week ago

Thats brilliant! thank you very much

oferns commented 1 week ago

How would I add PromStat as global middleware? the GlobalFilters plugin doesnt support this I dont think.

an-tao commented 1 week ago

How would I add PromStat as global middleware? the GlobalFilters plugin doesnt support this I dont think.

The middleware is a new feature added to drogon, now you can't add PromStat as a global middleware like filters. We will make it possible in the future.