libdd-common
Common utilities and foundational components shared across Datadog telemetry libraries.
Overview
libdd-common provides shared functionality used across multiple Datadog Rust libraries including HTTP client support, entity ID detection, tag handling, and platform-specific utilities.
Features
- HTTP/HTTPS Client: Async HTTP client built on hyper with rustls support
- Entity ID Detection: Automatic container ID and entity ID detection from cgroups, Docker, Kubernetes, and Azure App Services
- Tag Management: Compile-time validated tags with the
tag!macro - URI Parsing: Special handling for Unix sockets, Windows named pipes, and file URIs
- Rate Limiting: Token bucket rate limiter implementation
- Platform Utilities: Unix-specific utilities for fork, exec, and process management
- Datadog Headers: Standard Datadog HTTP headers and constants
- Timeout Support: Configurable timeouts for HTTP requests
- Worker Abstraction: Generic worker pattern for background tasks
Modules
azure_app_services: Azure App Services integrationconfig: Configuration utilitiesconnector: HTTP/HTTPS connector implementationscstr: C string utilities and macrosentity_id: Container and entity ID detectionerror: Common error typesheader: Datadog HTTP headershttp_common: Hyper version migration helpersrate_limiter: Rate limiting implementationtag: Tag creation and validationtimeout: Timeout utilitiesunix_utils: Unix-specific process utilitiesworker: Background worker abstraction
Examples
Creating tags
use tag;
// Compile-time validated tag
let tag1 = tag!;
// Runtime tag creation
use Tag;
let tag2 = new?;
Entity ID detection
use entity_id;
if let Some = get_container_id
Features Flags
https(default): Enable HTTPS support with rustlsuse_webpki_roots: Use webpki roots instead of native certscgroup_testing: Enable cgroup stubbing for testingfips: Use FIPS-compliant cryptographic provider (Unix only)