Skip to content

Add requestId to the $feature_flag_called event. #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 16, 2025

Conversation

haacked
Copy link
Collaborator

@haacked haacked commented Mar 16, 2025

Fixes #63

These are the only properties we're concerned about now.
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR adds support for request IDs in PostHog's /decide endpoint responses, enabling better tracking and debugging of feature flag evaluations.

  • Added new FlagsResult record to encapsulate feature flags with request IDs and quota information
  • Modified IFeatureFlagCache to support caching full FlagsResult while maintaining backward compatibility
  • Updated HttpContextFeatureFlagCache to store and retrieve FlagsResult objects instead of just feature flag dictionaries
  • Added request ID propagation to $feature_flag_called events for better tracing
  • Removed unused properties from DecideApiResult (Config, IsAuthenticated, Analytics) to focus on core functionality

6 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

@haacked haacked force-pushed the haacked/63-support-request-ids branch 3 times, most recently from ad8e669 to 0ec9187 Compare March 16, 2025 03:05
This includes `$feature_flag_request_id` as a property of the captured event `$feature_flag_called`. See PostHog/posthog-js#1793 for an example in another client-sdk.

Fixes #63
@haacked haacked force-pushed the haacked/63-support-request-ids branch from 0ec9187 to 2800c41 Compare March 16, 2025 03:18
@haacked haacked merged commit 370921e into main Mar 16, 2025
4 checks passed
@haacked haacked deleted the haacked/63-support-request-ids branch March 16, 2025 03:20
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.

chore(flags): Support requestIds in /decide responses
1 participant