Skip to content

fix(openfeature): keep provider stable across RC updates#9359

Closed
sameerank wants to merge 1 commit into
masterfrom
sameerank/openfeature-provider-singleton
Closed

fix(openfeature): keep provider stable across RC updates#9359
sameerank wants to merge 1 commit into
masterfrom
sameerank/openfeature-provider-singleton

Conversation

@sameerank

@sameerank sameerank commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Keep tracer.openfeature stable after the real FlaggingProvider is installed. The OpenFeature registration now skips recreating the provider during later tracing reconfiguration while still enabling the OpenFeature module.

Motivation

I ran into this issue in https://github.com/DataDog/ffe-dogfooding/pull/94 where the provider appeared stuck in a not-ready state.

Apps can bind OpenFeature to tracer.openfeature before Remote Config delivers flag configuration. A later APM_TRACING Remote Config update reran #updateTracing(), recreated tracer.openfeature, and caused FFE_FLAGS updates to target the new provider while the app remained bound to the old one. That left the bound provider without configuration and required app-level polling such as waitForTracerOpenFeatureProvider (see example here).

This keeps the provider instance that OpenFeature binds to as the same instance that receives FFE_FLAGS configuration updates.

Additional Notes

Validated with:

  • ./node_modules/.bin/mocha packages/dd-trace/test/proxy.spec.js
  • npm run test:openfeature
  • targeted ESLint on the touched files

Full npm run lint -- ... currently stops before ESLint because the local vendor/node_modules tree has existing invalid dependency versions reported by the license check.

@dd-octo-sts

dd-octo-sts Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 6.77 MB
Deduped: 7.42 MB
No deduping: 7.42 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.1 | 122.62 kB | 438.86 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-official

datadog-official Bot commented Jul 14, 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: 96.61% (+0.00%)

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

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.64%. Comparing base (1abef82) to head (35d627f).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9359   +/-   ##
=======================================
  Coverage   96.64%   96.64%           
=======================================
  Files         923      923           
  Lines      122844   122860   +16     
  Branches    20989    21055   +66     
