Optimizing PromQL Queries
summary
Shows that dividing a metric filtered by instance by an unfiltered metric causes the engine to fetch hundreds or thousands of series only to keep one, wasting CPU and memory; manually copying the instance filter into both sides fixes latency. Implements automatic label-filter pushdown at parse time for aggregations and function calls and a runtime filter pruning for metadata joins (avoiding scanning 10 thousands stale pod info series). The optimization is implemented in prus and yields large resource and speed improvements.
AI-written summary · about
related talks
29mReverse-Engineering PromQL Usage: A Proxy’s Tale
05mLightning Talk: Improved Prometheus filtering in Grafana
50mPRAGMATIC DEVELOPMENT AT STACK OVERFLOW
53mYour Attention, Please: Optimizing Metrics for Humans
42mHolistic Database Application Tuning
23mAuto-suggesting and generating recording rules for Prometheus
26mBazel Query Deep Dive: From Basics to Advanced Use Cases
26mProfiling Mastery: Decode Your Data and Elevate Observability
