knyar / nginx-lua-prometheus

Prometheus metric library for Nginx written in Lua
MIT License
1.46k stars 231 forks source link

Can add expire time to metrics? #154

Closed sugue closed 1 year ago

sugue commented 1 year ago

Now metrics has not expire time, will produce many dirty metrics data.

knyar commented 1 year ago

I am not really sure what you mean by "dirty" data. The Prometheus ecosystem convention is for metrics to track everything that has happened with a running process since it was started. Even ability to remove metrics #56 is a bit of an antipattern.

sugue commented 1 year ago

Okay. I just think if i don't need a metrics anymore, it can be clean by the library. Now i need to write some code to delete useless metrics.