=======================================
+ Hits       118723   118741   +18     
+ Misses       4121     4119    -2     
Flag Coverage Δ
aiguard 53.64% <44.44%> (-0.06%) ⬇️
aiguard-integration 57.10% <44.44%> (-0.01%) ⬇️
apm-bucket-0 53.88% <44.44%> (-0.06%) ⬇️
apm-bucket-1 58.45% <44.44%> (-0.05%) ⬇️
apm-bucket-2 56.17% <44.44%> (-0.05%) ⬇️
apm-capabilities-tracing 60.62% <44.44%> (-0.01%) ⬇️
apm-integrations-aerospike 53.03% <44.44%> (-0.06%) ⬇️
apm-integrations-confluentinc-kafka-javascript 57.11% <44.44%> (-0.12%) ⬇️
apm-integrations-couchbase 53.36% <44.44%> (-0.06%) ⬇️
apm-integrations-http 58.04% <44.44%> (-0.05%) ⬇️
apm-integrations-kafkajs 57.82% <44.44%> (-0.06%) ⬇️
apm-integrations-next 54.25% <44.44%> (-0.05%) ⬇️
apm-integrations-prisma 54.25% <44.44%> (-0.05%) ⬇️
apm-integrations-tedious 53.13% <44.44%> (-0.05%) ⬇️
appsec 68.91% <44.44%> (+<0.01%) ⬆️
appsec-express_fastify_graphql 65.72% <44.44%> (-0.05%) ⬇️
appsec-integration 51.95% <44.44%> (+<0.01%) ⬆️
appsec-kafka_ldapjs_lodash 59.17% <44.44%> (-0.05%) ⬇️
appsec-mongodb-core_mongoose_mysql 62.39% <44.44%> (-0.05%) ⬇️
appsec-next 52.88% <44.44%> (-0.05%) ⬇️
appsec-node-serialize_passport_postgres 62.04% <44.44%> (-0.05%) ⬇️
appsec-sourcing_stripe_template 60.43% <44.44%> (-0.05%) ⬇️
debugger 65.68% <72.22%> (-0.04%) ⬇️
instrumentations-bucket-0 48.88% <44.44%> (-0.05%) ⬇️
instrumentations-bucket-1 55.08% <44.44%> (-0.05%) ⬇️
instrumentations-bucket-10 56.70% <44.44%> (-0.05%) ⬇️
instrumentations-bucket-11 48.87% <44.44%> (-0.05%) ⬇️
instrumentations-bucket-12 49.04% <44.44%> (-0.05%) ⬇️
instrumentations-bucket-13 48.81% <44.44%> (-0.05%) ⬇️
instrumentations-bucket-2 50.02% <44.44%> (-0.05%) ⬇️
instrumentations-bucket-3 53.99% <44.44%> (-0.05%) ⬇️
instrumentations-bucket-4 49.29% <44.44%> (-0.05%) ⬇️
instrumentations-bucket-5 53.15% <44.44%> (-0.05%) ⬇️
instrumentations-bucket-6 55.72% <44.44%> (-0.06%) ⬇️
instrumentations-bucket-7 53.62% <44.44%> (-0.05%) ⬇️
instrumentations-bucket-8 54.76% <44.44%> (-0.05%) ⬇️
instrumentations-bucket-9 56.19% <44.44%> (-0.05%) ⬇️
instrumentations-instrumentation-couchbase 48.27% <44.44%> (-0.06%) ⬇️
instrumentations-integration-esbuild 34.07% <44.44%> (+<0.01%) ⬆️
llmobs-ai_anthropic_bedrock 57.77% <44.44%> (-0.05%) ⬇️
llmobs-bucket-1 57.10% <44.44%> (-0.04%) ⬇️
llmobs-openai 57.50% <44.44%> (-0.05%) ⬇️
llmobs-sdk 60.06% <44.44%> (-0.06%) ⬇️
llmobs-vertex-ai 54.31% <44.44%> (-0.05%) ⬇️
master-coverage 96.64% <100.00%> (?)
openfeature 54.72% <100.00%> (+0.01%) ⬆️
openfeature-unit 49.94% <100.00%> (-0.02%) ⬇️
platform-core_esbuild_instrumentations-misc 38.54% <44.44%> (-0.03%) ⬇️
platform-integration 62.32% <44.44%> (-0.01%) ⬇️
platform-shimmer_unit-guardrails_webpack 37.33% <44.44%> (-0.03%) ⬇️
plugins-bucket-0 53.26% <44.44%> (-0.05%) ⬇️
plugins-bucket-1 55.19% <44.44%> (-0.01%) ⬇️
plugins-bucket-11 57.53% <44.44%> (-0.05%) ⬇️
plugins-bucket-18 57.14% <44.44%> (-0.05%) ⬇️
plugins-bucket-19 55.46% <44.44%> (-0.03%) ⬇️
plugins-bucket-20 57.66% <44.44%> (-0.05%) ⬇️
plugins-bucket-4 53.87% <44.44%> (-0.05%) ⬇️
plugins-bullmq_cassandra_cookie 57.47% <44.44%> (-0.05%) ⬇️
plugins-cookie-parser_crypto_dd-trace-api 52.42% <44.44%> (-0.06%) ⬇️
plugins-fetch_fs_generic-pool 54.59% <44.44%> (-0.13%) ⬇️
plugins-google-cloud-pubsub_grpc_handlebars 59.92% <44.44%> (-0.05%) ⬇️
plugins-hapi_hono_ioredis 55.85% <44.44%> (-0.05%) ⬇️
plugins-jest_knex_langgraph 51.77% <44.44%> (-0.05%) ⬇️
plugins-ldapjs_light-my-request_limitd-client 53.53% <44.44%> (-0.05%) ⬇️
plugins-lodash_mariadb_memcached 54.29% <44.44%> (-0.06%) ⬇️
plugins-moleculer_mongodb_mongodb-core 57.40% <44.44%> (-0.05%) ⬇️
plugins-mongoose_multer_mysql 54.78% <44.44%> (-0.05%) ⬇️
plugins-mysql2_nats_node-serialize 56.32% <44.44%> (-0.06%) ⬇️
plugins-opensearch_passport-http_pino 55.19% <44.44%> (-0.05%) ⬇️
plugins-postgres_process_pug 54.37% <44.44%> (-0.06%) ⬇️
plugins-redis_router_sequelize 57.16% <44.44%> (-0.08%) ⬇️
plugins-test-and-upstream-rhea_undici_url 57.06% <44.44%> (-0.03%) ⬇️
plugins-valkey_vm_winston 54.02% <44.44%> (-0.05%) ⬇️
plugins-ws 54.92% <44.44%> (-0.05%) ⬇️
profiling 58.25% <44.44%> (-0.05%) ⬇️
serverless-aws-sdk-aws-sdk 50.77% <44.44%> (-0.05%) ⬇️
serverless-aws-sdk-bedrockruntime 50.75% <44.44%> (-0.05%) ⬇️
serverless-aws-sdk-client 52.08% <44.44%> (-0.05%) ⬇️
serverless-aws-sdk-dynamodb 51.80% <44.44%> (-0.05%) ⬇️
serverless-aws-sdk-eventbridge 46.46% <44.44%> (-0.05%) ⬇️
serverless-aws-sdk-kinesis 54.79% <44.44%> (-0.05%) ⬇️
serverless-aws-sdk-lambda 52.87% <44.44%> (-0.05%) ⬇️
serverless-aws-sdk-s3 51.58% <44.44%> (-0.05%) ⬇️
serverless-aws-sdk-serverless-peer-service 54.81% <44.44%> (-0.05%) ⬇️
serverless-aws-sdk-sns 55.54% <44.44%> (-0.05%) ⬇️
serverless-aws-sdk-sqs 55.96% <44.44%> (-0.16%) ⬇️
serverless-aws-sdk-stepfunctions 51.35% <44.44%> (-0.05%) ⬇️
serverless-aws-sdk-util 48.53% <44.44%> (-0.06%) ⬇️
serverless-bucket-0 55.24% <44.44%> (-0.01%) ⬇️
serverless-bucket-1 56.06% <44.44%> (-0.05%) ⬇️
test-optimization-cucumber 72.94% <72.22%> (+0.02%) ⬆️
test-optimization-cypress 66.30% <44.44%> (+0.01%) ⬆️
test-optimization-jest 74.28% <83.33%> (-0.05%) ⬇️
test-optimization-mocha 74.68% <72.22%> (+0.04%) ⬆️
test-optimization-playwright-playwright-atr 61.50% <44.44%> (-0.01%) ⬇️
test-optimization-playwright-playwright-efd 61.68% <44.44%> (-0.01%) ⬇️
test-optimization-playwright-playwright-final-status 61.66% <44.44%> (-0.02%) ⬇️
test-optimization-playwright-playwright-impacted-tests 61.38% <44.44%> (+0.15%) ⬆️
test-optimization-playwright-playwright-reporting 61.26% <44.44%> (-0.02%) ⬇️
test-optimization-playwright-playwright-test-management 62.00% <44.44%> (-0.35%) ⬇️
test-optimization-playwright-playwright-test-span 61.40% <44.44%> (-0.08%) ⬇️
test-optimization-selenium 60.70% <44.44%> (-0.12%) ⬇️
test-optimization-testopt 59.16% <44.44%> (+0.08%) ⬆️
test-optimization-vitest 71.39% <72.22%> (+0.01%) ⬆️

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.

