This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes dynamic registration of views bug (#456)
Prometheus's default registry appears to block registration of any other metrics based on there being >= 1 duplicate in the set of metrics returned from Describe to register. While Describe's API seems to indicate that a collector should return a superset of metrics, and while this makes perfect sense with the Unregister logic, it does not seem to play nicely with us running register on the same collector repeatedly with different metrics, nor with calling unregister and then attempting to register everything once again. that is to say, Prometheus client seems to explicitly disallow the thing we're seemingly trying to do. upstream: prometheus/client_golang#47 This patch will: * No longer call Unregister and then Register, as this is a case handled by prometheus: https://github.com/prometheus/client_golang/blob/fcc130e101e76c5d303513d0e28f4b6d732845c7/prometheus/registry.go#L112-L117 * Only return metrics that are not yet registered to Prometheus registry
- Loading branch information