KubeBlocks
BlogsEnterprise
⌘K
​
Blogs

Overview
Quickstart
Architecture

Operations

Stop / Start / Restart
Vertical Scaling
Horizontal Scaling
Volume Expansion
Reconfigure
Switchover
Manage Services

Observability

Prometheus Integration
  1. Prerequisites
  2. Create a PodMonitor
  3. Key Metrics
  4. Cleanup

Integrate ClickHouse with Prometheus Operator

ClickHouse clusters managed by KubeBlocks expose Prometheus metrics on port 8001 (http-metrics) via the built-in HTTP metrics endpoint.

Prerequisites

    • A functional Kubernetes cluster (v1.21+ recommended)
    • kubectl v1.21+ installed and configured with cluster access
    • KubeBlocks installed (installation guide)
    • ClickHouse Add-on enabled
    • A demo namespace: kubectl create ns demo
    • Prometheus Operator installed in your cluster
    • Prometheus configured with podMonitorSelector matching label release: prometheus

    Create a PodMonitor

    kubectl apply -f - <<EOF apiVersion: monitoring.coreos.com/v1 kind: PodMonitor metadata: name: clickhouse-pod-monitor namespace: demo labels: release: prometheus spec: jobLabel: app.kubernetes.io/managed-by podTargetLabels: - app.kubernetes.io/instance - app.kubernetes.io/managed-by - apps.kubeblocks.io/component-name - apps.kubeblocks.io/pod-name podMetricsEndpoints: - path: /metrics port: http-metrics scheme: http namespaceSelector: matchNames: - demo selector: matchLabels: app.kubernetes.io/instance: clickhouse-cluster EOF

    Verify the PodMonitor is created:

    kubectl get podmonitor clickhouse-pod-monitor -n demo
    Example Output
    NAME AGE clickhouse-pod-monitor 10s

    Key Metrics

    MetricDescription
    ClickHouseMetrics_QueryNumber of executing queries
    ClickHouseMetrics_ConnectionNumber of connections
    ClickHouseAsyncMetrics_MemoryResidentResident memory usage
    ClickHouseProfileEvents_QueryTotal queries executed
    ClickHouseProfileEvents_SelectQueryTotal SELECT queries
    ClickHouseProfileEvents_InsertQueryTotal INSERT queries
    ClickHouseProfileEvents_ReadCompressedBytesCompressed bytes read

    Cleanup

    kubectl delete podmonitor clickhouse-pod-monitor -n demo --ignore-not-found

    © 2026 KUBEBLOCKS INC