Using ClickHouse to Monitor Job Queues in GitHub Actions
GitHub Actions lacks built-in metrics for its workflow job queue, but an organization-level webhook emitting workflow_job events can feed an AWS Lambda that inserts each event into a ClickHouse MergeTree table. The post provides the table schema (LowCardinality columns, an Enum8 status, partitioning by month, ordering by id and updated_at) and example SQL queries. These use argMax over updated_at to recover each job's latest status, chart queued and waiting jobs per hour, compute queue time percentiles by time of day, and show the current queue size per self-hosted runner label.
Related posts
- Building an Auto-Scaling Lambda based on Github's Workflow Job Queue
ClickHouse mediumAdept
ClickHouse replaced CloudWatch-alarm-based EC2 Auto Scaling for its self-hosted GitHub Actions runners with a Lambda that reads the workflow job queue, built from GitHub webhook events stored in ClickHouse, and sets desired capacity directly. The Lambda compares current runners against in-progress and queued jobs, then scales up by roughly deficit/5 and down by reserve/2. The old rule (add a runner after 5 minutes above 97% busy) took hours to warm up groups of 50+ runners. The new approach launches jobs faster, saves compute when load drops, and keeps busy and active runner counts much more closely aligned.
- How Modal uses ClickHouse to power real-time observability for AI workloads
ClickHouse mediumAdept
Modal powers three customer-facing observability dashboards (function scaling, per-call timeline, latency percentiles) from a single ClickHouse Cloud table ingesting 1–2 million events per minute and holding ~500 billion logs. Function-call lifecycle events (queued, executing, finished) stream through Kafka and ClickPipes into a ReplacingMergeTree table keyed on function_id, function_call_id and event_at, with ULIDs enabling primary-key range queries. Queries reconstruct call state with GROUP BY function_call_id and argMaxIf for the latest status, and compute P50/P90/P99 queue and execution latency directly with quantile functions. The team reached this scale without indexes, projections or materialized views, and is only now starting latency optimizations.
- What's new in ClickStack. October '25.
ClickHouse mediumAdept
ClickStack's October 2025 release brings alerting to ClickHouse Cloud, with Slack, PagerDuty and webhook integrations and both search-based and chart-based alerts. It also adds one-click dashboard filters, configurable Event Deltas that can plot any field such as database response time, sampled filter percentages, multiline SQL search, and configurable Kubernetes dashboard sources. On performance, chunked progressive chart loading with cached query chunks cut time-to-first-data by up to 95% and memory per query by 18-80%. Timestamp filtering now also filters on toStartOfDay(Timestamp) so the primary index is fully used, reducing latency by about 25%.
- Building Real-time Analytics Apps with ClickHouse and Hex
ClickHouse mediumAdept
ClickHouse's git-import tool was run across the 50k most-starred GitHub repositories using a queue-worker model, with the job queue implemented as a KeeperMap table instead of an external queue like SQS. New keeper_map_strict_mode settings make inserts unique per primary key and turn ALTER updates and deletes into atomic version-checked operations, so a worker can claim a job exclusively. All repositories share three ReplacingMergeTree tables keyed first on repo_name, with an updated_at materialized column used to schedule refreshes. On a 48-core machine with 25 workers, about 24 hours produced 44.7B line changes at a 14x compression ratio, which feed a Hex notebook app for real-time repository insights.
- Building an Observability Solution with ClickHouse - Part 1 - Logs
ClickHouse mediumAdept
ClickHouse can serve as the storage backend for Kubernetes log collection using any of three agents: the OpenTelemetry Collector, Vector and Fluent Bit. Each agent can be deployed via Helm in agent (DaemonSet) and aggregator roles. Aggregators batch data into larger inserts that match ClickHouse insert best practices, and small deployments that skip them should use asynchronous inserts to avoid too many parts. The OTEL exporter (alpha) hard-codes its schema, while Vector (beta, HTTP/JSON sink) lets users define their own tables. Map types are recommended for sparse Kubernetes labels and annotations, and the post closes with compression results and example SQL queries for analyzing logs by pod, time window and string or regex match.