Building an Observability Solution with ClickHouse - Part 2 - Traces
Trace data from OpenTelemetry-instrumented services can be stored and queried in ClickHouse, treating spans as rows in a single analytics table and visualizing them in Grafana. The walkthrough uses a ClickHouse fork of the OpenTelemetry Demo, configuring the OTEL Collector's contrib ClickHouse exporter with batching (5s or 100k spans), retries, TTL-based retention and secure endpoints, deployable via Docker Compose or Helm. Practical caveats include the exporter's hard-coded schema (pre-create tables to control types and codecs), its alpha status, and the need to pre-create non-default databases, followed by tips on schema optimization for the otel_traces table.
Related posts
- How we used ClickHouse to store OpenTelemetry Traces and up our Observability Game
ClickHouse mediumAdept
Resmo stores over 300 million unsampled OpenTelemetry spans per day in a self-hosted ClickHouse node, after dropping S3/Parquet/Athena because of its 2-3 second query startup and delayed data. A single c7g.xlarge with 400 GB EBS holds more than 4 billion spans at about 92% compression (275 GiB vs 3.4 TiB). LowCardinality materialized columns for tenant and user IDs speed up common queries, and joins to Aurora Postgres add account names. The post shares SQL for latency percentiles, SpanAttributes key analysis, spans-per-trace histograms and exception-message search with hasToken.
- ClickHouse and OpenTelemetry
ClickHouse mediumAdept
ClickHouse now officially supports the OpenTelemetry Collector exporter for ClickHouse, which has reached beta for logs and traces. The exporter ships a "one size fits most" default schema. For production, ClickHouse recommends disabling automatic table creation, because concurrent exporters race to create tables, and defining your own tables or materialized views keyed to your query patterns. The LogHouse schema behind ClickHouse's 43 PB internal logging platform serves as the worked example. It orders by (PodName, Timestamp), uses LowCardinality for string columns under about 10k distinct values, applies ZSTD(1) because data lives on S3, and puts Bloom-filter indexes on map keys and values, which are not yet tuned.
- IBM Instana’s solution for monitoring ClickHouse performance
ClickHouse easyNovice
IBM Instana, which stores its telemetry in ClickHouse, built a custom span exporter to trace ClickHouse's own query execution without adding load or invasive changes to customer systems. Materialized views were rejected because they add overhead and complexity. Instead, the exporter is deployed through the auto-discovering Instana agent and polls ClickHouse's OpenTelemetry span table with a sliding window so no spans are missed. It filters and formats spans before sending them to the backend, which stitches them into end-to-end traces. Design goals included one-line installation, automatic reconfiguration, a minimal footprint, and future support for metrics and profiling.
- Goodbye limitations, hello data: How Qonto is rethinking observability with ClickHouse Cloud
ClickHouse easyNovice
Qonto, a European digital bank, moved trace storage from Grafana Tempo to ClickHouse Cloud, extending query windows from 2-3 hours to two weeks without sampling and adopting a wide-events model instead of the logs/metrics/traces pillars. High-cardinality span and resource attributes compress from 231 TB to 376 GB, saving an estimated $70K a year in S3 costs, so engineers are now encouraged to add attributes freely. Telemetry flows through OpenTelemetry collectors over AWS PrivateLink into ClickHouse, with Grafana for dashboards. An AI incident companion built on the ClickHouse MCP server, behind a roughly 30-line read-only Python layer, lets non-experts investigate incidents and scope affected customers in plain English.
- Building an Observability Solution with ClickHouse at Dash0
ClickHouse hardMaster
Dash0 stores all OpenTelemetry metrics, logs and spans in ClickHouse, using PostgreSQL only for customer settings, so signals can be joined and correlated in one system. The setup tiers storage with 1-2 days on local disk, then AWS S3 plus a local cache, driven by TTL moves, and keeps metrics for 13 months. Tables are ordered by a ResourceHash before Timestamp for better filtering and compression, with daily partitions bounding time ranges, and the cluster runs as a single shard with multiple replicas. Metric metadata is deduplicated into an AggregatingMergeTree table keyed by MetricHash with FirstSeen/LastSeen tracking, and queries against it must use GROUP BY or FINAL because merges are not guaranteed to have happened.