New to Kestra?
Use blueprints to kickstart your first workflows.
Audits ClickHouse external dictionaries for excessive RAM consumption, alerting OLAP teams on Slack before MEMORY_LIMIT_EXCEEDED errors occur.
This blueprint acts as an automated memory governor for ClickHouse analytical databases. Scheduled hourly, it queries system.dictionaries across cluster nodes, evaluates bytes_allocated for loaded external dictionaries, flags failed or oversized in-memory structures, and delivers actionable tuning alerts to Slack before memory pressure triggers query failures or kernel out-of-memory kills.
hourly_dict_memory_audit trigger (io.kestra.plugin.core.trigger.Schedule) fires at the top of every hour.audit_dictionary_memory task (io.kestra.plugin.scripts.python.Script) queries system.dictionaries via HTTP interface to measure memory allocation and load status per dictionary.check_memory_threshold flowable task (io.kestra.plugin.core.flow.If) branches based on whether any dictionary exceeded the configured warning threshold.notify_slack_olap (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) dispatches an urgent incident card with layout tuning recommendations.log_dictionaries_healthy records confirmed status.export_dict_manifest task tags the execution with searchable status labels.flowchart TD
A[Schedule: Hourly] --> B[audit_dictionary_memory: ClickHouse system.dictionaries]
B --> C{Dictionary Exceeds Limit or Failed?}
C -- Yes --> D[notify_slack_olap: Slack Webhook]
C -- No --> E[log_dictionaries_healthy: Log]
D --> F[export_dict_manifest: Execution Labels]
E --> F
HASHED_ARRAY or cached layouts (CACHE) with eviction policies.| Name | Type | Default | Description |
|---|---|---|---|
clickhouse_endpoint |
STRING | http://clickhouse.internal:8123 |
HTTP endpoint URL for the ClickHouse cluster coordinator or node. |
max_dict_memory_mb_warning |
FLOAT | 1024.0 |
Maximum permissible RAM footprint in megabytes for any single external dictionary. |
slack_channel |
STRING | #clickhouse-alerts |
Slack channel destination for OLAP memory governance alerts. |
{{ outputs.audit_dictionary_memory.vars.total_dictionaries_audited }}: Total dictionaries inspected in system catalog.{{ outputs.audit_dictionary_memory.vars.flagged_dictionaries_count }}: Number of dictionaries exceeding memory limit or failed.{{ outputs.audit_dictionary_memory.vars.has_memory_overflow }}: Boolean flag indicating memory overflow risk.{{ outputs.audit_dictionary_memory.vars.max_dictionary_memory_mb }}: Peak memory observed for a single dictionary in megabytes.{{ outputs.audit_dictionary_memory.outputFiles['clickhouse_dictionary_report.json'] }}: Full JSON dictionary memory diagnostics report.SELECT privileges on the system.dictionaries table.CLICKHOUSE_USER: ClickHouse authentication username.CLICKHOUSE_PASSWORD: ClickHouse authentication password.SLACK_WEBHOOK_URL: Slack Incoming Webhook endpoint URL.CLICKHOUSE_USER, CLICKHOUSE_PASSWORD, and SLACK_WEBHOOK_URL in your Kestra namespace secrets.clickhouse_endpoint.system.dictionaries reflects the local node state; query clusterAllReplicas('my_cluster', system.dictionaries) if auditing multi-node topologies.LIFETIME(0) or lazy loading only allocate memory upon the first dictGet invocation; maintain periodic background health probes.SYSTEM RELOAD DICTIONARY <name> if transient network timeouts caused load failure.max_server_memory_usage settings.