Skip to content

fix(ffe): attribute flag evaluations to the connection application - #2716

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 7 commits into
mainfrom
vickie/FFL-3438-flagevaluation-application-identity
Nov 6, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 7 commits into
mainfrom
vickie/FFL-3438-flagevaluation-application-identity

Conversation

@vjfridge

@vjfridge vjfridge commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Attach application identity to flagevaluation track EVP events in the sidecar, using the application already registered on the connection.

Motivation

PHP #4288 intentionally sends empty application context instead of repeating service, environment, and application version on every evaluation. Until the sidecar fills those values, evaluations lack application attribution and different applications can share aggregation buckets.

This implements FFL-3438, following the application-identity review discussion.

Changes and key decisions

  • When all three batch-context fields are empty, copy service, environment, and application version from the connection's current application before aggregation. Evaluations already queued for application A stay attributed to A if the connection switches to B before flushing.
  • When the application has a non-empty service name, fill missing or empty context.dd.service on non-degraded events. Keep explicit event-level service values, and never add per-event environment/version or restore context to degraded events.
  • Preserve explicitly supplied batch context, including partially populated context. If no application is registered, keep today's unattributed delivery rather than dropping the evaluation.
  • Check application service, environment, and version before copying them. If any exceeds 256 characters, keep the evaluations unattributed and preserve their counts. A debug log explains the skip without printing application values.
  • Submissions explicitly routed through enqueue_actions_for_service do not inherit the connection's application identity.
  • Reuse the existing application-update ordering and reconnect replay. No new queue, worker, configuration, or IPC fields.

Blast radius

  • Behavior changes only for empty-context flagevaluation submissions with a registered application.
  • Privacy consent, targeting-key hashing, truncation/degradation rules, and SDK-origin headers are unchanged.
  • Exposures, OTel metrics, tracing, and transport/reconnection behavior are unchanged. No FFI signature or wire-layout changes.
  • PHP must adopt the native release and validate the integration in FFL-3439 before releasing this functionality to customers.

How to test the change?

  • Latest native validation (2703c8ac8): 174 sidecar tests pass on Rust 1.91.1 / Linux ARM64; compilation, formatting, strict Clippy, and structural lint checks pass. macOS/Windows runtime coverage remains with CI.

  • Regression coverage: application changes before flush, separate connections, request-end clearing, explicit context, pending application replay, 256/257-character boundaries including Unicode, and the service-routing exclusion. Real IPC → HTTP tests check attribution, protected/consented/degraded payloads, raw PII canaries, and unchanged SDK-origin headers.

  • C interface checks at 06e79521e: 220 sidecar/FFI tests passed with one existing skip, four doctests passed, and 13 C/C++ examples passed with two runner-defined skips. Generated C headers include both submission functions' attribution documentation.

  • Earlier PHP/dogfooding validation: PHP #4368 used native 58b7380 and PHP e9e88caf2, before the later native fixes. On Linux ARM64 / PHP 8.2 NTS, 23 PHPT tests passed with three environment-dependent skips; the two-worker request-reuse probe attributed 8/8 evaluations correctly. Dogfooding matched master with 36/36 successful evaluations and 36 OTel metrics, unchanged results, and correct application service tags. Live configuration enabled full consent.

  • Earlier system-tests on those same revisions: 51/53 passed versus 48/53 on master, including all three consent modes. Remaining failures were the context-bounds fixture rejecting the service tag (FFL-3407) and shared-sender backpressure during the high-volume count test on both builds. These results do not validate the latest native revision or establish equivalent stress performance.

  • Before releasing the PHP functionality, update PHP #4368 to the merged libdatadog version and rerun PHP validation, system-tests, and ffe-dogfooding (FFL-3439).

Snapshot service, environment, and application version before coalescing empty-context batches. Preserve explicit context, request lifecycle ordering, and privacy rules.

FFL-3438

Co-authored-by: Codex <noreply@openai.com>
@datadog-datadog-prod-us1-2

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

Copy link
Copy Markdown

Pipelines  Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
• Patch Coverage: 98.68%
• Overall Coverage: 76.13% (-7.26%)

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

@pr-commenter

pr-commenter Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Benchmarks

Comparison

Candidate

Candidate benchmark details

Baseline

