go-client 中可以 marshal/unmarshal Prometheus state 吗?

Is it possible to marshal/unmarshal Prometheus state in go-client?

我希望能够将各种 Prometheus 指标(CounterVec、HistogramVec 等)的状态保存到我的应用程序的文件中,并在以后需要时恢复它。可以吗?

我看到有 Write method in metric.go,但找不到 Read

没有普罗米修斯客户端库支持这个,你也不应该需要这个。客户端库设计为完全在内存中工作,并且像 rate() 这样的函数将优雅地处理由于进程重新启动而导致的计数器重置。