BlogsDatadogDatadog Agent Binary Size Reduction

Datadog Agent Binary Size Reduction

Datadog Agent Binary Size Reduction

2
posts
2025–2026

Datadog's Go Agent binaries have undergone significant size reductions, decreasing by up to 77% through systematic dependency auditing, targeted refactors, and re-enabling linker optimizations. This effort involved analyzing build tag usage, isolating dependencies into separate packages, and leveraging tools like `go list` and `goda` for dependency graphing. The project also led to contributions to the Go toolchain and improvements for other large Go projects like Kubernetes. The Datadog Lambda Extension was re-engineered in Rust, resulting in an 82% reduction in cold start latency, a 40% reduction in memory usage, and a binary size reduction from 55 MB to 7 MB. This rewrite focused on minimizing overhead in the resource-constrained Lambda environment, including manually writing AWS API calls to avoid SDK performance penalties and implementing flexible flush strategies (end of invocation, race, or periodic) to balance telemetry immediacy with CPU and transfer costs.

2026

How we reduced the size of our Agent Go binaries by up to 77% | Datadog

2/18/2026

This post details the technical strategies employed to reduce the size of Datadog Agent Go binaries. It covers dependency auditing using `go list` and `goda` to identify and remove unnecessary packages, the application of build tags to conditionally exclude files and their imports, and the refactoring of code to move dependency-heavy functions into separate packages for selective inclusion. The post also touches upon linker optimizations and the impact of these changes on artifact size.

2025

Squeezing every millisecond: How we rebuilt the Datadog Lambda Extension in Rust | Datadog

4/9/2025

The Datadog Lambda Extension was re-engineered from Go to Rust, achieving significant performance improvements: 82% reduction in cold start latency, 40% reduction in memory usage, and a binary size decrease from 55 MB to 7 MB. This involved adopting Rust for its memory safety and small binary output, and implementing specific design constraints for the Lambda environment, such as minimizing impact on the Lambda function handler and post-runtime duration. Manual implementation of AWS API calls was used to avoid SDK overhead. Flexible flush strategies (end, race, periodic) were introduced to optimize telemetry delivery based on workload type.