Baseline benchmark details

@vjfridge
vjfridge marked this pull request as ready for review October 23, 2026 03:03
@vjfridge
vjfridge requested review from a team as code owners October 23, 2026 03:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-23T03:06:47.128863Z 58b7380 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-23T03:14:04.949921Z 58b7380 Draft marked ready

Security findings

Advisory findings (1)

ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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 Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 58b738075f

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Copilot AI 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.

🟢 Approval recommended

The narrowly scoped attribution change preserves explicit context and privacy behavior, with focused regression coverage and no unresolved findings.

No open issues 🎉

What changed in this PR

This PR attributes empty-context flag evaluations to the sidecar connection’s current application before aggregation, preventing evaluations from different applications from sharing attribution.

Changes:

  • Snapshot application identity and fill missing event-level service values while preserving explicit context and degraded-event privacy.
  • Add regression coverage for application changes, separate connections, clearing, reconnect replay, and privacy.
  • Document attribution behavior and application-update ordering.
File Description
datadog-sidecar/​src/​service/​sidecar_server.rs Apply attribution before coalescing and add identity and ordering regression tests.
datadog-sidecar/​src/​service/​mod.rs Document attribution rules for flag-evaluation submissions.
datadog-sidecar/​src/​service/​flagevaluation_privacy_tests.rs Verify application attribution and preserved privacy through IPC-to-HTTP delivery.

Review effort: Balanced

@typotter typotter 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.

LGTM pending addressing codex's security finding.

@vjfridge
vjfridge requested review from aarsilv and typotter October 28, 2026 22:12
@vjfridge

Copy link
Copy Markdown
Contributor Author

/code blockers

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-10-28 22:15:04 UTC ℹ️ Start processing command /code blockers


2026-10-28 22:15:05 UTC

Checking merge blockers for #2716...


2026-10-28 22:15:08 UTC

Detected 3 merge blocker(s) to address:

🟠 Pending

  • Required check allchecks is running

  • Merge gate rule reviewers-approval is running: 2 approvals missing
    All required reviewers must approve this pull request before it can be merged. Learn more in our FAQ.

    Hint: Questions about this check? Reach out in #dx-source-code-management on Slack.

  • Merge gate rule reviewers-approval is running: 2 approvals missing
    All required reviewers must approve this pull request before it can be merged. Learn more in our FAQ.

    Hint: Questions about this check? Reach out in #dx-source-code-management on Slack.

Comment thread datadog-sidecar/src/service/mod.rs Resolved
Comment thread datadog-sidecar/src/service/mod.rs Resolved

@aarsilv aarsilv 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.

Thanks for iterating! Just a few remaining nits you can take or leave as you see fit! 🚀

@yannham yannham 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.

Nothing to say from APM common component side 👍

@typotter typotter 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.

approved - nothing new to add on top of "Aaron"

@dd-octo-sts

dd-octo-sts Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 9.21 MB 9.21 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 95.99 MB 95.99 MB 0% (0 B) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 12.37 MB 12.37 MB 0% (0 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 107.14 MB 107.14 MB 0% (0 B) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 29.49 MB 29.49 MB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 99.67 KB 99.67 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 191.42 MB 191.41 MB -0% (-8.00 KB) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 794.77 MB 794.77 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 9.70 MB 9.70 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 99.67 KB 99.67 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 27.66 MB 27.66 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 55.67 MB 55.67 MB 0% (0 B) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 26.00 MB 26.00 MB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 101.22 KB 101.22 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 197.15 MB 197.19 MB +.01% (+40.00 KB) 🔍
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 782.53 MB 782.53 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 7.49 MB 7.49 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 101.22 KB 101.22 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 29.75 MB 29.75 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 52.58 MB 52.58 MB 0% (0 B) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 86.45 MB 86.45 MB 0% (0 B) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 10.00 MB 10.00 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 102.17 MB 102.17 MB 0% (0 B) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 12.24 MB 12.24 MB 0% (0 B) 👌

…valuation-application-identity

# Conflicts:
#	datadog-sidecar/src/service/sidecar_server.rs
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 3c17d86 into main Nov 6, 2026
118 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the vickie/FFL-3438-flagevaluation-application-identity branch November 6, 2026 15:04
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.

6 participants