@pr-commenter

pr-commenter Bot commented Jul 14, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-14 23:49:38

Comparing candidate commit 35d627f in PR branch sameerank/openfeature-provider-singleton with baseline commit 1abef82 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2316 metrics, 42 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-appsec-enabled-24

  • unstable execution_time [-209.020ms; +211.791ms] or [-7.877%; +7.982%]

scenario:appsec-appsec-enabled-26

  • unstable execution_time [-231.666ms; +223.608ms] or [-9.097%; +8.781%]

scenario:appsec-appsec-enabled-with-attacks-24

  • unstable execution_time [-164086.568µs; +162604.901µs] or [-5.327%; +5.279%]

scenario:appsec-appsec-enabled-with-attacks-26

  • unstable execution_time [-193.062ms; +183.955ms] or [-6.643%; +6.329%]

scenario:appsec-control-20

  • unstable execution_time [-119.160ms; +125.344ms] or [-7.264%; +7.641%]

scenario:appsec-control-24

  • unstable execution_time [-113474.367µs; +113011.400µs] or [-9.165%; +9.127%]

scenario:appsec-control-26

  • unstable execution_time [-123.538ms; +128.118ms] or [-9.971%; +10.341%]

scenario:appsec-iast-no-vulnerability-iast-enabled-always-active-20

  • unstable execution_time [-15329.379µs; +14759.512µs] or [-5.877%; +5.659%]

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

  • unstable execution_time [-15244.583µs; +16559.116µs] or [-5.952%; +6.465%]

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

  • unstable execution_time [-29.601ms; +33.017ms] or [-5.387%; +6.008%]

