Summary
ClickHouse natively supports exposing Prometheus metrics via a <prometheus> configuration block in config.xml:
<prometheus>
<port>9363</port>
<endpoint>/metrics</endpoint>
<metrics>true</metrics>
<asynchronous_metrics>true</asynchronous_metrics>
<events>true</events>
<errors>true</errors>
</prometheus>
Currently, the operator generates config.xml for ClickHouse without this block, and there is no CRD field to enable it. This means users who want to monitor ClickHouse with an existing Prometheus instance must deploy a separate exporter.
Proposal
Add a CRD field under spec.clickhouse to enable the built-in Prometheus metrics endpoint, e.g.:
spec:
clickhouse:
prometheus:
enabled: true
port: 9363 # optional, default 9363
endpoint: /metrics # optional, default /metrics
When enabled, the operator would:
- Inject the
<prometheus> block into the generated config.xml
- Add port 9363 to the ClickHouse container and Service definitions
This would allow users to scrape ClickHouse metrics (system.metrics, system.events, system.asynchronous_metrics, etc.) directly using an existing Prometheus instance without needing a separate exporter deployment.
Use Case
We run Coroot alongside an existing Prometheus instance (kube-prometheus-stack) and want to monitor ClickHouse health (query performance, memory usage, replication lag, disk usage, etc.) via ServiceMonitor/PodMonitor without deploying additional components.
Summary
ClickHouse natively supports exposing Prometheus metrics via a
<prometheus>configuration block inconfig.xml:Currently, the operator generates
config.xmlfor ClickHouse without this block, and there is no CRD field to enable it. This means users who want to monitor ClickHouse with an existing Prometheus instance must deploy a separate exporter.Proposal
Add a CRD field under
spec.clickhouseto enable the built-in Prometheus metrics endpoint, e.g.:When enabled, the operator would:
<prometheus>block into the generatedconfig.xmlThis would allow users to scrape ClickHouse metrics (system.metrics, system.events, system.asynchronous_metrics, etc.) directly using an existing Prometheus instance without needing a separate exporter deployment.
Use Case
We run Coroot alongside an existing Prometheus instance (kube-prometheus-stack) and want to monitor ClickHouse health (query performance, memory usage, replication lag, disk usage, etc.) via ServiceMonitor/PodMonitor without deploying additional components.