Skip to content

Add Remote config FFI - #60

Open
bwoebi wants to merge 5 commits into
mainfrom
bob/remote-config
Open

bwoebi wants to merge 5 commits into
mainfrom
bob/remote-config

Conversation

@bwoebi

@bwoebi bwoebi commented Oct 14, 2026

Copy link
Copy Markdown

Add a FFI wrapper for remote-config.

There are some parts to the FFI logic which are specific to the dotnet environment, like storing the parsed files in Arc<Vec>, to keep it alive as long as dotnet might access it.
Or the strategy with block_on, and having an extra DNS thread.
This might be improved once we have a proper runtime for dotnet, but as is, this is a bit tied to dotnet and hence not a dedicated libdd-remote-config-ffi crate.

Future improvements could want to share the native tracer across app domains as well, to reduce agent traffic.
At the point where we add native rust code, the build gets also adjusted to take it from there instead of a bare LIBDATADOG_VERSION.

bwoebi and others added 3 commits October 12, 2026 16:38
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shipped library is now built from datadog-dotnet-ffi: libdatadog's
profiling FFI (same features as the builder) plus a remote configuration
client for dd-trace-dotnet (ddog_rc_*), keeping the library names.
The libdatadog revision is pinned by the git dependencies of
datadog-dotnet-ffi only. The builder is installed from cargo's checkout
of them (tools/libdatadog.sh), so the headers and static libraries match
the shipped library; --libdatadog-path patches them to a local checkout.

datadog-dotnet-ffi gets its own target directory: some libdatadog crates
have library file names without a hash, which the builder's and our
build overwrote for each other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bwoebi
bwoebi requested a review from a team as a code owner October 14, 2026 15:02
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T15:12:45.918713Z ae38177 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@datadog-official datadog-official Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: FAIL

Custom feature selections can produce packages whose headers advertise APIs missing from the replacement shared library, causing consumer link or symbol-resolution failures.

Open Bits AI session

🤖 Bits Code Review · Commit ae38177

libdd-remote-config = { git = "https://github.com/DataDog/libdatadog", rev = "6851293707e6b777b0dde428a13940b2293a8434", default-features = false, features = ["client"] }
# Must be the feature list the libdatadog builder computes for the libdatadog-dotnet builder
# features (profiling,crashtracker,symbolizer,library-config), see builder/src/features.rs.
libdd-profiling-ffi = { git = "https://github.com/DataDog/libdatadog", rev = "6851293707e6b777b0dde428a13940b2293a8434", default-features = false, features = [

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Preserve requested features in the replacement shared library

With custom selections such as --features profiling,telemetry or Windows -Features, the builder generates headers for the requested APIs, but the replacement shared library always uses this fixed feature list. Consumers calling those additional APIs consequently fail to link or resolve symbols. Preserve feature selection by exposing corresponding crate features and forwarding the selected features through both Unix and Windows replacement builds; this requires a multi-file fix.

React: 👍 useful · 👎 wrong · 😕 unclear · 👀 right, but not acting on it

What each reaction means
  • 👍 Useful: correct, and you're fixing it or will.
  • 👎 Wrong: the finding is incorrect, for example the bug can't happen or the code was misread.
  • 😕 Unclear: you can't tell what it means or why it matters.
  • 👀 Right, not acting: correct, but intended, out of scope for this PR, a known risk, or too minor.

🤖 Bits Code Review · Open Bits AI session

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae38177198

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread datadog-dotnet-ffi/Cargo.toml Resolved
Comment thread datadog-dotnet-ffi/Cargo.toml Resolved
bwoebi and others added 2 commits October 14, 2026 20:30
The client must not be used by multiple threads at once, and takes &mut.
A fetch can be cancelled from another thread with libdatadog's
ddog_CancellationToken API, instead of the client's own token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shipped library is built with the committed Cargo.lock (--locked),
which starts from libdatadog's lock at the pinned revision, instead of
copying libdatadog's lock at build time.

The builder features are no longer configurable (--features, -Features,
workflow input): the shared library is built with the matching fixed
libdd-profiling-ffi features, so other selections produced headers for
APIs the library lacks. The bump skill updates Cargo.lock and the
crate's rust-version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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