Self-managed monitoring

[Edit this page](https://github.com/ClickHouse/clickhouse-docs/blob/main/docs/use-cases/observability/self-managed-monitoring.md)

This guide provides enterprise teams evaluating ClickHouse open-source with comprehensive information on monitoring and observability capabilities for production deployments. Enterprise customers frequently ask about out-of-the-box monitoring features, integration with existing observability stacks including tools like Datadog and AWS CloudWatch, and how ClickHouse's monitoring compares to self-hosted deployments.

### Prometheus-based integration architecture[​](#prometheus "Direct link to Prometheus-based integration architecture")

ClickHouse exposes Prometheus-compatible metrics through different endpoints depending on your deployment model, each with distinct operational characteristics:

**Self-Managed/OSS ClickHouse**

Direct server Prometheus endpoint accessible via the standard /metrics endpoint on your ClickHouse server. This approach provides:

- Complete metric exposure: Full range of available ClickHouse metrics without built-in filtering
- Real-time metrics: Generated directly from system tables when scraped

**Direct system access**

Queries production system tables, which adds monitoring load and prevents cost-saving idle states

## Integration examples[​](#examples "Direct link to Integration examples")

External integration allows organizations to maintain established monitoring workflows, leverage existing team expertise with familiar tools, and integrate ClickHouse monitoring with broader infrastructure observability without disrupting current processes or requiring significant retraining investments.
Teams can apply existing alerting rules and escalation procedures to ClickHouse metrics, while correlating database performance with application and infrastructure health within a unified observability platform. This approach maximizes ROI on current monitoring setups and enables faster troubleshooting through consolidated dashboards and familiar tooling interfaces.

### Grafana Cloud monitoring[​](#grafana "Direct link to Grafana Cloud monitoring")

Grafana provides ClickHouse monitoring through both direct plugin integration and Prometheus-based approaches. The Prometheus endpoint integration maintains operational separation between monitoring and production workloads while enabling visualization within existing Grafana Cloud infrastructure. See [Grafana's ClickHouse documentation](https://grafana.com/docs/grafana-cloud/monitor-infrastructure/integrations/integration-reference/integration-clickhouse/) for configuration guidance.

### Datadog monitoring[​](#datadog "Direct link to Datadog monitoring")

Datadog is developing a dedicated API integration that will provide proper cloud service monitoring while respecting service idling behavior. In the interim, teams can use the OpenMetrics integration approach via ClickHouse Prometheus endpoints for operational separation and cost-efficient monitoring. For configuration guidance, see [Datadog's Prometheus and OpenMetrics integration documentation](https://docs.datadoghq.com/integrations/openmetrics/).

### ClickStack[​](#clickstack "Direct link to ClickStack")

ClickStack is ClickHouse's recommended observability solution for deep system analysis and debugging, providing a unified platform for logs, metrics, and traces using ClickHouse as the storage engine. This approach relies on HyperDX, the ClickStack UI, connecting directly to the system tables inside your ClickHouse instance.
HyperDX ships with a ClickHouse focused dashboard with tabs for Selects, Inserts, and Infrastructure. Teams can also use Lucene or SQL syntax to search system tables and logs, as well as create custom visualizations via Chart Explorer for detailed system analysis.
This approach is ideal for debugging complex issues, performance analysis, and deep system introspection rather than real-time production alerting.

Note

Note that this approach will wake idle services as HyperDX queries the system tables directly.

### ClickStack deployment options[​](#clickstack-deployment "Direct link to ClickStack deployment options")

- [Helm](/docs/use-cases/observability/clickstack/deployment/helm): Recommended for Kubernetes-based debugging environments. Allows for environment-specific configuration, resource limits, and scaling via `values.yaml`.
- [Docker Compose](/docs/use-cases/observability/clickstack/deployment/docker-compose): Deploys each component (ClickHouse, HyperDX, OTel collector, MongoDB) individually.
- [HyperDX Only](/docs/use-cases/observability/clickstack/deployment/hyperdx-only): Standalone HyperDX container.

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).

### 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.