ref(flags): allow OpenFeature integration to track a single client#3895
Closed
aliu39 wants to merge 6 commits into
Closed
ref(flags): allow OpenFeature integration to track a single client#3895aliu39 wants to merge 6 commits into
aliu39 wants to merge 6 commits into
Conversation
… a single client instance
❌ 4 Tests Failed:
View the top 2 failed tests by shortest run time
View the full list of 1 ❄️ flaky tests
To view more test analytics, go to the Test Analytics Dashboard |
This was referenced Dec 23, 2024
2 tasks
Member
This needs to be discussed as a team and documented. Writing code is the last step not the first. I'm closing this for now. Not to stop us from working on this forever but to prevent someone from merging code accidentally. We can re-open once we understand the implications of the decisions we're making. |
antonpirker
added a commit
that referenced
this pull request
Jan 7, 2025
Adds an integration for tracking flag evaluations from [Unleash](https://www.getunleash.io/) customers. Implementation Unleash has no native support for evaluation hooks/listeners, unless the user opts in for each flag. Therefore we decided to patch the `is_enabled` and `get_variant` methods on the `UnleashClient` class. The methods are wrapped and the only side effect is writing to Sentry scope, so users shouldn't see any change in behavior. We patch one `UnleashClient` instance instead of the whole class. The reasons for this are described in - #3895 It's also safer to not modify the unleash import. References - https://develop.sentry.dev/sdk/expected-features/#feature-flags - https://docs.getunleash.io/reference/sdks/python for methods we're patching/wrapping --------- Co-authored-by: Anton Pirker <anton.pirker@sentry.io> Co-authored-by: Colton Allen <colton.allen@sentry.io>
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.
All provider SDKs so far have the concept of a "client" class, which is used to connect to the server and query flags. Since clients can query multiple projects/environments by specifying a
context, it is rare for an app to use >1 client.I discussed with @billyvg and we want to stay consistent for all FF integrations, and focus on tracking one client. This means users should pass a client to the Integration, and we'll register hooks on that client, rather than globally.
Update 12/26:
For backwards compatibility, I think it's best to
Updated setup code can be seen at: https://github.com/getsentry/sentry-docs/pull/12222/files