prometheus_client_php
prometheus_client_php copied to clipboard
\Prometheus\CollectorRegistry::getMetricFamilySamples uses a large amount of memory
\Prometheus\CollectorRegistry::getMetricFamilySamples, and the functions it uses, needs to store the entire output in memory. This can grow quite large for applications with a lot of metrics and high cardinality. It seems that it would be possible to avoid keeping all the output in memory, by having \Prometheus\CollectorRegistry::getMetricFamilySamples (and its dependecies) return a generator rather than an array.