feat: Support OpenFeature tracking - #50
Open
kinyoklion wants to merge 2 commits into
Open
Conversation
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
|
@cursor review |
kinyoklion
marked this pull request as ready for review
August 19, 2026 16:25
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 79b09c0. Configure here.
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
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.

Implements the OpenFeature tracking API (spec §6) in the provider, matching the behavior of the Java, .NET, and Node providers.
client.track(...)previously no-opped silently: the OpenFeature Python SDK only forwards tracking to providers that implementtrack(spec 6.1.4), so custom/experimentation events were being dropped with no error.TrackingEventDetails.attributesmap to the LD eventdata, andTrackingEventDetails.valuemaps tometric_value.trackcall without an evaluation context logs at info level and sends nothing, since LaunchDarkly requires a context to attribute the event to.Requirements
Related issues
None; found while auditing the LaunchDarkly OpenFeature providers for missing spec features.
Describe the solution you've provided
LaunchDarklyProvider.trackconverts the OpenFeature evaluation context to anldclient.Contextwith the existingEvaluationContextConverterand then calls the narrowestLDClient.trackoverload that fits the details supplied: name only, name + data, or name + data + metric value.Describe alternatives you've considered
Sending an event with an empty/invalid context when no context is supplied, which would produce events LaunchDarkly cannot attribute. The Java provider already logs and skips in this case, so this follows that precedent.
Additional context
Implementation details
TrackingEventDetails.attributesdefaults to{}rather thanNone, so an empty attribute map is normalized toNoneto avoid sending an emptydataobject. Tests patchLDClient.trackand assert the exact argument shape for each of the four combinations (no context, no details, attributes only, value + attributes, value only).Link to Devin session: https://app.devin.ai/sessions/0c452d209ec54b068ba120b4c92b8f6c
Requested by: @kinyoklion
Note
Overview
Implements OpenFeature tracking on
LaunchDarklyProviderso custom/experimentation events reach LaunchDarkly instead of being dropped when the provider had notrackimplementation.trackconverts the OpenFeature evaluation context via the existing converter and callsLDClient.trackwith the minimal overload: name only, name +data(fromTrackingEventDetails.attributes), or name +data+metric_value(fromvalue). Empty attribute maps are treated as no data. Calls without an evaluation context log at info and send nothing, matching other LaunchDarkly OpenFeature providers.The openfeature-sdk dependency is bumped to
>=0.9.0forTrackingEventDetails. Tests cover all argument combinations by mockingLDClient.track.Reviewed by Cursor Bugbot for commit 4042b50. Bugbot is set up for automated code reviews on this repo. Configure here.