mirror of
https://github.com/prometheus/prometheus.git
synced 2026-02-03 20:39:32 -05:00
When React components mount/unmount repeatedly, each creating a new PromQLExtension, memory leaks occur due to LRU caches with ttlAutopurge timers keeping references alive and in-flight HTTP requests holding closure references. This adds destroy() methods throughout the class hierarchy to properly release resources on unmount. Changes: - Add destroy() to PrometheusClient interface (optional) - HTTPPrometheusClient: track AbortControllers and abort pending requests - Cache: clear all LRU caches and reset cached data - CachedPrometheusClient: delegate to cache and underlying client - HybridComplete: delegate to prometheusClient - CompleteStrategy: add optional destroy() method - PromQLExtension: delegate to complete strategy Signed-off-by: Ben Blackmore <ben.blackmore@dash0.com> |
||
|---|---|---|
| .. | ||
| api/v1 | ||
| ui | ||
| federate.go | ||
| federate_test.go | ||
| web.go | ||
| web_test.go | ||