Cloud Native & eBPF

Prometheus 3.16.0-rc.4 introduces experimental PromQL functions and query cost estimation

Key Takeaway

The new Prometheus release adds experimental integral functions, query cost reporting, and significant TSDB performance optimizations.

Summary

Prometheus has released the 3.16.0-rc.4 pre-release, bringing several advanced features to the PromQL engine and the Time Series Database (TSDB). Key additions include an experimental integral() function for computing integrals over time and a new query cost estimation system that allows for configurable execution limits.

This release also focuses heavily on performance and stability, particularly regarding the OpenMetrics 2.0 parser and Remote Write capabilities. Improvements to the TSDB aim to reduce memory overhead and enhance compression efficiency, while the Agent mode gains support for metadata-wal-records.

Technical breakdown of 3.16.0-rc.4

  • PromQL Enhancements: Introduces an experimental integral() function for range vectors (via --enable-feature=promql-experimental-functions) and a query cost estimation framework (via --enable-feature=query-cost) to report actual execution costs.
  • TSDB and Performance: Optimizes XOR2 compression and append performance by selecting value windows based on encoding cost, while reducing memory usage for checkpoint metadata records.
  • OpenMetrics 2.0 & Scrape Improvements: The OpenMetrics 2.0 parser now reuses buffers for classic histogram and summary expansion, and the scraper reduces CPU overhead by lazily constructing composite series and exemplar labels.
  • Remote Write & API Updates: Adds an experimental flag to convert Native Histograms with Cumulative Buckets (NHCB) to classic histograms for external compatibility, and implements batch size clamping to 1000 for experimental search endpoints.
  • Stability and Bugfixes: Resolves critical TSDB issues regarding out-of-order sample loss during WAL checkpointing and fixes float native histogram corruption in federation.

Why it matters

These updates provide cloud-native engineers with better tools to manage large-scale monitoring workloads through query cost limits and improved TSDB efficiency. The enhanced compatibility for NHCB and OpenMetrics 2.0 ensures smoother data interoperability across diverse observability stacks.

What to do

  • To use the experimental integral() function, enable the --enable-feature=promql-experimental-functions flag.
  • To use experimental query cost estimation and execution limits, enable the --enable-feature=query-cost flag.
  • To convert Native Histograms with Cumulative Buckets to classic histograms for external compatibility, use the experimental convert_nhcb_to_classic flag.

Original reference: github.com →