Skip to content

feat(all): tag OpenFeature exposures with $openfeature_provider (SDK-448) - #107

Open
ketanmixpanel wants to merge 1 commit into
masterfrom
ketanshikhare-sdk-448-openfeature-provider-marker
Open

ketanmixpanel wants to merge 1 commit into
masterfrom
ketanshikhare-sdk-448-openfeature-provider-marker

Conversation

@ketanmixpanel

Copy link
Copy Markdown
Contributor

Summary

SDK-448: $experiment_started exposures fired through the Mixpanel OpenFeature provider now include "$openfeature_provider": true, so OpenFeature usage can be told apart from direct SDK flag calls. Direct SDK calls are unchanged (no property).

No public API change: no new public methods, parameters or fields. The provider signals the SDK through an argument it already passes on every evaluation.

How

  • Provider: adds "$openfeature_provider": true to the evaluation context it already passes to getVariant, set after the customer attributes so a same-named attribute cannot override it.
  • SDK: the exposure-tracking code (which already receives the context to read distinct_id) copies the marker onto $experiment_started when the context value is exactly true. Covers local and remote evaluation.
  • Local evaluation is unaffected: it only reads the flag assignment key, distinct_id and custom_properties.

Testing

  • New SDK tests (local and remote): marker present tags the exposure, absent does not. The protected trackExposure signature is unchanged.
  • New provider tests: marker reaches getVariant, cannot be overridden by a customer attribute, and is set for a null context.
  • mvn test (SDK): 396, 0 failures. cd openfeature-provider && mvn test: 38, 0 failures.
  • Also verified the provider against the local SDK (throwaway version installed to ~/.m2, removed afterwards), including an end-to-end test with a real RemoteFlagsProvider: 39/39.

Note: marker is sent to the server on remote evaluation

Because the marker lives in the evaluation context, remote evaluation sends it to /flags with the rest of the context. The flags API accepts and ignores it (checked in analytics/go/src/mixpanel.com/flags/api/handlers/evaluatefeatureflags.go):

  • request validation only type-checks distinct_id and device_id;
  • evaluation only reads the assignment key, distinct_id/device_id, custom_properties and hierarchical group IDs;
  • logRequest does not log it.

So it has no effect on targeting, rollout or variant assignment; it is only visible in the GET context query parameter.

Release order

Older SDKs ignore the marker, so the provider change is safe on its own (no errors; the property just does not appear). The property appears once customers run an SDK release containing this change; the provider minimum SDK version was intentionally not bumped here and should be raised after the SDK release. No version or changelog edits.

🤖 Generated with Claude Code

Exposures fired through the Mixpanel OpenFeature provider now include
"$openfeature_provider": true so they can be told apart from direct SDK
flag calls. Direct SDK calls are unchanged. No public API change: the
provider signals the SDK through an argument it already passes on every
evaluation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Nov 12, 2026

Copy link
Copy Markdown

SDK-448

@greptile-apps

greptile-apps Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Reviews (1) · Last reviewed commit: "feat: tag OpenFeature exposures with $op..." · Reviewed by Greptile

@ketanmixpanel ketanmixpanel changed the title feat: tag OpenFeature exposures with $openfeature_provider (SDK-448) feat(all): tag OpenFeature exposures with $openfeature_provider (SDK-448) Nov 12, 2026
@ketanmixpanel
ketanmixpanel marked this pull request as ready for review November 13, 2026 08:55
@ketanmixpanel
ketanmixpanel requested review from a team and rahul-mixpanel November 13, 2026 08:55

This branch has not been deployed

No deployments
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