Loading...
Loading...
Runs a quick overview of Clickhouse server health.
npx skill4agent add altinity/skills altinity-expert-clickhouse-overviewSELECT
hostName() AS host,
database,
table,
reason,
count() AS detached_parts,
formatReadableSize(sum(bytes_on_disk)) AS bytes,
min(modification_time) AS first_detach,
max(modification_time) AS last_detach
FROM system.detached_parts
GROUP BY host, database, table, reason
ORDER BY detached_parts DESC
LIMIT 100select event_date, level, thread_name, any(logger_name) as logger_name,
message_format_string, count(*) as count
from system.text_log
where event_date > now() - interval 24 hour
and level <= 'Warning'
group by all
order by level, thread_name, message_format_stringWITH
['MergesAndMutations', 'Fetches', 'Move', 'Common', 'Schedule', 'BufferFlushSchedule', 'MessageBrokerSchedule', 'DistributedSchedule'] AS pool_tokens,
['pool', 'fetches_pool', 'move_pool', 'common_pool', 'schedule_pool', 'buffer_flush_schedule_pool', 'message_broker_schedule_pool', 'distributed_schedule_pool'] AS setting_tokens
SELECT
extract(m.metric, '^Background(.*)Task') AS pool_name,
m.active_tasks,
pool_size,
round(100.0 * m.active_tasks / pool_size, 1) AS utilization_pct,
multiIf(utilization_pct > 99, 'Major', utilization_pct > 90, 'Moderate', 'OK') AS severity
FROM
(
SELECT
metric,
value AS active_tasks,
transform(extract(metric, '^Background(.*)PoolTask'), pool_tokens, setting_tokens, '') AS pool_key,
concat('background_', lower(pool_key), '_size') AS setting_name
FROM system.metrics
WHERE metric LIKE 'Background%PoolTask'
) AS m
LEFT JOIN
(
SELECT
name,
toFloat64OrZero(value) AS pool_size
FROM system.server_settings
WHERE name LIKE 'background%pool_size'
) AS s ON s.name = m.setting_name
WHERE pool_size > 0
ORDER BY utilization_pct DESCaltinity-expert-clickhouse-replicationaltinity-expert-clickhouse-memoryaltinity-expert-clickhouse-storagealtinity-expert-clickhouse-mergesaltinity-expert-clickhouse-reportingaltinity-expert-clickhouse-ingestionaltinity-expert-clickhouse-cachesaltinity-expert-clickhouse-dictionariessystem.errorssystem.*_logaltinity-expert-clickhouse-logsaltinity-expert-clickhouse-schemaaltinity-expert-clickhouse-metricsaltinity-expert-clickhouse-logs