---
title: "Scaling real-time file monitoring with eBPF: How we filtered billions of kernel events per minute"
description: "Datadog built file integrity monitoring on eBPF to capture file changes with process and container context, which periodic scans, inotify and auditd could not provide at scale."
url: "https://swe.quest/articles/scaling-real-time-file-monitoring-with-ebpf-how-we-filtered-billions-of-kernel-2f88f92ad0613fab"
canonical: "https://www.datadoghq.com/blog/engineering/workload-protection-ebpf-fim/"
source: "Datadog Engineering"
published: "2025-11-18"
difficulty: "medium"
kind: "Case study"
reading_minutes: 9
tags: ["linux","threat-detection","performance","scalability"]
---

# Scaling real-time file monitoring with eBPF: How we filtered billions of kernel events per minute

A post on [Datadog Engineering](https://swe.quest/sources/datadog.md), published 2025-11-18, 9 min read, Case study. Original: [https://www.datadoghq.com/blog/engineering/workload-protection-ebpf-fim/](https://www.datadoghq.com/blog/engineering/workload-protection-ebpf-fim/)

## Summary

Datadog built file integrity monitoring on eBPF to capture file changes with process and container context, which periodic scans, inotify and auditd could not provide at scale. Their infrastructure produces over 10 billion file events per minute at roughly 5 KB each. Agent-side rule matching cuts what reaches the backend to about one million events per minute. In-kernel prefiltering goes further: static approvers are derived from detection rules, and dynamic discarders are pushed at runtime into LRU eBPF maps. Together they drop up to 94% of events before they hit the ring buffer, which lowers CPU use and prevents dropped events.

Written by swe.quest, not by the author.

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

## Topics

- [Linux](https://swe.quest/tags/linux.md) (Infrastructure)
- [Threat detection](https://swe.quest/tags/threat-detection.md) (Security)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)

## Prerequisites

- eBPF basics ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))
- Linux syscalls ([easy posts on Linux](https://swe.quest/tags/linux.md?difficulty=easy))
- ring buffers

## Keywords

eBPF, File integrity monitoring, Datadog Agent, inotify, auditd, eBPF maps

## Related posts

- [Hardening eBPF for runtime security: Lessons from Datadog Workload Protection](https://swe.quest/articles/hardening-ebpf-for-runtime-security-lessons-from-datadog-workload-protection-d7f876ff0025b179.md): Datadog Engineering · 2026-01-07 · Hard · 34 min read · Linux, Threat detection, Security, Operating systems, Performance engineering
  Five years of running Datadog Workload Protection, an eBPF-based runtime security agent supporting kernels from 4.15 to 6.18, distilled into six production lessons.
- [Well, That Wasn't Fun: October 16 '26](https://swe.quest/articles/well-that-wasn-t-fun-october-16-26-83d1120fe160ef39.md): Fly.io · 2026-11-06 · Medium · 7 min read · Incidents & postmortems, Vulnerability research, Linux, Virtualization, Networking
  A Linux kernel bug in IPv4 checksum offload validation let a guest VM direct the host to write its computed checksum into an already-trusted IPv4 header field.
- [How GitHub uses eBPF to improve deployment safety](https://swe.quest/articles/how-github-uses-ebpf-to-improve-deployment-safety-e56d5b65b00aac89.md): GitHub Engineering · 2026-04-16 · Medium · 8 min read · Linux, Deployment, Go, Networking, DNS
  GitHub prevents deployment scripts from introducing circular dependencies on github.com or internal services by running them in a dedicated cgroup with eBPF programs attached.
- [How to catch crypto miners using syscall signatures](https://swe.quest/articles/how-to-catch-crypto-miners-using-syscall-signatures-d0f6cd50f5ee160a.md): Modal · 2024-06-06 · Medium · 7 min read · Threat detection, Sandboxing & isolation, Linux, Serverless, Containers
  Modal detects cryptominers abusing its GPU serverless platform by analyzing container syscalls at runtime rather than relying only on user metadata, which abusers can fake with stolen credit cards.
- [A fine-grained network traffic analysis with Millisampler](https://swe.quest/articles/a-fine-grained-network-traffic-analysis-with-millisampler-199069a4bdff3c38.md): Meta Engineering · 2023-04-17 · Hard · 4 min read · Networking, Observability, Linux, Datacenters, Performance engineering
  Millisampler is a lightweight eBPF-based tc filter deployed across Meta's server fleet that records fine-grained network traffic time series at 100μs, 1ms and 10ms granularities: ingress/egress bytes, ECN-marked bytes, retransmissions, in-region vs cross-region traffic, and active connection counts estimated with a 128-bit sketch.

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)
