3 stable releases
| 2.0.0 | Feb 25, 2026 |
|---|---|
| 1.1.0 | Jan 21, 2026 |
| 1.0.0 | Nov 17, 2025 |
#711 in Network programming
213,225 downloads per month
Used in 10 crates
(8 directly)
210KB
4K
SLoC
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 libdd_common::tag;
// Compile-time validated tag
let tag1 = tag!("service", "my-service");
// Runtime tag creation
use libdd_common::tag::Tag;
let tag2 = Tag::new("env", "production")?;
Entity ID detection
use libdd_common::entity_id;
if let Some(container_id) = entity_id::get_container_id() {
println!("Running in container: {}", 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)
Dependencies
~14–52MB
~1M SLoC