Skip to content

[FFL-2926] Add tracking parity to DatadogOfflineProvider - #349

Draft
sameerank wants to merge 1 commit into
sameerank/FFL-2871/static-context-offline-initfrom
sameerank/FFL-2926/offline-tracking-parity
Draft

[FFL-2926] Add tracking parity to DatadogOfflineProvider#349
sameerank wants to merge 1 commit into
sameerank/FFL-2871/static-context-offline-initfrom
sameerank/FFL-2926/offline-tracking-parity

Conversation

@sameerank

@sameerank sameerank commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add optional browser telemetry configuration to DatadogOfflineProvider
  • reuse the existing DatadogProvider exposure, flag-evaluation, and RUM tracking hooks through shared setup
  • keep offline evaluation telemetry-free when tracking is omitted
  • keep configuration delivery through setConfiguration(), consistent with React Native
  • attribute telemetry to the actual effective OpenFeature context used for evaluation
  • support the same tracking behavior for precomputed and rules-based offline evaluation
  • reset exposure deduplication when setConfiguration replaces the active configuration
  • prevent asynchronous persistent-cache initialization from restoring stale deduplication entries after replacement
  • keep offline configuration delivery free of fetching and polling even when telemetry is enabled

Why

Offline describes configuration delivery, not necessarily telemetry. Consumers should be able to opt into the same browser tracking behavior as DatadogProvider without introducing configuration fetching or polling.

When tracking is omitted, DatadogOfflineProvider remains evaluation-only and creates no tracking hooks or telemetry requests. The constructor accepts only optional browser tracking settings; caller-supplied flag configuration is loaded separately with setConfiguration().

Jira: FFL-2926

Behavior and compatibility

  • supplying a tracking block enables exposure, flag-evaluation, and RUM tracking with the same defaults and hook order as DatadogProvider
  • each integration can be disabled independently
  • context-specific precomputed consumers must register the matching context; {} is treated literally
  • tracking hooks observe the same OpenFeature context used for evaluation
  • successful precomputed and rules evaluations carry existing allocation, variation, context, logging, and timestamp metadata
  • defaults and failed evaluations do not emit exposure events
  • tracking failures do not affect local evaluation or provider lifecycle
  • the existing DatadogProvider constructor, fetching, caching, and tracking behavior remain unchanged

Stack and merge order

This PR is stacked on #346, which documents static initialization with getPrecomputedContext and treats empty OpenFeature contexts literally.

  1. Merge #344.
  2. Merge #353.
  3. Retarget and merge #336.
  4. Retarget and merge #346.
  5. Retarget this PR to main and merge it.

Validation

  • full browser suite passed: 18 suites and 203 tests
  • monorepo build and TypeScript checks passed
  • Biome checks passed

@sameerank
sameerank force-pushed the sameerank/FFL-2926/offline-tracking-parity branch 2 times, most recently from 4601849 to b077ce1 Compare August 6, 2026 20:56
@sameerank
sameerank force-pushed the sameerank/FFL-2871/static-context-offline-init branch 2 times, most recently from c5671fe to d22ce15 Compare August 6, 2026 21:30
@sameerank
sameerank force-pushed the sameerank/FFL-2926/offline-tracking-parity branch from b077ce1 to 35e7307 Compare August 6, 2026 21:30
@sameerank
sameerank force-pushed the sameerank/FFL-2871/static-context-offline-init branch from d22ce15 to e4d574a Compare August 6, 2026 23:24
@sameerank
sameerank force-pushed the sameerank/FFL-2926/offline-tracking-parity branch from 35e7307 to d45c3b0 Compare August 6, 2026 23:25
@sameerank
sameerank force-pushed the sameerank/FFL-2871/static-context-offline-init branch from e4d574a to 592713b Compare August 7, 2026 00:53
@sameerank
sameerank force-pushed the sameerank/FFL-2926/offline-tracking-parity branch from d45c3b0 to dfaa31f Compare August 7, 2026 00:53
@sameerank
sameerank force-pushed the sameerank/FFL-2871/static-context-offline-init branch from 592713b to d22d4e7 Compare August 7, 2026 01:24
@sameerank
sameerank force-pushed the sameerank/FFL-2926/offline-tracking-parity branch from dfaa31f to 26553ff Compare August 7, 2026 01:25
@sameerank
sameerank force-pushed the sameerank/FFL-2871/static-context-offline-init branch from d22d4e7 to 9d718e1 Compare August 9, 2026 14:03
@sameerank
sameerank force-pushed the sameerank/FFL-2926/offline-tracking-parity branch from 26553ff to e0aeed0 Compare August 9, 2026 14:06
@sameerank
sameerank force-pushed the sameerank/FFL-2926/offline-tracking-parity branch from e0aeed0 to 880ef0f Compare August 11, 2026 14:21
@sameerank
sameerank force-pushed the sameerank/FFL-2871/static-context-offline-init branch 2 times, most recently from 1adf3ea to 7beba56 Compare August 13, 2026 22:52
@sameerank
sameerank force-pushed the sameerank/FFL-2926/offline-tracking-parity branch from 880ef0f to 2304a11 Compare August 13, 2026 22:52
@sameerank
sameerank force-pushed the sameerank/FFL-2871/static-context-offline-init branch from 7beba56 to e1d30d6 Compare August 13, 2026 23:28
@sameerank
sameerank force-pushed the sameerank/FFL-2926/offline-tracking-parity branch from 2304a11 to 4c38e3f Compare August 13, 2026 23:28
@sameerank
sameerank force-pushed the sameerank/FFL-2871/static-context-offline-init branch from e1d30d6 to 9160faa Compare August 18, 2026 15:21
@sameerank
sameerank force-pushed the sameerank/FFL-2926/offline-tracking-parity branch from 4c38e3f to 471d42b Compare August 18, 2026 15:21
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