Skip to content

Paullgdc/test rc agentless - #263

Draft
paullegranddc wants to merge 7 commits into
mainfrom
paullgdc/test_rc_agentless
Draft

Paullgdc/test rc agentless#263
paullegranddc wants to merge 7 commits into
mainfrom
paullgdc/test_rc_agentless

Conversation

@paullegranddc

Copy link
Copy Markdown
Collaborator

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?

iunanua and others added 5 commits June 9, 2026 17:23
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>
@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Jun 22, 2026

Copy link
Copy Markdown

Pipelines

Unblock PR with BitsAI

⚠️ Warnings

🚦 24 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-rs | validate_supported_configurations_v2_local_file   View in Datadog   GitLab

Lint | clippy #ubuntu-latest stable   View in Datadog   GitHub Actions

🔧 Fix in code. This looks caused by changes in this PR. Failed to load source for dependency `libdd-remote-config`: No such file or directory (os error 2) when accessing Cargo.toml

Lint | rustfmt   View in Datadog   GitHub Actions

🔧 Fix in code. This looks caused by changes in this PR. Compilation error in remote_config.rs:523: expected ';', found '{'

View all 24 failed jobs.

📋 Copy prompt for your agent
CI on my pull request is failing. Help me find and fix the root cause of each failing job below — they were flagged as caused by changes in this PR, so focus on the diff. For each job, explain the failure and propose a fix.

Branch: paullgdc/test_rc_agentless

Lint | clippy #ubuntu-latest stable
Commit: b223b5049e4ea4b04c76ae76ea50d514dc6bd8b9
Error (code / build):
Failed to load source for dependency `libdd-remote-config`: No such file or directory (os error 2) when accessing Cargo.toml
CI job: https://github.com/DataDog/dd-trace-rs/actions/runs/31718294991/job/94508535941

Lint | rustfmt
Commit: b223b5049e4ea4b04c76ae76ea50d514dc6bd8b9
Error (code / build):
Compilation error in remote_config.rs:523: expected ';', found '{'
CI job: https://github.com/DataDog/dd-trace-rs/actions/runs/31718294991/job/94508535676

Plus 4 more failing jobs not shown here.

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b223b50 | Docs | Datadog PR Page | Give us feedback!

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants