refactor(exporters): add shared EVP proxy utilities - #9738
Conversation
Overall package sizeSelf size: 8.2 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.3 | 125.43 kB | 445.14 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
🎉 All green!🧪 All tests passed 🔄 Datadog retried 1 test - 1 passed on retry 🔄 Datadog auto-retried 2 jobs - 0 passed on retry 🎯 Code Coverage (details) 🔗 Commit SHA: 6796798 | Docs | View more details | Give us feedback! |
BenchmarksBenchmark execution time: 2026-08-17 18:02:14 Comparing candidate commit 6796798 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2282 metrics, 10 unstable metrics.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9738 +/- ##
==========================================
- Coverage 98.53% 98.51% -0.02%
==========================================
Files 978 981 +3
Lines 144181 144349 +168
Branches 12936 13097 +161
==========================================
+ Hits 142068 142205 +137
- Misses 2113 2144 +31 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds a shared internal EVP proxy “route + discovery” contract under src/evp_proxy/ and migrates OpenFeature exposure delivery to use it, while leaving CI Visibility and LLMObs behavior unchanged (with TODO markers for future migration).
Changes:
- Introduces shared EVP proxy constants, path-joining helper, and
/info-based route discovery/selection logic. - Refactors OpenFeature Agent v2 exposure writer to accept/use a discovered or caller-supplied
{ url, basePath }route. - Adds unit tests for EVP proxy utilities and extends OpenFeature tests to cover route injection and propagation.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/dd-trace/test/openfeature/writers/util.spec.js | Adds coverage for OpenFeature’s agent strategy using shared EVP discovery. |
| packages/dd-trace/test/openfeature/writers/exposures.spec.js | Verifies writer can use a caller-supplied EVP route (no discovery). |
| packages/dd-trace/test/openfeature/index.spec.js | Ensures discovered route is passed through to the exposures writer. |
| packages/dd-trace/test/evp_proxy/path.spec.js | Adds tests for shared EVP proxy path joining behavior. |
| packages/dd-trace/test/evp_proxy/discovery.spec.js | Adds tests for EVP proxy discovery and path selection. |
| packages/dd-trace/test/evp_proxy/constants.spec.js | Adds tests for shared EVP proxy constants. |
| packages/dd-trace/src/openfeature/writers/util.js | Switches OpenFeature agent strategy to discoverEVPProxy() and returns route. |
| packages/dd-trace/src/openfeature/writers/exposures.js | Adds route support (constructor + setEnabled) and uses shared constants/path joiner. |
| packages/dd-trace/src/openfeature/index.js | Passes (hasAgent, route) into exposuresWriter.setEnabled(). |
| packages/dd-trace/src/openfeature/constants/constants.js | Removes OpenFeature-local EVP proxy constants now provided by shared module. |
| packages/dd-trace/src/llmobs/writers/util.js | Adds TODO hint to migrate to shared EVP proxy utilities later. |
| packages/dd-trace/src/llmobs/writers/base.js | Adds TODO hint for migrating EVP headers/subdomain to shared utilities later. |
| packages/dd-trace/src/evp_proxy/path.js | Adds shared helper to join proxy base path + product endpoint safely (trailing/leading slash normalization). |
| packages/dd-trace/src/evp_proxy/discovery.js | Adds shared discovery + selection logic based on Agent /info. |
| packages/dd-trace/src/evp_proxy/constants.js | Adds shared EVP proxy constants (paths + header + common subdomain). |
| packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js | Adds TODO hint to migrate EVP headers/subdomain to shared utilities later. |
| packages/dd-trace/src/ci-visibility/exporters/agent-proxy/index.js | Adds TODO hint to migrate to shared EVP utilities later. |
| package.json | Adds test:evp_proxy and includes EVP proxy tests in test:openfeature. |
| .github/CODEOWNERS | Adds ownership entries for new src/test/evp_proxy directories. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Add shared EVP protocol constants, route discovery, and path construction.\n\nRefactor the existing Feature Flags Agent path to use the shared utilities. Add migration pointers for CI Visibility and LLM Observability. Document the Agent-compatible receiver contract.
92d1d56 to
59ba684
Compare
There was a problem hiding this comment.
More details
The Agent’s actual /info contract matches the new normalization logic. A realistic discovery-to-delivery flow preserved the selected route, EVP subdomain header, buffered exposure, and serialized payload.
📊 Validated against 8 scenarios · Open Bits AI session
🤖 Datadog Autotest · Commit 59ba684 · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest
…proxy-utilities # Conflicts: # .github/CODEOWNERS
2849f0e
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2849f0e63d
ℹ️ 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".
Motivation
Our business goal is a simple, standalone Datadog OpenFeature client integration. Users must be able to send exposure events without a local receiver.
OpenFeature exposure delivery already uses
/infoto discover an EVP proxy. This path works when an Agent-compatible receiver is available. Today, discovery is required. Exposure delivery stops when no receiver answers/info. There is no direct fallback.Standalone mode needs a different contract. Route use must not depend on discovery. Discovery must be optional. A caller must also be able to provide a known route.
This PR adds that shared EVP contract. Feature Flags is the first consumer. The next PR, #9527, uses the contract for agentless delivery. It uses
serverless-initwhen available. It uses direct EVP when no receiver is available.Users can add
serverless-initlater if trace delivery requires it. Exposure delivery does not need to wait for that requirement.flowchart TB subgraph Current["This PR: current Agent mode"] Client["OpenFeature client"] --> Flags["Feature Flags"] Flags --> Writer["Exposure writer"] Info["Agent /info"] --> Discovery["EVP discovery"] Discovery --> Writer Writer --> Proxy["Agent EVP proxy v2"] Proxy --> Intake["Exposure intake"] end subgraph Next["Next PR: agentless mode"] Agentless["Agentless Feature Flags"] --> Serverless["serverless-init EVP"] Agentless --> Direct["Direct EVP fallback"] end Discovery -. "shared route contract" .-> Agentless style Next fill:transparent,stroke-dasharray:6 4Datadog provides setup guides for
serverless-initas a sidecar andserverless-initin the application container.Changes and Decisions
/infodiscovery for supported EVP proxy paths./inforequests and caching./infoas capability data. Do not use it to identify the receiver or test its health.Validation
system-testsmain17a45f60c: the Agent exposure suite passed with10 passed, 1 xfailed.dd-trace-js6bf1846c6: the same suite passed with10 passed, 1 xfailedafter this refactor.