feat: Support OpenFeature tracking - #50
Merged
Merged
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>
devin-ai-integration
Bot
force-pushed
the
devin/openfeature-python-tracking
branch
from
August 25, 2026 16:26
4042b50 to
9d846a4
Compare
keelerm84
approved these changes
Aug 25, 2026
kinyoklion
pushed a commit
that referenced
this pull request
Aug 31, 2026
🤖 I have created a release *beep* *boop* --- ## [0.7.0](0.6.0...0.7.0) (2026-08-31) ### Features * Populate OpenFeature flag metadata from the evaluation reason ([#53](#53)) ([11ae1a6](11ae1a6)) * Report provider name and version to LaunchDarkly ([#51](#51)) ([4290b8a](4290b8a)) * Support OpenFeature tracking ([#50](#50)) ([9395775](9395775)) ### Bug Fixes * Do not report a failed initialization as a fatal error ([#56](#56)) ([946a515](946a515)) * Do not report a permanent data source failure as fatal ([#52](#52)) ([15014c1](15014c1)) * Map the WRONG_TYPE error kind to TYPE_MISMATCH ([#57](#57)) ([17478dc](17478dc)) ### Documentation * Add an OpenFeature feature matrix to the README ([#58](#58)) ([6c31554](6c31554)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > This is a **Release Please** cut that moves the project from **0.6.0** to **0.7.0** by updating version fields in `pyproject.toml`, `ld_openfeature/version.py`, `docs/conf.py`, and `.release-please-manifest.json`. > > It also **adds the 0.7.0 section to `CHANGELOG.md`**, which documents what ships in this release (not new code in this diff): OpenFeature **tracking**, **flag metadata from evaluation reason**, **provider name/version** sent to LaunchDarkly, fixes for **non-fatal** failed init and permanent data-source failures, **`WRONG_TYPE` → `TYPE_MISMATCH`** mapping, and a README **OpenFeature feature matrix**. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 12fafea. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@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 spec tracking on
LaunchDarklyProvidersoclient.track(...)forwards custom events to LaunchDarkly instead of being dropped when the provider had notrackimplementation.trackconverts the OpenFeatureEvaluationContextvia the existing converter and callsLDClient.trackwith the right arity: event name only, plusdatafromTrackingEventDetails.attributes, and/ormetric_valuefromTrackingEventDetails.value(empty attribute maps are treated as no data). Calls without an evaluation context log at info onlaunchdarkly-openfeature-serverand send nothing.Dependency:
openfeature-sdkminimum is raised from0.8.0to0.9.0. Tests mockLDClient.trackfor the no-context, no-details, attributes-only, value-only, and value+attributes paths.Reviewed by Cursor Bugbot for commit 9d846a4. Bugbot is set up for automated code reviews on this repo. Configure here.