---
title: "How we built reliable log delivery to thousands of unpredictable endpoints"
description: "Datadog's Log Forwarding avoids head-of-line blocking from Kafka's per-partition FIFO ordering by moving logs out of Kafka early into cloud object storage, grouped by destination."
url: "https://swe.quest/articles/how-we-built-reliable-log-delivery-to-thousands-of-unpredictable-endpoints-0cf63fb1f4da9cac"
canonical: "https://www.datadoghq.com/blog/engineering/reliable-log-delivery/"
source: "Datadog Engineering"
published: "2025-06-23"
difficulty: "medium"
kind: "Case study"
reading_minutes: 14
tags: ["observability","system-design","multi-tenancy","resilience","messaging"]
---

# How we built reliable log delivery to thousands of unpredictable endpoints

A post on [Datadog Engineering](https://swe.quest/sources/datadog.md), published 2025-06-23, 14 min read, Case study. Original: [https://www.datadoghq.com/blog/engineering/reliable-log-delivery/](https://www.datadoghq.com/blog/engineering/reliable-log-delivery/)

## Summary

Datadog's Log Forwarding avoids head-of-line blocking from Kafka's per-partition FIFO ordering by moving logs out of Kafka early into cloud object storage, grouped by destination. A stager service reads logs from Kafka and writes slice files of individually compressed per-destination slices, which it uploads and registers in a metadata store before committing Kafka offsets. A leader-elected planner builds lightweight forwarding tasks from eligible slices based on each destination's batching settings. Shipper workers range-read only the slices they need, send them to the endpoint and retry failures with exponential backoff, which gives per-endpoint isolation without a Kafka topic per destination and scales horizontally to gigabytes per second.

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)
- [System design](https://swe.quest/tags/system-design.md) (Architecture & design)
- [Multi-tenancy](https://swe.quest/tags/multi-tenancy.md) (Architecture & design)
- [Resilience](https://swe.quest/tags/resilience.md) (Distributed systems)
- [Queues & messaging](https://swe.quest/tags/messaging.md) (Backend & APIs)

## Prerequisites

- Kafka partitions and offsets ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))
- object storage range reads ([easy posts on Storage systems](https://swe.quest/tags/storage-systems.md?difficulty=easy))
- exponential backoff

## Keywords

Datadog Log Forwarding, Kafka, slice files, Husky

## Related posts

- [Achieving relentless Kafka reliability at scale with the Streaming Platform](https://swe.quest/articles/achieving-relentless-kafka-reliability-at-scale-with-the-streaming-platform-ccf96914fd7cb7a9.md): Datadog Engineering · 2025-02-19 · Medium · 10 min read · Queues & messaging, Resilience, Distributed systems, Scaling, Rust
  Datadog runs hundreds of Kafka clusters with millions of partitions and built the Streaming Platform, a control layer that decouples producers and consumers from specific clusters through "Streams" spanning clusters, AZs and Kubernetes environments.
- [How We Rebuilt Our Log Storage and Search Infrastructure for Scale](https://swe.quest/articles/how-we-rebuilt-our-log-storage-and-search-infrastructure-for-scale-ff36f77144f2ff50.md): Railway · 2022-01-20 · Medium · 3 min read · Observability, System design, Scaling, RPC & gRPC, GraphQL
  Railway replaced per-request Docker log polling (every 2 seconds, straining the Docker daemon across 500,000+ deployments) with a centralized log pipeline.
- [Husky: Exactly-once ingestion and multi-tenancy at scale](https://swe.quest/articles/husky-exactly-once-ingestion-and-multi-tenancy-at-scale-e0787135af05f4f3.md): Datadog Engineering · 2023-02-22 · Hard · 21 min read · Multi-tenancy, Distributed systems, Stream processing, Queues & messaging, Analytics & OLAP
  Husky, Datadog's columnar event store, achieves exactly-once ingestion and cost-efficient multi-tenancy by routing events deterministically to Kafka partition groups (shards), so deduplication only has to happen within a shard.
- [Building Self-driving Kafka clusters using open source components](https://swe.quest/articles/building-self-driving-kafka-clusters-using-open-source-components-f376c07215769703.md): Slack Engineering · 2022-02-11 · Medium · 11 min read · Queues & messaging, Scaling, SRE, Chaos engineering, Infrastructure as code
  Slack standardized roughly 10 Kafka clusters (0.7 PB, 6.5 Gbps peak) onto Kafka 2.0.1 and automated their operation with Chef, Terraform ASGs, Consul-assigned Zookeeper IDs, Cruise Control, Kafka Manager and a Prometheus offset exporter.
- [Ensuring reliable OpenTelemetry ingestion at scale](https://swe.quest/articles/ensuring-reliable-opentelemetry-ingestion-at-scale-ef5f46f7e6587da0.md): ClickHouse · 2026-08-24 · Medium · 12 min read · Observability, Resilience, Data pipelines, Cloud platforms, Kubernetes
  ClickHouse's LogHouse OpenTelemetry pipeline, ingesting 50 million events per second, absorbs database backpressure by failing over to S3 rather than buffering in memory, local WALs or Kafka.

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)
