New to Kestra?
Use blueprints to kickstart your first workflows.
Monitor ClickHouse disk capacity and prevent read-only table lockouts with Kestra. Query system.disks, open GitHub issues, and alert Data SRE on Slack.
ClickHouse relies on local NVMe SSDs or mounted block storage volumes to store partitioned columnar data parts and perform asynchronous background merges (MergeTree). When available disk space drops below critical thresholds, ClickHouse automatically terminates background merges and places tables into read-only mode, refusing incoming real-time ingestion pipelines. This blueprint queries ClickHouse's system.disks table periodically via JDBC, identifies storage volumes breaching safe free space percentages, opens a prioritized GitHub Data SRE incident ticket, and alerts engineering teams on Slack.
periodic_clickhouse_disk_check (io.kestra.plugin.core.trigger.Schedule) initiates the audit every 30 minutes (shipped disabled for safe verification).probe_clickhouse_disks (io.kestra.plugin.jdbc.clickhouse.Query) queries system.disks for total and free space bytes and calculates the free space percentage across all configured disks.evaluate_disk_headroom (io.kestra.plugin.core.debug.Return) calculates if the volume with the least free space breached free_space_percent_threshold.branch_on_disk_pressure (io.kestra.plugin.core.flow.If) evaluates the condition:then: Automatically files a GitHub tracking issue via create_storage_incident_issue (io.kestra.plugin.github.issues.Create) and alerts the Slack channel via alert_data_sre_slack (io.kestra.plugin.slack.notifications.SlackIncomingWebhook).else: Emits an informational log entry (log_storage_healthy) confirming ample storage headroom.log_audit_complete (io.kestra.plugin.core.log.Log) records the final audit outcome.errors block alerts Slack if database authentication or network connectivity fails.Kestra simplifies multi-system reliability by connecting ClickHouse JDBC querying, mathematical threshold evaluation, GitHub issue ticketing, and team alerting into a single declarative pipeline. It manages database credentials securely, provides complete execution history, and eliminates the need for separate standalone monitoring daemons.
system.disks administrative table.CLICKHOUSE_USER, CLICKHOUSE_PASSWORD: Authentication credentials for ClickHouse JDBC connection.GITHUB_TOKEN: GitHub token used to open incident issues.SLACK_WEBHOOK: Incoming Webhook URL for data platform alerts.clickhouse_url (STRING, default jdbc:ch://clickhouse.internal.company.com:8123/default): ClickHouse JDBC connection URL.free_space_percent_threshold (FLOAT, default 15.0): Percentage of free space below which alerts fire.target_repository (STRING, default my-org/data-platform-operations): Target GitHub repository for logging incident issues.outputs.probe_clickhouse_disks.row.name: Name of the storage volume with lowest headroom.outputs.probe_clickhouse_disks.row.free_pct: Calculated free space percentage.outputs.evaluate_disk_headroom.value.is_exhaustion_risk: Boolean indicating whether threshold was breached.CLICKHOUSE_USER, CLICKHOUSE_PASSWORD, GITHUB_TOKEN, and SLACK_WEBHOOK in your Kestra namespace.clickhouse_url to match your cluster endpoint.periodic_clickhouse_disk_check trigger for continuous storage headroom monitoring.ALTER TABLE ... MOVE PARTITION ... TO DISK 's3') to reclaim space.system.parts to list the top 10 largest tables on the constrained volume.