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
- 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 implementationsentity_id: Container and entity ID detectionerror: Common error typesheader: Datadog HTTP headershttp_common: Hyper version migration helperstag: 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
std(default): Enable the standard-library-dependent utilitiesalloc: Enable allocation-backed tag creation and parsing withoutstdhttp-client: Enable the hyper-based HTTP client; impliesstdhttps(default): Enable HTTPS support with rustls; implieshttp-clientuse_webpki_roots: Use webpki roots instead of native certscgroup_testing: Enable cgroup stubbing for testingfips: Use FIPS-compliant cryptographic provider (Unix only)
TagParser and TagValidationError are available without feature flags. To use the allocation-backed
Tag from a no_std crate: