-
Notifications
You must be signed in to change notification settings - Fork 20
feat: agent-level HTTP client #1806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
gh-worker-dd-mergequeue-cf854d
merged 56 commits into
main
from
yannham/apmsp-2722-agent-client-layer
Jun 3, 2026
Merged
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
631d593
feat: draft API for agent HTTP client component
yannham e4a16b6
Apply suggestion from @brettlangdon
yannham a264d1e
refactor: get rid of client mode, use boolean instead
yannham c35215f
refactor: get rid of agentless-specific parts of the API
yannham 9676582
doc: clean LLM logorrhea
yannham adab83b
implement: fill in all todo!() placeholders in libdd-agent-client
yannham c0fbf24
fix: address review findings
yannham f59fa47
refactor: get rid of ResolvedTransport
yannham 6d44589
refactor: clean the agent-client code a bit
yannham 8024de4
feat: add with_headers() method to http-client request
yannham 863b00b
style: formatting
yannham 573b9bf
refactor: split integration tests into per-topic files
yannham e44b1da
refactor: drop send_ prefix from test modules, flatten common to comm…
yannham 5b2cdd4
refactor: fold timeout_from_env + transport env-vars into auto_detect()
yannham b7d3e25
style: replace repeated fully-qualified paths with use imports in lib…
yannham be24a7f
style: inline single-use variables used immediately in the next call …
yannham 7b917a7
refactor: remove inline from builder, add one in other parts
yannham 1c20932
refactor: bespoke conversion method -> impl From instead
yannham d4d0e53
style: formatting
yannham b7d23f0
style: fix clippy warning (useless lifetime parameter)
yannham 27292a0
chore: add missing entries for new agent client crate
yannham 3d8e8bf
fix: fix outdated libdd-common dep version
yannham e9978f8
chore: update Cargo.lock
yannham dceb85d
fix: fix std import
yannham f0257da
chore: fix missing version for internal dep
yannham 0ca7eed
fix: confusion around keep-alive and connection pooling
yannham 13cdd22
feat: uniform, platform-independent auto_config() API
yannham 1ccd73a
refactor: get rid of auto_config silent get_var
yannham 5c7028c
fix: properly propagate allow_connection_pooling to underlying client
yannham 9020eab
tests: do not run http tests under Miri
yannham 4edca80
refactor: self-review pass
yannham 7f188fb
chore: expose libdd-http-client features
yannham 80b68cc
feat: add Https transport variant to AgentTransport
yannham fa5a7ff
fix: use proper truth value for header
yannham 532e960
fix: validate EVP path and error on missing /info endpoints
yannham 6b63d25
refactor: get rid of unused variant
yannham e77c166
chore: update to latest libdatadog deps
yannham 7b35d7f
chore: update Cargo.lock
yannham 33c0c46
chore: add agent-client to codecov and fix check_status doc comment
yannham 43588c9
feat: add client_computed_stats option and interpreter_vendor metadata
yannham df00436
feat: include DD_EXTERNAL_ENV in entity headers
yannham 82f5394
style: formatting
yannham 74c2575
refactor: re-export http-client error instead of string wrapping
yannham f8d4958
refactor: truncate the body in http error display
yannham 5d2fb41
refactor: get rid of custom default for RetryConfig
yannham e77f6ce
refactor: restrict module visibility, symbols already exported
yannham 8488ce0
doc: fix imprecise comment about fork safety
yannham 1a62e45
doc: remove outdated/inexact comment
yannham 71f711b
doc: remove wrong information from comment
yannham 0f89f3b
style: move literal to const variable
yannham 5a42cda
refactor: introduce EvpEventRequest struct for send_evp_event
yannham 5db0166
style: formatting
yannham 050f89f
fix: warn upon unparseable rate_by_service
yannham 789c0d3
chore: update to latest libdatadog version
yannham de881a2
style: format
yannham c1d0816
chore: update internal http-client version
yannham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # 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 = "A Datadog-agent-specialized HTTP client library" | ||
| 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 | ||
|
|
||
| [features] | ||
| default = ["https", "reqwest-backend"] | ||
| https = ["libdd-http-client/https"] | ||
| reqwest-backend = ["libdd-http-client/reqwest-backend"] | ||
| hyper-backend = ["libdd-http-client/hyper-backend"] | ||
|
|
||
| [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 = { version = "35.0", path = "../libdd-http-client", default-features = false } | ||
| libdd-common = { version = "4.0", path = "../libdd-common", default-features = false } | ||
| tracing = { version = "0.1", 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"] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| // 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 { | ||
|
yannham marked this conversation as resolved.
|
||
| /// 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. | ||
| 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 act | ||
| /// when it differs. | ||
| pub state_hash: Option<String>, | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.