v.25.8New Feature

Support the PromQL dialect is added

Basic support for the PromQL dialect is added. To use it, set dialect='promql' in clickhouse-client, point it to the TimeSeries table using the setting promql_table_name='X' and execute queries like rate(ClickHouseProfileEvents_ReadCompressedBytes[1m])[5m:1m]. In addition you can wrap the PromQL query with SQL: SELECT * FROM prometheusQuery('up', ...);. So far only functions rate, delta and increase are supported. No unary/binary operators. No HTTP API. #75036 (Vitaly Baranov).
Added basic support for the PromQL dialect in ClickHouse, enabling users to run Prometheus-style time series queries directly within ClickHouse.

Why it matters

This feature allows users to leverage PromQL queries on ClickHouse time series data, simplifying the integration of Prometheus metrics with ClickHouse. It provides a familiar query experience for those working with Prometheus metrics and enables efficient time series analysis without needing external Prometheus servers or APIs.

How to use it

To use PromQL in ClickHouse, set the client dialect to promql by specifying dialect='promql' in clickhouse-client. Configure the Prometheus table with the setting promql_table_name='X' where X is your TimeSeries table name. You can then run PromQL queries like:

rate(ClickHouseProfileEvents_ReadCompressedBytes[1m])[5m:1m]


Alternatively, wrap a PromQL query within SQL using the prometheusQuery function:

SELECT * FROM prometheusQuery('up', ...);


Currently, only the functions rate, delta, and increase are supported; unary/binary operators and the HTTP API are not yet implemented.