PromPHP / prometheus_client_php

Prometheus instrumentation library for PHP applications
https://prometheus.io/docs/concepts/metric_types/
Apache License 2.0
423 stars 93 forks source link

Wipe storage from registry itself #88

Closed pachico closed 2 years ago

pachico commented 2 years ago

I have the necessity to be able to wipe either 1) a metric (preferable, as in Golang's client) or 2) the entire storage but I see it's not possible since the only way to wipe data is through the storage. Unfortunately, though, there is no storage getter either in the registry.

Which solution would you prefer? I can send an MR, if you find one of these features is acceptable.

To give more context about my use case, I have written an exporter that exposes AWS EC2 data written in Go that I am currently porting to PHP. It periodically fetches data using AWS SDK and each time it has to flush the old data since you cannot just reset new values, as the labels combination might be new, leaving behind obsolete data. Only wiping the entire old data makes sense.

pachico commented 2 years ago

Closed by #89