Skip to content

feat: support-evaluation-tracking-api#196

Merged
Zaimwa9 merged 14 commits intomainfrom
feat/support-evaluation-tracking-api
Apr 15, 2026
Merged

feat: support-evaluation-tracking-api#196
Zaimwa9 merged 14 commits intomainfrom
feat/support-evaluation-tracking-api

Conversation

@Zaimwa9
Copy link
Copy Markdown
Contributor

@Zaimwa9 Zaimwa9 commented Apr 13, 2026

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Related JS client PR

Contributes to Flagsmith/flagsmith-openfeature-provider-python#34

Will be consumed in OpenFeature provider

Adds pipeline analytics support to the Python client, enabling buffered event tracking that posts to POST {url}v1/analytics/batch. This lays the groundwork for the OpenFeature provider to delegate its track() method to the client.

  • PipelineAnalyticsConfig dataclass for configuration: analytics server URL, buffer size, and flush interval
  • PipelineAnalyticsProcessor event processor with:
    • record_evaluation_event(), automatic on get_flag() call, deduplicated within each flush window
    • record_custom_event(), explicit, never deduplicated
    • Periodic flush
    • Failed flush re-queues events (capped at max_buffer)
  • Flagsmith.track_event() — public API for recording custom events
  • Flags.get_flag(), automatically records evaluation events when a pipeline processor is configured
  • resolve_trait_values() — extracted shared helper for unwrapping TraitConfig

How did you test this code?

  • Added tests

@Zaimwa9 Zaimwa9 requested a review from a team as a code owner April 13, 2026 15:30
@Zaimwa9 Zaimwa9 requested review from khvn26 and removed request for a team April 13, 2026 15:30
@Zaimwa9 Zaimwa9 marked this pull request as draft April 13, 2026 15:30
@Zaimwa9 Zaimwa9 marked this pull request as ready for review April 14, 2026 09:14
khvn26
khvn26 previously approved these changes Apr 15, 2026
Copy link
Copy Markdown
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with minor notes.

Comment thread flagsmith/analytics.py Outdated
Comment thread flagsmith/flagsmith.py Outdated
Comment thread flagsmith/analytics.py
Comment thread flagsmith/analytics.py
Copy link
Copy Markdown
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Zaimwa9 Zaimwa9 merged commit e9be90f into main Apr 15, 2026
7 checks passed
@Zaimwa9 Zaimwa9 deleted the feat/support-evaluation-tracking-api branch April 15, 2026 14:27
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.

2 participants