-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Support for PromQL #57545
Copy link
Copy link
Open
Labels
comp-promqlPromQL / time-series subsystem: TimeSeries storage engine, PromQL parser, PromQL-to-SQL converter...PromQL / time-series subsystem: TimeSeries storage engine, PromQL parser, PromQL-to-SQL converter...comp-protocolsServer wire protocols + request/response handling (native TCP, HTTP, MySQL/PostgreSQL wire protoc...Server wire protocols + request/response handling (native TCP, HTTP, MySQL/PostgreSQL wire protoc...feature
Metadata
Metadata
Assignees
Labels
comp-promqlPromQL / time-series subsystem: TimeSeries storage engine, PromQL parser, PromQL-to-SQL converter...PromQL / time-series subsystem: TimeSeries storage engine, PromQL parser, PromQL-to-SQL converter...comp-protocolsServer wire protocols + request/response handling (native TCP, HTTP, MySQL/PostgreSQL wire protoc...Server wire protocols + request/response handling (native TCP, HTTP, MySQL/PostgreSQL wire protoc...feature
Type
Fields
Give feedbackNo fields configured for issues without a type.
Prometheus Query Language is a powerful tool to that lets the user select and aggregate time series data efficiently. https://prometheus.io/docs/prometheus/latest/querying/basics/
Use case
Describe the solution you'd like
The task is divided into several sub-tasks:
PromQL interpreter
The biggest challenge are several functions like
rate,increase- functions which take possibly huge range-vector and depend on the order of elements in this vector.PromQL parser and other functions (simple, aggregate and window ones) are doable.
We can support even different "dialects" of this language e.g. support MetricsQL or Grafana's LogQL.
Table structure
Similar to what we have right now for Kusto or PRQL we can put it under the setting
sql_dialect. When thesql_dialectis set topromqlClickHouse will read only from the tables with the specified structure. Specifically:(timestamp, value, fingerprint). Fingerprint could be just a hash of all the tags associated with the metric.(tag_key, tag_value, fingerprint)(date, fingerprint, tags_array)The way how to define the name for these tables can be different - it could be another user-level setting or part of the configuration file.
Native integration with Prometheus API:
What needs to be done for the native integration with Prometheus and drop-in replacement?