tikv / rust-prometheus

Prometheus instrumentation library for Rust applications
Apache License 2.0
1.04k stars 182 forks source link

Metric Persistance #514

Open ozwaldorf opened 5 months ago

ozwaldorf commented 5 months ago

It'd be neat to be able to have the option to persist the metric state to disk and be able to restore from it on startup, in the event a rust binary is restarted (catching ctrl-c/sigint) or crashes (custom panic hook). Storing the text encoding to disk can work, but there needs to be a way to decode and restore data from the text file. An incremental db approach could also work but I think it'd need more plumbing to be able to hook into when metrics are updated.