Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 4 min read How-to mediumAdept

A Story of Open-source GitHub Activity using ClickHouse + Grafana

A Grafana dashboard backed by ClickHouse analyzes the Grafana repository's ten-year history as a richer alternative to GitHub's Pulse analytics. It combines the GH Archive event dataset (5.5B+ events covering stars, issues, PRs and forks) with commit, file-change and line-level history generated by ClickHouse's git-import tool. Panels use Grafana macros such as $__timeFilter and $__timeInterval to respect dashboard time ranges, with a sample top-committers heatmap query. Findings include founder Torkel's continued heavy commit activity, alerting and Docker support as the most popular issues, and stargazers of both projects typically starring Grafana first.

Assumes: SQL basicsGrafana dashboards

Related posts

  • ClickHouse Newsletter July 2023: Seeing Clearly

    ClickHouse mediumAdept

    ClickHouse v23.6 adds 10 features, 12 performance optimisations and 31 bug fixes. Highlights include exploiting natural sort order in almost-sorted columns that aren't in the ordering key, MongoDB integration support up to v6, and a transform function that now works with all data types. The query of the month uses the windowFunnel function on the GitHub Events dataset for a fork-to-PR funnel analysis. About 17% of ClickHouse forkers open a PR within 30 days, which ranks 22nd among repositories with more than 25k stars and 5k forks. The rest of the issue is links and upcoming meetups and trainings.

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

  • How GitLab serves sub-second analytics to 50 million users

    ClickHouse easyNovice

    GitLab moved its user-facing product analytics from Postgres to ClickHouse after dashboards repeatedly hit its 15-second performance ceiling. Hierarchical multi-join queries over 100M+ rows dropped from 30–40 seconds to 0.24 seconds, and ClickHouse is now the default OLAP engine across GitLab.com, Dedicated and self-managed deployments. A hybrid data access layer routes queries between Postgres and ClickHouse, ingestion runs as TSV over HTTP plus an in-house CDC framework (Siphon), and materialized views are the main optimization tool. The team built and ran its own ClickHouse operator on object storage before moving SaaS to ClickHouse Cloud, and warns against self-managing unless required. It also flags poor visibility into background mutations as an ongoing operational pain.

  • Adding Analytics to an Application in under 10 minutes with ClickHouse Cloud Query Endpoints

    ClickHouse mediumAdept

    ClickHouse Cloud's beta API endpoints turn a saved parameterized SQL query into a secure HTTP POST endpoint, moving SQL out of application code so queries can change without redeploying. The walkthrough adds GitHub stars, issues, forks and PR counts to the ClickPy PyPI dashboard. A query resolves each package's GitHub repo ID from PyPI metadata and aggregates the GitHub events table with uniqExactIf. The endpoint is bound to a read-only role with IP-keyed quotas and optional CORS, then called from a Next.js/React component via a generic fetch helper, returning any of ClickHouse's output formats such as JSONEachRow.

  • Window and array functions for Git commit sequences

    ClickHouse mediumAdept

    ClickHouse window and array functions can find the longest streak of consecutive commit days per author in the ClickHouse Git repository. Commits are grouped to author/day pairs. A window function with PARTITION BY author and ROWS BETWEEN 1 PRECEDING AND CURRENT ROW fetches each author's previous commit day, and dateDiff flags rows that are exactly one day apart. The flags are collected with groupArray, split on zeros with arraySplit, mapped to lengths and reduced with arrayMax to get each author's longest streak. The query runs in about 28 ms over 62K rows, and the same pattern applies to other sequence-detection problems.

The quest for software engineering knowledge.

Look:
Layout: