@harperdb/datadog-agent-binary
v7.72.4
Published
TypeScript package to download and build Datadog Agent from source for multiple platforms
Maintainers
Readme
Datadog Agent Binary
An NPM package that provides pre-built Datadog Agent binaries.
Additionally this repo provides tools to build from source for Linux, Windows, and macOS on both arm64 and amd64 architectures (or at least the working subset of those).
Installation
npm install @harperdb/datadog-agent-binaryOr install globally:
npm install -g @harperdb/datadog-agent-binaryWhen you install this package, it automatically downloads the appropriate pre-built Datadog Agent binary for your platform.
Usage
Using the Datadog Agent
Once installed, you can run the Datadog Agent directly:
# Run the agent
datadog-agent run
# Check agent status
datadog-agent status
# Show agent version
datadog-agent versionBuilding from Source
If you need to build from source or want to build for multiple platforms:
# Build for current platform
datadog-agent-build build
# Specify version and output directory
datadog-agent-build build --version 7.50.0 --output ~/my-datadog-agent-buildManagement Commands
# Install or reinstall binary
datadog-agent-build install
# List supported platforms
datadog-agent-build platforms
# Get latest version
datadog-agent-build versionProgrammatic Usage
import { DatadogAgentBuilder, BinaryManager } from '@harperdb/datadog-agent-binary';
// Use pre-built binaries
const manager = new BinaryManager();
const binaryPath = await manager.ensureBinary(); // Downloads if needed
console.log(`Datadog Agent at: ${binaryPath}`);
// Build from source
const builder = new DatadogAgentBuilder();
// Build for current platform
const result = await builder.buildForCurrentPlatform({
version: '7.50.0',
outputDir: './build'
});Supported Platforms
| OS | Architecture | Status | |----|-------------|--------| | Linux | x86_64 | ✅ | | Linux | arm64 | ✅ | | Windows | x86_64 | ✅ | | Windows | arm64 | 🚫 | | macOS | x86_64 | ✅ | | macOS | arm64 | ✅ |
Windows arm64 support is blocked by Chocolatey not supporting arm64 natively.
Build Requirements
Linux
- Go 1.23
- Node 18+
- Python 3.12
- GCC
- CMake
- Git
macOS
- Go 1.23
- Node 18+
- Python 3.12
- Xcode Command Line Tools
- CMake
- Git
Windows
- Go 1.23
- Node 18+
- Python 3.12
- MinGW-w64 GCC
- CMake
- Git
API Reference
DatadogAgentBuilder
Main class for building Datadog Agent binaries.
Methods
buildForCurrentPlatform(options?): Build for the current platform
Options
interface BuildOptions {
version?: string; // Datadog Agent version (default: latest)
outputDir?: string; // Output directory (default: ./build)
sourceDir?: string; // Source directory (default: downloads source)
buildArgs?: string[]; // Additional build arguments
}Platform Detection
import { detectPlatform, getAllSupportedPlatforms } from '@harperdb/datadog-agent-binary';
const currentPlatform = detectPlatform();
const allPlatforms = getAllSupportedPlatforms();How It Works
Pre-built Binaries: When you install this package, it automatically downloads the appropriate Datadog Agent binary for your platform from GitHub releases.
Release Process:
- GitHub Actions builds binaries for all platforms from Datadog Agent source
- Binaries are packaged and uploaded to GitHub releases
- npm install downloads the right binary for your platform
Development
# Install dependencies
npm install
# Build the TypeScript package
npm run build
# Run type checking
npm run typecheck
# Build a single platform for testing
npm run build-platformLicense
Apache License 2.0
The binaries this package downloads, builds, and distributes are licensed and distributed under the Apache License 2.0 as specified in the Datadog Agent repository. The datadog-agent source code is copyrighted by Datadog, Inc.
