Skip to content

feat: Support OpenFeature tracking - #27

Open
kinyoklion wants to merge 1 commit into
mainfrom
devin/ruby-tracking
Open

feat: Support OpenFeature tracking#27
kinyoklion wants to merge 1 commit into
mainfrom
devin/ruby-tracking

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Aug 19, 2026

Copy link
Copy Markdown
Member

Implements the OpenFeature tracking API in the Ruby provider so experimentation metric events reach LaunchDarkly.

  • Adds Provider#track, mapping TrackingEventDetails#fields to the LD custom event data and #value to metric_value.
  • A track call without an evaluation context logs a warning and sends nothing, since LaunchDarkly requires a context to associate the event with.
  • Raises the openfeature-sdk floor to >= 0.6.1 (< 0.7.0); TrackingEventDetails and Client#track do not exist in 0.6.0.
Implementation details

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

Part of an audit of the LaunchDarkly OpenFeature providers against the current OpenFeature specification. Tracking (spec section 6) was unimplemented here, and per spec 6.1.4 the OpenFeature SDK silently no-ops when a provider lacks track, so events were being dropped without any error.

Describe the solution you've provided

OpenFeature::SDK::Client#track forwards to provider.track(name, evaluation_context:, tracking_event_details:). The provider converts the evaluation context with the existing EvaluationContextConverter and calls LDClient#track(event_name, context, data, metric_value). Empty fields are normalized to nil so no empty hash is attached to the event.

Describe alternatives you've considered

Sending the event with an anonymous/placeholder context when no evaluation context is supplied — rejected, because it would attribute metric events to a context the application never used. Warning and dropping matches the behavior of the Python provider.

Testing

bundle exec rake (RSpec + RuboCop) on Ruby 3.4: 57 examples, 0 failures; 12 files inspected, no offenses. Ruby 3.4 was used because the gemspec requires >= 3.4.

@cursor review

Link to Devin session: https://app.devin.ai/sessions/0c452d209ec54b068ba120b4c92b8f6c
Requested by: @kinyoklion


Note

Overview
Implements the OpenFeature tracking API on LaunchDarkly::OpenFeature::Provider so experimentation metric events are forwarded to LaunchDarkly instead of being silently dropped when the provider lacked track.

Provider#track converts the evaluation context via the existing converter and calls LDClient#track, mapping TrackingEventDetails#fields to custom event data and #value to the metric value; empty fields are passed as nil. Calls without an evaluation context log a warning and do not send an event.

The gemspec bumps the openfeature-sdk floor to >= 0.6.1 (< 0.7.0) because TrackingEventDetails and client tracking support are not in 0.6.0. Specs cover basic tracking, event details, and the no-context path.

Reviewed by Cursor Bugbot for commit d142051. Bugbot is set up for automated code reviews on this repo. Configure here.

Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
@kinyoklion kinyoklion self-assigned this Aug 19, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot added the devin-pr PRs created by Devin label Aug 19, 2026
@kinyoklion
kinyoklion marked this pull request as ready for review August 19, 2026 16:47
@kinyoklion
kinyoklion requested a review from a team as a code owner August 19, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

devin-pr PRs created by Devin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant