Repository navigation
feat(all): tag OpenFeature exposures with $openfeature_provider (SDK-448) - #107
Open
ketanmixpanel wants to merge 1 commit into
Open
ketanmixpanel wants to merge 1 commit into
ketanmixpanel wants to merge 1 commit into
Conversation
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>
[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
marked this pull request as ready for review
November 13, 2026 08:55
rahul-mixpanel
left a comment
There was a problem hiding this comment.
Reviewed against the SDK-448 design. Looks good: convertContext sets the marker after customer attributes (tested, including a null context), and addOpenFeatureProviderProperty uses Boolean.TRUE.equals, applied on both local and remote exposure paths. Local targeting is unaffected (runtime rules read custom_properties); remote sends the marker in context, which the server ignores.
- Follow-up: the provider
pom.xmlpinsmixpanel-javato1.10.0. Maven picks the version nearest in the dependency tree, so customers who only add the provider stay on 1.10.0 and won't get the tag. Raise this after the SDK release. - Nit – test gap: the remote tests check that the property is added, but not that it's absent for direct calls; the local tests cover both.
- Behaviour change (fine): a null evaluation context now yields
{"$openfeature_provider": true}instead of an empty map. Nodistinct_idmeans no exposure.
Cross-SDK notes:
- Dedup trade-off: in apps using both direct calls and the provider, the marker undercounts provider exposures (whichever path evaluates a flag first after a fetch wins). Worth recording on SDK-448 / in docs for whoever analyses this property, not only in the PR body.
- Testing: provider tests mock the SDK; the real provider ↔ SDK contract was only verified manually. An end-to-end test would protect it.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SDK-448:
$experiment_startedexposures 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
"$openfeature_provider": trueto the evaluation context it already passes togetVariant, set after the customer attributes so a same-named attribute cannot override it.distinct_id) copies the marker onto$experiment_startedwhen the context value is exactlytrue. Covers local and remote evaluation.distinct_idandcustom_properties.Testing
trackExposuresignature is unchanged.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.~/.m2, removed afterwards), including an end-to-end test with a realRemoteFlagsProvider: 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
/flagswith the rest of the context. The flags API accepts and ignores it (checked inanalytics/go/src/mixpanel.com/flags/api/handlers/evaluatefeatureflags.go):distinct_idanddevice_id;distinct_id/device_id,custom_propertiesand hierarchical group IDs;logRequestdoes not log it.So it has no effect on targeting, rollout or variant assignment; it is only visible in the GET
contextquery 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