scenario:debugger-line-probe-with-snapshot-default-24

  • unstable cpu_user_time [-1509.057ms; +484.956ms] or [-18.386%; +5.909%]
  • unstable execution_time [-1525.565ms; +497.430ms] or [-17.119%; +5.582%]
  • unstable instructions [-12.7G instructions; +4.1G instructions] or [-18.938%; +6.202%]
  • unstable throughput [-142.130op/s; +432.179op/s] or [-3.866%; +11.757%]

scenario:debugger-line-probe-with-snapshot-default-26

  • unstable cpu_user_time [-3.533s; +0.474s] or [-34.274%; +4.602%]
  • unstable execution_time [-3.534s; +0.498s] or [-31.936%; +4.499%]
  • unstable instructions [-31.6G instructions; +4.2G instructions] or [-36.599%; +4.844%]
  • unstable throughput [-105.945op/s; +696.985op/s] or [-3.456%; +22.734%]

scenario:debugger-line-probe-with-snapshot-minimal-24

  • unstable cpu_user_time [-1732.087ms; +565.240ms] or [-20.949%; +6.836%]
  • unstable execution_time [-1753.298ms; +564.211ms] or [-19.551%; +6.291%]
  • unstable instructions [-14.7G instructions; +4.8G instructions] or [-21.712%; +7.054%]
  • unstable throughput [-152.664op/s; +473.384op/s] or [-4.158%; +12.892%]

scenario:debugger-line-probe-with-snapshot-minimal-26

  • unstable cpu_user_time [-3554.668ms; +5107.779ms] or [-32.048%; +46.050%]
  • unstable execution_time [-3561.692ms; +5126.505ms] or [-30.061%; +43.268%]
  • unstable instructions [-31.9G instructions; +45.5G instructions] or [-34.115%; +48.749%]
  • unstable max_rss_usage [-9.722MB; +16.154MB] or [-5.911%; +9.822%]
  • unstable throughput [-1014.716op/s; +676.628op/s] or [-34.713%; +23.147%]

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

  • unstable cpu_user_time [-3596.717ms; +3588.136ms] or [-34.920%; +34.837%]
  • unstable execution_time [-3585.399ms; +3625.920ms] or [-32.507%; +32.875%]
  • unstable instructions [-32246.9M instructions; +32319.5M instructions] or [-37.287%; +37.371%]
  • unstable max_rss_usage [-11833.674KB; +12627.274KB] or [-7.324%; +7.815%]
  • unstable throughput [-723.624op/s; +694.651op/s] or [-23.475%; +22.536%]

scenario:dogstatsd-aggregated-20

  • unstable cpu_usage_percentage [-6.145%; +6.348%]
  • unstable execution_time [-124.779ms; +116.300ms] or [-9.470%; +8.826%]
  • unstable throughput [-752758.381op/s; +790025.529op/s] or [-6.495%; +6.817%]

scenario:dogstatsd-with-tags-20

  • unstable cpu_user_time [-352.132ms; +340.922ms] or [-7.338%; +7.104%]
  • unstable execution_time [-343.775ms; +341.735ms] or [-7.043%; +7.001%]
  • unstable throughput [-120950.461op/s; +123514.461op/s] or [-7.033%; +7.182%]

scenario:plugin-graphql-long-with-depth-on-max-20

  • unstable cpu_user_time [-759.029ms; +727.337ms] or [-5.913%; +5.666%]
  • unstable execution_time [-762.675ms; +729.875ms] or [-5.814%; +5.564%]
  • unstable throughput [-3.368op/s; +3.511op/s] or [-5.488%; +5.720%]

scenario:test-optimization-large-suite-20

  • unstable max_rss_usage [-4426.952KB; +5980.285KB] or [-5.522%; +7.459%]

@sameerank
sameerank marked this pull request as ready for review July 15, 2026 01:13
@sameerank
sameerank requested review from a team as code owners July 15, 2026 01:13
@sameerank
sameerank requested review from dd-oleksii and typotter and removed request for a team July 15, 2026 01:13
@sameerank

Copy link
Copy Markdown
Contributor Author

Closing in favor of #9331

@sameerank sameerank closed this Jul 15, 2026
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.

1 participant