ClickHouse and OpenTelemetry
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.
Related posts
- Building an Observability Solution with ClickHouse - Part 2 - Traces
ClickHouse mediumAdept
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.
- 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.
- How we made ClickStack 5x faster for ClickHouse observability
ClickHouse hardMaster
ClickStack's OpenTelemetry logs schema, inherited from the ClickHouse exporter for the OTel Collector, was reworked through a benchmark-driven process. The changes combined time-bucketed primary key redesign, text indexes, query rewrites, materialized views and newer ClickHouse features, cutting representative observability query latency by more than 5×. Every schema iteration was validated with the ClickCannon tool and ephemeral ClickHouse Cloud instances at 640 MiB/s ingest on three 24-core replicas. Each change was judged against ingestion throughput, CPU, memory, part counts and the full query workload, so a gain on one query pattern could not hide regressions elsewhere.
- 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.
- Scaling our Observability platform beyond 100 Petabytes by embracing wide events and replacing OTel
ClickHouse mediumAdept
ClickHouse's internal LogHouse platform grew from 19 PiB to over 100 PB of uncompressed logs (about 500 trillion rows), mostly by replacing the OpenTelemetry pipeline for ClickHouse server telemetry with SysEx. SysEx is a pull-based Go exporter that copies system tables byte-for-byte from customer pods into LogHouse in ClickHouse's Native format. It assigns pods to scrapers with a hash ring and queries a sliding time window trailing real time by about five minutes, so internal buffers flush before rows are read. Schema drift is handled with hashed, versioned tables unified through the Merge engine. The OTel collectors needed 800+ cores for 2M logs/s and still dropped events, while SysEx ships 37M logs/s on about 70 cores with no edge loss. HyperDX now replaces the team's Grafana-based UI.