feat: added environment capability [APMSP-3780] - #2239
Conversation
a1dfa1a to
baa79d4
Compare
🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 5fedbee | Docs | Datadog PR Page | Give us feedback! |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1dfa1a88f
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
9534a81 to
d3d3c25
Compare
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
BenchmarksComparisonBenchmark execution time: 2026-07-16 16:39:34 Comparing candidate commit 5fedbee in PR branch Found 7 performance improvements and 14 performance regressions! Performance is the same for 121 metrics, 0 unstable metrics.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bed4965e07
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
bed4965 to
27390d0
Compare
yannham
left a comment
There was a problem hiding this comment.
Besides the original motivation, I'm all for env capability: I think it's a step in the right direction to get rid of the get/set race conditions that have popped up in the past. Once everything uses the capability, we can silently switch to a different implementation - one that snapshots the environment at the beginning for example - which is much less prone to races.
However, I would remove set and unset from the API if they are not needed, or even would make them a compile time error. As mentioned in the Rust documentation and discussed extensively elsewhere, they're just impossible to get right in a multi-threaded environment, even within a pure Rust program, and I think we should just not use it. It's worse in libdatadog context, where we might interact with C and multiple other runtimes.
…nd of environment
|
Agreed after discussion that adding them to the full API like that is at least prematured, especially since we don't need it in JS either for now. Fundamentally I think it could be okay to have these methods solely in the JS side since the process should be single threaded etc, but the shape and way that ought to be done should not be part of this PR and should require discussions. The idea of having the capability for the environment snapshotting the starting environment and simulating the rest and being the single source of truth for it to work even in multithreaded things is interesting o/ |
yannham
left a comment
There was a problem hiding this comment.
Should we mention why we don't include set_var in the trait's documentation?
|
/merge |
|
View all feedbacks in Devflow UI.
This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
The expected merge time in
|
What does this PR do?
Added capability to read and write environment variables
Motivation
dd-trace-js needing to add info from the env in their requests, it's better to have libdatadog drive the call
Additional Notes
Nop
How to test the change?
check, tests, check for wasm32