---
title: "ClickHouse vs Prometheus for High Cardinality, Part 2: Cardinality in ClickHouse"
description: "ClickHouse handles high-cardinality observability data by storing telemetry as wide events, rows of attributes plus measurements, instead of as independently maintained time series."
url: "https://swe.quest/articles/clickhouse-vs-prometheus-for-high-cardinality-part-2-cardinality-in-clickhouse-c26222ca23ed95e2"
canonical: "https://clickhouse.com/blog/clickhouse-vs-promethous-high-cardinality-part-2-cardinality-in-clickhouse"
source: "ClickHouse"
published: "2026-05-15"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 19
tags: ["observability","analytics","storage-engines","databases"]
---

# ClickHouse vs Prometheus for High Cardinality, Part 2: Cardinality in ClickHouse

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-05-15, 19 min read, Deep dive. Original: [https://clickhouse.com/blog/clickhouse-vs-promethous-high-cardinality-part-2-cardinality-in-clickhouse](https://clickhouse.com/blog/clickhouse-vs-promethous-high-cardinality-part-2-cardinality-in-clickhouse)

## Summary

ClickHouse handles high-cardinality observability data by storing telemetry as wide events, rows of attributes plus measurements, instead of as independently maintained time series. A new label combination therefore adds a row rather than a new in-memory series object, so cardinality is paid mostly at query time rather than at ingestion. The recommended schema keeps dynamic labels in a sharded Map, materializes frequently filtered labels and metrics into typed columns in the sorting key, and adds inverted text indexes over map keys and values. Sparse primary indexes, granule pruning, per-column codecs and bucketed map serialization (2–49× faster single-key lookups) keep I/O and storage low, though ClickHouse is not a drop-in Prometheus replacement.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)

## Prerequisites

- Prometheus label model
- columnar storage basics
- SQL ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))

## Keywords

ClickHouse, Prometheus, MergeTree, ClickStack, OpenTelemetry, Map type

## Related posts

- [How the D. E. Shaw group powers high-cardinality observability at scale with ClickHouse](https://swe.quest/articles/how-the-d-e-shaw-group-powers-high-cardinality-observability-at-scale-with-b74a9887c2072ab0.md): ClickHouse · 2026-05-15 · Medium · 7 min read · Observability, Analytics & OLAP, Scaling, Capacity planning
  The D. E. Shaw group moved per-task resource metrics from its HPC grid, millions of high-cardinality time series keyed by unique task IDs, from an InfluxDB-protocol time-series platform to ClickHouse.
- [ClickHouse vs Prometheus for High Cardinality, Part 1: Understanding the Problem](https://swe.quest/articles/clickhouse-vs-prometheus-for-high-cardinality-part-1-understanding-the-problem-53412c04daa51734.md): ClickHouse · 2026-05-14 · Medium · 13 min read · Observability, Storage engines, Performance engineering
  High cardinality hurts Prometheus because its storage unit is the individual series.
- [So, is ClickHouse winning the observability wars?](https://swe.quest/articles/so-is-clickhouse-winning-the-observability-wars-3577c2c26e782dd2.md): ClickHouse · 2026-08-27 · Medium · 20 min read · Observability, Analytics & OLAP, Storage engines, Search, Performance engineering
  ClickHouse has become a common storage and query layer for observability, and the main reason is its columnar architecture.
- [Building an Observability Solution with ClickHouse at Dash0](https://swe.quest/articles/building-an-observability-solution-with-clickhouse-at-dash0-f950ba66eb3161c6.md): ClickHouse · 2025-04-07 · Hard · 18 min read · Analytics & OLAP, Observability, Storage engines, Databases, Cost optimization
  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.
- [Building Chronicle: How Temporal supercharged their observability with ClickHouse](https://swe.quest/articles/building-chronicle-how-temporal-supercharged-their-observability-with-clickhouse-79bdd569ad12228b.md): ClickHouse · 2024-11-14 · Easy · 6 min read · Observability, Analytics & OLAP, Multi-tenancy, Cost optimization
  Temporal built Chronicle, an observability system on ClickHouse, to handle high-cardinality, per-tenant telemetry for its multi-tenant Temporal Cloud without runaway costs.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
