Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ members = [
"libdd-tinybytes",
"libdd-dogstatsd-client",
"libdd-http-client",
"libdd-agent-client",
"libdd-log",
"libdd-log-ffi",
]
Expand Down
32 changes: 32 additions & 0 deletions libdd-agent-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2026-Present Datadog, Inc. https://www.datadoghq.com/
# SPDX-License-Identifier: Apache-2.0

[package]
name = "libdd-agent-client"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
authors.workspace = true
description = "Datadog-agent-specialized HTTP client: language metadata injection, per-endpoint send methods, retry, and compression"
homepage = "https://github.com/DataDog/libdatadog/tree/main/libdd-agent-client"
repository = "https://github.com/DataDog/libdatadog/tree/main/libdd-agent-client"

[lib]
bench = false

[dependencies]
bytes = "1.4"
flate2 = "1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
thiserror = "2"
tokio = { version = "1.23", features = ["rt"] }
libdd-http-client = { path = "../libdd-http-client" }
libdd-common = { version = "3.0.2", path = "../libdd-common", default-features = false }

[dev-dependencies]
httpmock = "0.8.0-alpha.1"
rustls = { version = "0.23", default-features = false, features = ["ring"] }
serial_test = "3.2"
tokio = { version = "1.23", features = ["rt", "macros"] }
30 changes: 30 additions & 0 deletions libdd-agent-client/src/agent_info.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright 2026-Present Datadog, Inc. https://www.datadoghq.com/
// SPDX-License-Identifier: Apache-2.0

//! Types for [`crate::AgentClient::agent_info`].

/// Parsed response from a `GET /info` probe.
///
/// Returned by [`crate::AgentClient::agent_info`]. Contains agent capabilities and headers.
#[derive(Debug, Clone)]
pub struct AgentInfo {
/// Available agent endpoints, e.g. `["/v0.4/traces", "/v0.5/traces"]`.
pub endpoints: Vec<String>,
/// Whether the agent supports client-side P0 dropping.
pub client_drop_p0s: bool,
/// Raw agent configuration block.
pub config: serde_json::Value,
/// Agent version string, if reported.
pub version: Option<String>,
/// Parsed from the `Datadog-Container-Tags-Hash` response header.
///
/// Used by dd-trace-py to compute the base tag hash (`agent.py:17-23`).
pub container_tags_hash: Option<String>,
/// Value of the `Datadog-Agent-State` response header from the last `/info` fetch.
///
/// The agent updates this opaque token whenever its internal state changes (e.g. a
/// configuration reload). Clients that poll `/info` periodically can skip re-parsing
/// the response body by comparing this value to the one returned by the previous call
/// and only acting when it differs.
pub state_hash: Option<String>,
}
Loading
Loading