Skip to content

FFL-3439: Attribute PHP flag evaluations to the application - #4368

Draft
vjfridge wants to merge 1 commit into
masterfrom
vickie/FFL-3439/php-flagevaluation-application-identity
Draft

vjfridge wants to merge 1 commit into
masterfrom
vickie/FFL-3439/php-flagevaluation-application-identity

Conversation

@vjfridge

@vjfridge vjfridge commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Description

Motivation

PHP now emits flagevaluation track EVP events, but its current libdatadog
dependency does not attach the application's identity. This adopts
libdatadog #2716 so those
events identify the right application and are not combined across different
applications. Implements FFL-3439
and follows PHP #4288.

Dependent draft: #2716 is not merged. This currently pins its exact commit,
58b738075f440d4a1d94ea49a545a0fac2e52e2c. Before merging, adopt a merged
libdatadog revision containing the fix and revalidate any changes. Both PRs
are prerequisites for releasing this functionality.

Changes and key decisions

  • Keep PHP's per-evaluation application context empty. The sidecar uses the
    application already registered on the connection, before aggregation.
  • Require batch context.service, context.env, and context.version, plus
    context.dd.service on ordinary events. Do not add per-event environment or
    version tags, or restore customer context on protected/degraded events.
  • Test default identity and changes to service, environment, and version
    before a single flush. Earlier evaluations must keep their original
    identity, even when every evaluation uses the same flag.
  • Update the native pin, required Cargo dependencies, and generated bindings
    using the repository's normal build workflow.

Blast radius

  • No new PHP setting, worker, queue, FFI call, or per-evaluation string copy.
    Privacy rules, evaluation results, exposures, and SDK-origin headers retain
    their existing behavior.
  • The native update also includes intervening upstream changes, not only
    Enable sidecar on 8.3 #2716: CDN support, TLS roots, trace internals, and crashtracking. Linux
    ARM64 validation passed; supported-platform CI is still required.
  • Header regeneration removes three Windows crash-callback declarations that
    upstream changed to the Windows calling convention. PHP does not call those
    callbacks directly; Windows coverage remains a CI requirement.

Testing

  • PHP 8.2 NTS / Linux ARM64: optimized build and 23 PHPT tests pass;
    three require development services or ZTS. The three attribution regression
    tests fail against the old native dependency and pass with this update.
  • Frozen system-tests, all five FFE files forced on: 51/53 pass, versus
    48/53 on master. All three consent modes pass, including application
    attribution and protected identity/context checks.
  • Two system-test failures remain: a context fixture that leaves consent off
    but rejects the newly correct service tag (tracked in
    FFL-3407), and the 24,000-event
    stress test. Master delivered 23,734 and this branch 23,038; reported
    queue_overflow drops account for both shortfalls. This does not establish
    equivalent stress performance or lossless delivery.
  • Frozen ffe-dogfooding: native PHP and OpenFeature both ready; 36/36
    successful evaluations and 36 OTel metrics
    on each build, with identical
    evaluation responses. All 36 new events have the correct application
    service. Live configuration enabled full consent; deterministic system
    tests cover absent/false consent separately.

Remaining before merge

  • Enable sidecar on 8.3 #2716 merged; replace provisional native pin if necessary and validate.
  • Supported-platform CI and reviewer approval, including native-update
    compatibility beyond the Linux ARM64 run.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

Update libdatadog to the FFL-3438 implementation and require application attribution in native and OpenFeature wire tests. Keep per-evaluation FFI context empty and align required inherited dependencies and generated bindings.

Co-Authored-By: Codex <noreply@openai.com>
@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Pipelines  Tests

✨ Unblock PR with BitsAI

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 5 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | merge-gate — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-php | System Tests: [parametric]

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-php | framework test: [flow]

View more details · View in GitLab

View all 5 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 100.00%
• Overall Coverage: 74.40% (+0.04%)

Useful? React with 👍 / 👎

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

@pr-commenter

pr-commenter Bot commented Oct 23, 2026

Copy link
Copy Markdown

Benchmarks [ tracer ]

Benchmark execution time: 2026-10-23 04:04:19

Comparing candidate commit e9e88ca in PR branch vickie/FFL-3439/php-flagevaluation-application-identity with baseline commit 04b8525 in branch master.

📊 Benchmarking dashboard

Found 1 performance improvements and 7 performance regressions! Performance is the same for 186 metrics, 0 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 ----------------------------------'

scenario:ContextPropagationBench/benchInject64Bit-opcache

  • 🟥 execution_time [+95.202ns; +240.798ns] or [+4.121%; +10.424%]

scenario:EmptyFileBench/benchEmptyFileDdprof-opcache

  • 🟩 execution_time [-295.584µs; -103.496µs] or [-6.809%; -2.384%]

scenario:MessagePackSerializationBench/benchMessagePackSerialization

  • 🟥 execution_time [+8.430µs; +9.890µs] or [+7.979%; +9.361%]

scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache

  • 🟥 execution_time [+7.200µs; +11.340µs] or [+6.519%; +10.268%]

scenario:SamplingRuleMatchingBench/benchRegexMatching1

  • 🟥 execution_time [+75.248ns; +180.352ns] or [+5.187%; +12.432%]

scenario:SamplingRuleMatchingBench/benchRegexMatching2

  • 🟥 execution_time [+97.109ns; +184.891ns] or [+6.715%; +12.786%]

scenario:SamplingRuleMatchingBench/benchRegexMatching3

  • 🟥 execution_time [+83.122ns; +183.078ns] or [+5.695%; +12.543%]

scenario:SamplingRuleMatchingBench/benchRegexMatching4-opcache

  • 🟥 execution_time [+114.147ns; +218.653ns] or [+7.153%; +13.702%]

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.

1 participant