ClickHouse Cloud monitoring

For complete deployment options and architecture details, see the [ClickStack documentation](/docs/use-cases/observability/clickstack/overview) and [data ingestion guide](/docs/use-cases/observability/clickstack/ingesting-data/overview).

Note

You can also collect metrics from the ClickHouse Cloud Prometheus endpoint via an OpenTelemetry Collector and forward them to a separate ClickStack deployment for visualization.

### Direct Grafana plugin integration[​](#direct-grafana "Direct link to Direct Grafana plugin integration")

The ClickHouse data source plugin for Grafana enables visualization and exploration of data directly from ClickHouse using system tables. This approach works well for monitoring performance and creating custom dashboards for detailed system analysis.
For plugin installation and configuration details, see the ClickHouse [data source plugin](/docs/integrations/grafana). For a complete monitoring setup using the Prometheus-Grafana mix-in with pre-built dashboards and alerting rules, see [Monitor ClickHouse with the new Prometheus-Grafana mix-in](https://clickhouse.com/blog/monitor-with-new-prometheus-grafana-mix-in).

### Direct Datadog Integration[​](#direct-datadog "Direct link to Direct Datadog Integration")

Datadog offers a Clickhouse Monitoring plugin for its agent which queries system tables directly. This integration provides comprehensive database monitoring with cluster awareness through clusterAllReplicas functionality.

Note

This integration isn't recommended for ClickHouse Cloud deployments due to incompatibility with cost-optimizing idle behavior and operational limitations of the cloud proxy layer.

### Using system tables directly[​](#system-tables "Direct link to Using system tables directly")

You can perform deep query performance analysis by connecting to ClickHouse system tables, particularly `system.query_log` and querying directly. Using either the SQL console or clickhouse client, teams can identify slow queries, analyze resource usage, and track usage patterns across the organization.

**Query Performance Analysis**

You can use the system table query logs to perform Query Performance Analysis.

**Example query**: Find the top 5 long-running queries across all cluster replicas:

```
SELECT
    type,
    event_time, 
    query_duration_ms,
    query,
    read_rows,
    tables
FROM clusterAllReplicas(default, system.query_log)
WHERE event_time >= (now() - toIntervalMinute(60)) AND type='QueryFinish'
ORDER BY query_duration_ms DESC
LIMIT 5
FORMAT VERTICAL
```

## Community monitoring solutions[​](#community-monitoring "Direct link to Community monitoring solutions")

The ClickHouse community has developed comprehensive monitoring solutions that integrate with popular observability stacks. [ClickHouse Monitoring](https://github.com/duyet/clickhouse-monitoring) provides a complete monitoring setup with pre-built dashboards. This open source project offers a quick-start approach for teams looking to implement ClickHouse monitoring with established best practices and proven dashboard configurations.

Note

Like other direct database monitoring approaches, this solution queries ClickHouse system tables directly, which prevents instances from idling and impacts cost optimization.

## System impact considerations[​](#system-impact "Direct link to System impact considerations")

All of the above approaches use a mixture of either relying on Prometheus endpoints, being managed by ClickHouse Cloud, or querying of system tables directly.
The latter of these options relies on querying the production ClickHouse service. This adds query load to the system under observation and prevents ClickHouse Cloud instances from idling, impacting cost optimization. Additionally, if the production system fails, monitoring may also be affected, since the two are coupled. This approach works well for deep introspection and debugging but is less appropriate for real-time production monitoring. Consider these trade-offs between detailed system analysis capabilities and operational overhead when evaluating direct Grafana integration versus the external tool integration approaches discussed in the following section.

- [Advanced observability dashboard](#advanced-observability)- [Query insights and resource monitoring](#query-insights)- [Prometheus-compatible metrics endpoint](#prometheus)- [Integration examples](#examples)
        - [Grafana Cloud monitoring](#grafana)- [Datadog monitoring](#datadog)- [ClickStack](#clickstack)- [ClickStack deployment options](#clickstack-deployment)- [Direct Grafana plugin integration](#direct-grafana)- [Direct Datadog Integration](#direct-datadog)- [Using system tables directly](#system-tables)- [Community monitoring solutions](#community-monitoring)- [System impact considerations](#system-impact)

Was this page helpful?