How OpenRouter observes, understands, and acts on 740 million LLM requests a day with ClickHouse Cloud
OpenRouter uses ClickHouse Cloud as a single store for request telemetry from its LLM gateway, writing each request once and using materialized views to produce rollups for customer activity charts, provider health dashboards, public model rankings and routing decisions. Monthly requests grew 33x to 19.7 billion between November 2024 and August 2026, and the raw generation log holds about 134 billion rows. Ingestion combines batched and async inserts, ClickPipes from Postgres and GCP Pub/Sub, and Fivetran. A dbt medallion warehouse of roughly 270 fully documented models sits on top and serves internal Slack agents that answer questions such as support triage. Routing outcomes are written back to ClickHouse as a continuous feedback loop, which now also drives a router that picks the model itself by classifying the prompt's task type and ranking models by real usage for that task.
Related posts
- How Respan is scaling LLM observability with ClickHouse Cloud
ClickHouse mediumAdept
Respan, an AI gateway with built-in LLM observability processing about 50 million events per day, moved ingestion and analytics from Postgres to ClickHouse Cloud after per-request transactional inserts began contending at 50-100 writes per second. The ClickHouse design keeps rows small by storing typed metric columns and truncating prompt and output text. Incremental materialized views cascade minute-level rollups into hourly rollups per dimension, while refreshable materialized views update user-metadata joins every 10 minutes. Trace spans arrive asynchronously and are linked to parents at query time, and argMax-style aggregates replace the expensive FINAL modifier so trace analytics stay memory-efficient at billions of rows.
- Why Astronomer chose ClickHouse to power its new data observability platform, Astro Observe
ClickHouse easyNovice
Astronomer built Astro Observe, an observability platform for Apache Airflow, on ClickHouse Cloud after a per-customer Amazon RDS Postgres setup degraded on large time-range aggregations and forced limits on retained data. Airflow DAG and task events flow through an ingestion API and Go enrichment services into Kafka for buffering and replay, then into ClickHouse, while low-volume deployment and GitHub change events are written directly. Tables share common keys such as org_id, run_id and asset_id; per-table TTLs handle retention, MergeTree engines deduplicate, and materialized views precompute aggregations at insert time. The motivating numbers: 100 million tasks a month with a 1.5% failure rate, each failure taking about 1.24 hours to resolve.
- Inside Laravel Nightwatch’s Observability Pipeline: Real-Time Event Processing with Amazon MSK and ClickHouse Cloud
ClickHouse easyNovice
Laravel Nightwatch, Laravel's first-party observability platform, ingests telemetry through API Gateway and Lambda into Amazon MSK Express brokers, then streams it into ClickHouse Cloud via ClickPipes, with materialized views pre-aggregating raw JSON. Transactional data such as accounts and billing stays in RDS PostgreSQL, keeping it separate from analytical workloads. MSK sustained over 1 million events per second in load testing, and the launch handled 500 million events on day one with 97 ms average dashboard latency. Sub-second queries at billions of rows rely on time-series partitioning, ClickHouse codecs and compute separation, though the write-up stays high-level and reads partly as vendor marketing.
- Building a .NET API Gateway with ClickHouse and Aspire
ClickHouse mediumAdept
A sample .NET API gateway uses Aspire to orchestrate a ClickHouse container, a YARP gateway, backend APIs, a load generator, an analytics API and a Blazor dashboard. Aspire provides live OpenTelemetry metrics and ClickHouse stores the full request history for aggregate analytics. The gateway middleware never blocks on the database: it enqueues rows into a bounded System.Threading.Channels queue with DropWrite, counts drops as a metric, and a background service batch-inserts via RowBinary with async_insert and wait_for_async_insert. The ClickHouse schema uses LowCardinality columns, daily partitions, a sorting key, a 30-day TTL, and an AggregatingMergeTree materialized view with -State/-Merge combinators so percentile dashboards stay fast regardless of log volume.
- How Langfuse is scaling LLM observability for the agentic era with ClickHouse Cloud
ClickHouse mediumAdept
Langfuse moved its LLM tracing data from a single-node Postgres instance to ClickHouse after ingestion growth caused timeouts, high IOPS costs and slow SDK ingestion. The new pipeline routes SDK and OTel events through Redis queues and S3 to async workers, with ClickHouse as the analytical engine, and query latency fell from minutes to near real-time. Lessons from running it at scale include passing primary keys such as timestamps through frontend state, testing alternative data models against production data, and using compute-compute separation to protect UI queries from ingestion spikes. Because mutable span updates with ReplacingMergeTree and heavy trace/span joins became costly, Langfuse is moving to a wide, immutable events table that cut memory use about 3x and made queries up to 20x faster, with legacy data backfilled in the background.