-
Notifications
You must be signed in to change notification settings - Fork 759
Description
Is your feature request related to a problem?
Yes. Currently the Python Prometheus Exporter implementation uses a double ended queue called _metrics_to_export to work as an intermediate storage. export() function in the PrometheusMetricsExporter class add metrics data entry to the queue, and collect() function pulls data from the queue. What if the controller keeps adding metric data to the queue but no one is pulling from it? It seems that there is not a mechanism to handle this case. Do we need an upper bound on the number of metrics data in the queue?
Describe the solution you'd like
Use a memory upper bound, the collection’s size is limited. When the collection is full, discard the new incoming data or replace the data at the front.
Describe alternatives you've considered
Use a time-based upper bound. Every metric data entry carries a timestamp when they are added into the collection, and set a timeout. If the entry is not pulled by the user within the timeout, it expires and it is discarded.
Additional context
Python Prometheus Exporter implementation