Skip to content

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

Datadog Engineering 8 min read Case study mediumAdept

Scaling down to speed up: How we improved efficiency of live process metrics by 100x

Datadog cut real-time process and container metric traffic by about 100x by enabling 2-second live collection only on hosts whose processes a user is actually viewing (at most 50 per user), instead of on every host in the tenant. Sorting switched to the existing 10-second data, which removed the need to hold all live metrics in a single server's memory. Host subscriptions are published over Kafka at 1-second intervals to the intake service, which keeps a TTL-based in-memory cache of viewed hosts. Peak volume fell from 500,000 to 5,000 messages per second, the live data service shrank by about 98% (over 600 cores and 1 TiB of memory freed), and Agent CPU usage dropped about 2%.

Assumes: Kafka basicsstream ingestion pipelines

Related posts

  • How we scaled metrics aggregation by moving durable state into storage

    Datadog Engineering mediumAdept

    Datadog's metrics aggregation service, which merges DDSketch distributions to reduce tag dimensions, went through three generations as volume grew roughly 10× each time. Static leader-follower partitions with local RocksDB doubled compute and needed manual partition splits. Dynamic Kafka assignment with incremental SSTable snapshots to blob storage and time-windowed lazy restore improved recovery and enabled autoscaling, but state recovery then became the bottleneck. The third generation makes streaming aggregation and deduplication best-effort. Both storage tiers reconcile partial aggregates, duplicates and late data during reads and compaction, so workers can restart at the live edge without restoring hours of state and can be provisioned for current traffic.

  • Observability At Scale — Every Byte Counts

    Wise Engineering mediumAdept

    Five observability changes at Wise cut monthly spend by 40%. Switching Loki chunk compression from Snappy to lz4 cut S3 storage and cross-AZ traffic by roughly 50% with negligible CPU impact. Moving the OpenTelemetry Collector to Tempo path from gzip to zstd reduced Tempo ingest by about 40%, and upgrading Prometheus to Remote Write v2 dropped daily traffic to Mimir from ~16TB to ~5.5TB. Aligning Loki's split_queries_by_interval with the ~1-hour p90 chunk span eliminated redundant chunk reads, and an AI-assisted investigation tracked down a Fluent Bit connection limit, with the overall lesson being to challenge defaults on high-volume data paths and validate against measured cost.

  • 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.

  • How we scaled fast, reliable configuration distribution to thousands of workload containers

    Datadog Engineering mediumAdept

    Datadog replaced on-demand per-tenant config loading (database reads plus Kafka cache-invalidation messages) with a context-publisher that snapshots all tenants' configuration into RocksDB blobs in cloud storage and streams individual updates over Kafka. Because context data is only megabytes in total and changes thousands of times per day, every workload container can hold a full local replica. Containers download the blob at startup, apply streamed updates, and refresh the snapshot roughly every 10 minutes, so they keep working through a full outage of the central database. The design deliberately puts a tiny, externally unreachable service in charge and avoids bimodal fallback paths that would go untested and could overload the database.

  • How Uken Games reduces observability costs by 87% with ClickHouse

    ClickHouse mediumAdept

    Uken Games replaced Datadog with an open-source observability stack: OpenTelemetry collectors in an agent-plus-gateway layout, SigNoz on a single ClickHouse node for traces, AWS-managed Prometheus for metrics, CloudWatch for logs, and Grafana alerts defined as code via a custom CloudFormation resource. All traces fit in about 170 GB on one ClickHouse node, the migration had zero downtime, and annual cost fell about 87% to roughly $12,000. Key cost levers were dropping unused metrics and attributes, tail-style trace sampling that keeps errors and slow requests plus a 5–10% sample, alerting on unsampled aggregate metrics, and capping retention at two weeks.

The quest for software engineering knowledge.

Look:
Layout: