Skip to content

feat(openfeature): add exposure route fallback - #9740

Merged
leoromanovsky merged 5 commits into
masterfrom
agent/openfeature-exposure-route-fallback
Aug 18, 2026
Merged

feat(openfeature): add exposure route fallback#9740
leoromanovsky merged 5 commits into
masterfrom
agent/openfeature-exposure-route-fallback

Conversation

@leoromanovsky

Copy link
Copy Markdown
Contributor

Stacked on #9739.

Motivation

Our business goal is to make OpenFeature client integration simple. Exposure delivery must support local and direct EVP routes.

The exposure writer currently supports one local route. It cannot use direct intake or recover from definitive local rejection.

Changes and Decisions

  • Let the exposure writer use local EVP and authenticated direct EVP routes.
  • Retry through direct intake after connection refusal or HTTP 403, 404, or 405.
  • Do not retry through another route after resets, timeouts, HTTP 429, or server errors.
  • Use direct intake for later batches after a definitive local rejection.
  • Preserve the existing buffer, payload sizing, and flush timing.

@dd-octo-sts

dd-octo-sts Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 8.25 MB
Deduped: 8.91 MB
No deduping: 8.91 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

@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Aug 9, 2026

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 98.55% (+0.37%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 48a3c78 | Docs | View more details | Give us feedback!

@pr-commenter

pr-commenter Bot commented Aug 9, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-18 21:57:42

Comparing candidate commit 48a3c78 in PR branch agent/openfeature-exposure-route-fallback with baseline commit 6f638b1 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2285 metrics, 7 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:appsec-iast-no-vulnerability-iast-enabled-default-config-20

  • unstable max_rss_usage [-17.365MB; +23.273MB] or [-7.195%; +9.643%]

scenario:appsec-iast-with-vulnerability-iast-enabled-default-config-20

  • unstable max_rss_usage [-30.176MB; +11.983MB] or [-8.003%; +3.178%]

scenario:debugger-line-probe-without-snapshot-24

  • unstable max_rss_usage [-13983.039KB; +14329.439KB] or [-4.941%; +5.063%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-425.588ms; +193.959ms] or [-9.080%; +4.138%]
  • unstable execution_time [-421.526ms; +194.228ms] or [-8.854%; +4.080%]
  • unstable throughput [-66731.505op/s; +151979.352op/s] or [-3.790%; +8.632%]

scenario:plugin-graphql-long-with-depth-and-collapse-off-20

  • unstable max_rss_usage [-27.807MB; +30.327MB] or [-6.919%; +7.546%]

@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.54%. Comparing base (6f638b1) to head (48a3c78).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9740      +/-   ##
==========================================
+ Coverage   98.17%   98.54%   +0.37%     
==========================================
  Files         981      982       +1     
  Lines      144762   144966     +204     
  Branches    12478    12845     +367     
==========================================
+ Hits       142118   142860     +742     
+ Misses       2644     2106     -538     
Flag Coverage Δ
aiguard 57.18% <ø> (-0.03%) ⬇️
aiguard-integration 55.25% <ø> (ø)
apm-bucket-0 57.35% <ø> (-0.03%) ⬇️
apm-bucket-1 62.52% <ø> (-0.93%) ⬇️
apm-bucket-2 61.34% <ø> (+2.79%) ⬆️
apm-bucket-3 58.99% <ø> (?)
apm-capabilities-tracing 62.20% <45.68%> (-0.03%) ⬇️
apm-integrations-aerospike 55.06% <ø> (-0.03%) ⬇️
apm-integrations-confluentinc-kafka-javascript 60.33% <ø> (+<0.01%) ⬆️
apm-integrations-couchbase 55.94% <ø> (-0.03%) ⬇️
apm-integrations-http 61.10% <ø> (-0.02%) ⬇️
apm-integrations-kafkajs 60.84% <ø> (-0.03%) ⬇️
apm-integrations-next 58.61% <ø> (-0.03%) ⬇️
apm-integrations-prisma 58.07% <ø> (-0.02%) ⬇️
apm-integrations-tedious ?
appsec 71.19% <ø> (-0.02%) ⬇️
appsec-express_fastify_graphql 68.63% <ø> (-0.02%) ⬇️
appsec-integration 49.51% <ø> (-0.01%) ⬇️
appsec-kafka_ldapjs_lodash 62.60% <ø> (-0.02%) ⬇️
appsec-mongodb-core_mongoose_mysql 66.09% <ø> (-0.02%) ⬇️
appsec-next 56.03% <ø> (-0.02%) ⬇️
appsec-node-serialize_passport_postgres 65.50% <ø> (-0.02%) ⬇️
appsec-sourcing_stripe_template 63.94% <ø> (-0.02%) ⬇️
debugger 63.38% <ø> (-0.04%) ⬇️
instrumentations-bucket-0 51.01% <ø> (-0.03%) ⬇️
instrumentations-bucket-1 58.85% <ø> (-0.03%) ⬇️
instrumentations-bucket-10 60.12% <ø> (-0.02%) ⬇️
instrumentations-bucket-11 60.77% <ø> (-0.02%) ⬇️
instrumentations-bucket-12 50.92% <ø> (-0.03%) ⬇️
instrumentations-bucket-13 51.78% <ø> (-0.03%) ⬇️
instrumentations-bucket-14 51.03% <ø> (-0.03%) ⬇️
instrumentations-bucket-2 52.26% <ø> (-0.03%) ⬇️
instrumentations-bucket-3 52.90% <ø> (-0.03%) ⬇️
instrumentations-bucket-4 57.94% <ø> (-0.03%) ⬇️
instrumentations-bucket-5 48.64% <ø> (-0.02%) ⬇️
instrumentations-bucket-6 59.44% <ø> (-0.03%) ⬇️
instrumentations-bucket-7 51.22% <ø> (-0.03%) ⬇️
instrumentations-bucket-8 57.66% <ø> (-0.02%) ⬇️
instrumentations-bucket-9 56.51% <ø> (-0.03%) ⬇️
instrumentations-instrumentation-couchbase 49.80% <ø> (-0.03%) ⬇️
instrumentations-integration-esbuild 33.86% <ø> (ø)
llmobs-ai_anthropic_bedrock 62.05% <ø> (-0.02%) ⬇️
llmobs-bucket-1 60.58% <ø> (-0.02%) ⬇️
llmobs-openai 61.25% <ø> (-0.02%) ⬇️
llmobs-openai-agents_vertex-ai 59.30% <ø> (-0.02%) ⬇️
llmobs-sdk 67.50% <ø> (-0.03%) ⬇️
master-coverage 98.54% <100.00%> (?)
openfeature 55.17% <79.69%> (+0.08%) ⬆️
openfeature-unit 53.11% <100.00%> (+0.16%) ⬆️
platform-core_esbuild_instrumentations-misc 40.79% <ø> (-0.02%) ⬇️
platform-integration 59.66% <ø> (ø)
platform-shimmer_unit-guardrails_webpack 38.44% <ø> (-0.02%) ⬇️
plugins-browser-bunyan_bullmq_cassandra 60.73% <ø> (-0.03%) ⬇️
plugins-bucket-0 56.19% <ø> (-0.02%) ⬇️
plugins-bucket-1 53.31% <ø> (ø)
plugins-bucket-11 61.11% <ø> (-0.02%) ⬇️
plugins-bucket-18 60.68% <ø> (-0.02%) ⬇️
plugins-bucket-19 58.91% <ø> (-0.03%) ⬇️
plugins-bucket-20 60.82% <ø> (-0.02%) ⬇️
plugins-bucket-4 55.55% <ø> (-0.03%) ⬇️
plugins-cookie_cookie-parser_crypto 50.54% <ø> (-0.03%) ⬇️
plugins-fastify_fetch_fs 59.76% <ø> (-0.02%) ⬇️
plugins-generic-pool_google-cloud-pubsub_grpc 63.29% <ø> (-0.02%) ⬇️
plugins-handlebars_hapi_hono 57.78% <ø> (-0.03%) ⬇️
plugins-ioredis_knex_langgraph 56.25% <ø> (-0.03%) ⬇️
plugins-ldapjs_light-my-request_limitd-client 57.47% <ø> (-0.03%) ⬇️
plugins-lodash_mariadb_memcached 57.18% <ø> (-0.03%) ⬇️
plugins-moleculer_mongodb_mongodb-core 60.60% <ø> (-0.03%) ⬇️
plugins-mongoose_multer_mysql 58.46% <ø> (-0.02%) ⬇️
plugins-mysql2_nats_node-serialize 60.07% <ø> (-0.03%) ⬇️
plugins-opensearch_passport-http_pino 58.33% <ø> (-0.03%) ⬇️
plugins-postgres_process_pug 57.48% <ø> (-0.03%) ⬇️
plugins-redis_router_sequelize 60.68% <ø> (-0.03%) ⬇️
plugins-test-and-upstream-rhea_undici_url 60.27% <ø> (-0.02%) ⬇️
plugins-valkey_vm_winston 56.91% <ø> (-0.03%) ⬇️
plugins-ws 58.45% <ø> (-0.03%) ⬇️
profiling 60.87% <ø> (-0.02%) ⬇️
serverless-aws-sdk-aws-sdk 54.19% <ø> (-0.02%) ⬇️
serverless-aws-sdk-base-inject-field 50.25% <ø> (-0.03%) ⬇️
serverless-aws-sdk-bedrockruntime 53.96% <ø> (-0.02%) ⬇️
serverless-aws-sdk-client 55.46% <ø> (-0.02%) ⬇️
serverless-aws-sdk-dynamodb 54.78% <ø> (-0.02%) ⬇️
serverless-aws-sdk-eventbridge 56.26% <ø> (-0.02%) ⬇️
serverless-aws-sdk-kinesis 58.29% <ø> (-0.02%) ⬇️
serverless-aws-sdk-lambda 56.48% <ø> (-0.02%) ⬇️
serverless-aws-sdk-s3 54.87% <ø> (-0.02%) ⬇️
serverless-aws-sdk-serverless-peer-service 58.86% <ø> (-0.02%) ⬇️
serverless-aws-sdk-sns 59.07% <ø> (-0.02%) ⬇️
serverless-aws-sdk-sqs 59.48% <ø> (-0.02%) ⬇️
serverless-aws-sdk-stepfunctions 54.70% <ø> (-0.02%) ⬇️
serverless-aws-sdk-util 50.76% <ø> (-0.03%) ⬇️
serverless-bucket-0 52.93% <ø> (ø)
serverless-bucket-1 58.09% <ø> (-0.03%) ⬇️
test-optimization-cucumber 70.31% <ø> (+0.02%) ⬆️
test-optimization-cypress 64.49% <ø> (+0.07%) ⬆️
test-optimization-jest 71.70% <ø> (-0.01%) ⬇️
test-optimization-mocha 71.75% <ø> (+0.04%) ⬆️
test-optimization-playwright-playwright-atr 59.30% <ø> (+0.01%) ⬆️
test-optimization-playwright-playwright-efd 59.51% <ø> (+0.07%) ⬆️
test-optimization-playwright-playwright-final-status 59.61% <ø> (-0.02%) ⬇️
test-optimization-playwright-playwright-impacted-tests 59.24% <ø> (+0.22%) ⬆️
test-optimization-playwright-playwright-reporting 60.63% <ø> (-0.04%) ⬇️
test-optimization-playwright-playwright-test-management 60.10% <ø> (-0.11%) ⬇️
test-optimization-playwright-playwright-test-span 59.34% <ø> (-0.05%) ⬇️
test-optimization-selenium 58.58% <ø> (-0.13%) ⬇️
test-optimization-testopt 57.25% <ø> (+0.07%) ⬆️
test-optimization-vitest 72.43% <ø> (+0.04%) ⬆️
test-optimization-vitest-browser 58.42% <ø> (+<0.01%) ⬆️
test-optimization-webdriverio 64.64% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@leoromanovsky
leoromanovsky marked this pull request as ready for review August 10, 2026 00:24
@leoromanovsky
leoromanovsky requested a review from a team as a code owner August 10, 2026 00:24
@leoromanovsky
leoromanovsky requested review from btthomas and vjfridge and removed request for a team August 10, 2026 00:24

@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: 7e1d04db31

ℹ️ 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 packages/dd-trace/src/openfeature/writers/exposures.js
Comment thread packages/dd-trace/src/openfeature/writers/base.js
Comment thread packages/dd-trace/src/openfeature/writers/base.js Outdated
sameerank
sameerank previously approved these changes Aug 18, 2026

@sameerank sameerank left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree with some of the bot feedback, so please fix before merging

Comment thread packages/dd-trace/src/openfeature/writers/base.js
Comment thread packages/dd-trace/src/openfeature/writers/base.js Outdated
Comment thread packages/dd-trace/test/openfeature/writers/exposures.spec.js
@leoromanovsky
leoromanovsky dismissed sameerank’s stale review August 18, 2026 16:33

The merge-base changed after approval.

@leoromanovsky
leoromanovsky requested review from a team as code owners August 18, 2026 16:33
@leoromanovsky
leoromanovsky force-pushed the agent/openfeature-exposure-route-fallback branch from 7e1d04d to 793a83f Compare August 18, 2026 16:33
Base automatically changed from agent/evp-direct-intake-route to master August 18, 2026 17:29
@leoromanovsky
leoromanovsky force-pushed the agent/openfeature-exposure-route-fallback branch from 793a83f to 77e55eb Compare August 18, 2026 17:29

@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: 77e55eb616

ℹ️ 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 packages/dd-trace/src/openfeature/writers/base.js

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Wire the direct route into strategy selection

Direct-only exposure delivery and fallback after local ECONNREFUSED/403/404/405 do not work for normal clients.

Assertion details
  • Input: Enable OpenFeature with a valid API key and site, then either have no supported local EVP route or receive a definitive rejection from the local route.
  • Expected: OpenFeature strategy selection should construct the authenticated direct route, use it when no local route exists, and attach it as the local route's fallback. Tests should exercise this through normal OpenFeature initialization.
  • Actual: createDirectEVPRoute is added but never called. Production initialization still only discovers a local route and disables the writer when discovery fails; it never supplies the fallback that the new retry logic requires. Existing fallback tests manually inject this otherwise-unreachable route shape.

Was this helpful? React 👍 or 👎
🤖 Datadog Autotest · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@datadog-prod-us1-6 datadog-prod-us1-6 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.

Datadog Autotest: FAIL

The added direct-EVP route factory is never called by OpenFeature initialization, so normal clients neither deliver directly when local discovery fails nor retry definitive local rejections through direct intake.

Open Bits AI session

🤖 Datadog Autotest · Commit 793a83f · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@leoromanovsky
leoromanovsky removed request for a team August 18, 2026 17:35
@leoromanovsky

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback @sameerank . I pushed these changes:

  • Exposure delivery is best-effort at-least-once, and downstream intake must tolerate duplicates. I kept transport retries enabled explicitly. The ENOENT and route-switching fixes remain.
  • Added direct fallback for missing Unix sockets (ENOENT).
  • Added tests for each case.

Production route selection is implemented in the stacked PR #9741. It selects EVP v4, EVP v2, or authenticated direct intake through normal OpenFeature initialization.

I also verified that one provider evaluation sends exactly one exposure. The 405 fallback sends the same payload once through direct intake, with the API key only on the direct request.

sameerank
sameerank previously approved these changes Aug 18, 2026

@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: 65047b4ec6

ℹ️ 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 packages/dd-trace/src/openfeature/writers/base.js Outdated
Comment thread packages/dd-trace/src/openfeature/writers/base.js
@leoromanovsky
leoromanovsky merged commit 200d52a into master Aug 18, 2026
733 of 736 checks passed
@leoromanovsky
leoromanovsky deleted the agent/openfeature-exposure-route-fallback branch August 18, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants