Paullgdc/test rc agentless - #263
Draft
paullegranddc wants to merge 7 commits into
Draft
Conversation
Replaces the in-tree RC client (hyper poller, hand-rolled TUF parsing, base64/SHA256 caching, ConfigState bookkeeping, custom ProductRegistry, path extraction) with a thin adapter over libdd-remote-config's SingleChangesFetcher. The ApmTracingConfig parser is preserved verbatim and registered through the RemoteConfigContent trait, so all parser semantics (null-vs-missing distinction, [0.0, 1.0] rate validation, service_target gating, rules/rate composition, default-provenance catch-all) are unchanged. libdd-remote-config is pinned to libdatadog rev 2e6214d80 via git + [patch.crates-io] for libdd-common and libdd-trace-protobuf, so existing libdd-* version pins on crates.io stay intact. Drop now-unused deps (base64, sha2, hyper-util, http-body-util) and add libdd-remote-config/https to the local https feature. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
gh-worker-dd-mergequeue-cf854d Bot
pushed a commit
to DataDog/libdatadog
that referenced
this pull request
Aug 13, 2026
# Motivation
In some environments (serverless, Datadog studio), tracers can't rely on a Datadog Agent to proxy Remote Config requests. This PR adds an agentless mode to libdd-remote-config so the fetcher can talk directly to the RC backend, mirroring what the Go agent does today.
The protocol is different from the agent's /v0.7/config: the backend speaks protobuf and ships raw TUF metadata + target files that the client must verify locally. This means embedding TUF trust roots per site and running a full Uptane-style validation on every poll.
# Changes
- Add a new AgentlessFetcher in libdd-remote-config/src/fetch/agentless.rs:
- TUF verification of director + config repositories using rust-tuf (DataDog fork of the library).
- Embedded trust roots for prod, staging and gov, selected from the endpoint host. Roots can also be overridden from disk via AgentlessConfig.
- Hash + length verification of every target against TUF-validated metadata before exposing it to the caller.
- Plug agentless mode into the existing ConfigFetcher:
- New AgentlessConfig. When set the fetcher dispatches to AgentlessFetcher instead of the agent HTTP path. Invalid configs (empty hostname, non-https endpoint, no API key) downgrade to agent mode with log.
- ConfigFetcher::new is now async since TUF root loading is async. The agent-only path is still immediate.
- Propagate the server-recommended refresh interval through ConfigClientState and into the SharedFetcher run loop.
- Update the remote_config_fetch example to switch to agentless when DD_API_KEY + DD_SITE are set.
# Additional Notes
Eventually this implementation could be extracted to be it's own crate and we could reuse it in other projects that need a rust client.
For this reason, the `agentless.rs` module which contains the most of the implementation tries to encapsulate what is "RC agentless" and what is specific to the RC client in libdatadog.
This is why the caching of target files is done in a wrapper type. This cache is currently quite complex as it permits storing files in shared memory for instance.
Currently this implementation is a simplification of the agent code in two ways:
* fetches data for only __one__ active client, which is also a simplification compared to what the agent does
* does not control the polling loop but instead returns a refresh interval parameter which the users of the library should respect.
# How to test the change?
```
DD_API_KEY=... DD_SITE=datadoghq.com \
cargo run -p libdd-remote-config --example remote_config_fetch
```
Also this has been tested in dd-trace-rs
DataDog/dd-trace-rs#263
Co-authored-by: bwoebi <bob.weinand@datadoghq.com>
Co-authored-by: paul.legranddescloizeaux <paul.legranddescloizeaux@datadoghq.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
A brief description of the change being made with this pull request.
Motivation
What inspired you to submit this pull request?
Additional Notes
Anything else we should know when reviewing?