Skip to content

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

ClickHouse 9 min read Case study mediumAdept

Trace similarity systems on top of ClickHouse to analyze crash stack traces from our CI

ClickHouse built a crash-deduplication pipeline for its CI that groups similar stack traces from fuzzing, stress and functional tests using the TraceSim similarity method, implemented almost entirely in ClickHouse SQL. Crash logs are pulled from a CI logs cluster into a separate analysis cluster every 30 minutes via a refreshable materialized view. SQL UDFs strip addresses, file/line info, ABI tags and LLVM suffixes from frames on the fly so cleaning logic can change without reprocessing. Identical cleaned traces are hashed and matched against known GitHub issues, insignificant traces are filtered by PR count and master presence, and the rest are compared with weighted arraySimilarity to open or update issues.

Assumes: SQLClickHouse MergeTree tablesstack traces

Related posts

  • Using Event Patterns in ClickStack to accelerate observability analysis

    ClickHouse mediumAdept

    ClickStack clusters logs and traces into event patterns at query time using the Drain3 template-mining algorithm, which runs in the browser via Pyodide (Python compiled to WebAssembly). Clustering at ingest was rejected because the overhead is too high at gigabytes-per-second ingestion rates. Instead, each search result set is sampled down to about 10,000 evenly distributed events with a cityHash64-modulo sampling query that avoids ORDER BY rand(), returning clusters within seconds. The recommended workflow is to filter broadly by service or severity, treat rare patterns as leads, then pivot to raw search or traces. Future work could run Drain3 as a ClickHouse UDF and compile the learned templates into ingest-time extraction rules for better compression.

  • Seeing the Big Picture: Shopee’s Journey to Distributed Tracing with ClickHouse

    ClickHouse easyNovice

    Shopee runs dozens of ClickHouse clusters on Kubernetes, fronted by managed services (Manager, Gateway, Console, Monitoring), and uses them to store and query distributed traces of the ClickHouse service itself. Cluster types include SSD and HDD MPP, compute-storage separation via zero-copy replication on Apache Ozone, and hot/cold tiering. Traces are stored in system tables and materialized views, ingesting up to 3M rows/s on 20 cores at about 1:8 compression, with trace-ID lookups over 30B rows taking seconds. The traces exposed slow client uploads that compression fixed, a Kubernetes DNS cache misrouting queries, inefficient distributed joins, blocking DDL on a single node, and INSERT failures caused by materialized views.

  • How Canva achieved 10x faster search and 70% lower costs with ClickHouse

    ClickHouse mediumAdept

    Canva moved tracing and logging (about 3 million spans and 3 million logs per second) onto a self-managed ClickHouse cluster of 5 shards × 3 replicas on Kubernetes. It reached a 14x compression ratio, cut costs by about 70%, and brought P90 trace search down from 30s to 2.5s. The ingestion gains came from batching roughly 200k spans per insert in OpenTelemetry collectors and writing straight to local tables. Search speed came from a sorting key aligned with Jaeger's filters, daily partitions, a materialized-view lookup table keyed by trace ID, and a client-side sliding search window. Logs flow through Kinesis and Lambda using tuned async inserts, with ngram Bloom filters on flattened log strings for free-text search and a custom DSL query gateway.

  • Testing the Performance of ClickHouse

    ClickHouse mediumAdept

    ClickHouse catches performance regressions in CI by running the reference and patched servers side by side on the same machine and alternating about 3000 end-to-end test queries between them. This cancels out environmental systematic errors. A non-parametric bootstrap on the difference of median run times yields a noise threshold T, and a change is flagged only when it exceeds both T and 5%. Queries with T of 10% or more are marked unstable. Regressions are investigated with the built-in sampling profiler (system.trace_log), differential flamegraphs, ProfileEvents and hardware counters, while historical results stored in ClickHouse help locate when a change was introduced. Keeping false positives low matters more than producing a green check, and many test queries turned out to measure nothing meaningful.

  • What's new in ClickStack - April 2026

    ClickHouse mediumAdept

    ClickStack's April 2026 release adds alerts driven by arbitrary ClickHouse SQL, so rolling baselines and standard-deviation anomaly checks can be written with window functions and fire when the query returns 1. The default otel_logs schema was redesigned around ClickHouse full-text indexes on attribute map keys/values and lower(Body), with a five-minute bucketed ordering key, improving sample query performance by over 70% at comparable insert cost; versions before 26.2 fall back to bloom_filter indexes. An opt-in companion column flattens attribute maps into key=value arrays so map lookups are rewritten to indexed has() predicates, running 1.4–10x faster. Autocomplete now reads from 15-minute materialized-view rollups instead of scanning live tables, and heatmaps become a general chart type.

The quest for software engineering knowledge.

Look:
Layout: