Skip to content
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

feat(flags): add Statsig integration #4022

Merged
merged 11 commits into from
Feb 12, 2025
Merged

feat(flags): add Statsig integration #4022

merged 11 commits into from
Feb 12, 2025

Conversation

aliu39
Copy link
Member

@aliu39 aliu39 commented Feb 8, 2025

New integration for tracking Statsig (pypi) flag evaluations, specifically the checkGate method which is used for boolean release flags. Unlike JS, there's no support for event callbacks for Statsig's server SDKs. Instead we wrap the module-level check_gate function.

Ref https://develop.sentry.dev/sdk/expected-features/#feature-flags

Ref

Copy link

codecov bot commented Feb 8, 2025

Codecov Report

Attention: Patch coverage is 84.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 80.26%. Comparing base (b2fc801) to head (f2ca15d).
Report is 4 commits behind head on master.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sentry_sdk/integrations/statsig.py 84.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4022      +/-   ##
==========================================
- Coverage   80.26%   80.26%   -0.01%     
==========================================
  Files         139      140       +1     
  Lines       15417    15442      +25     
  Branches     2606     2608       +2     
==========================================
+ Hits        12374    12394      +20     
- Misses       2203     2207       +4     
- Partials      840      841       +1     
Files with missing lines Coverage Δ
sentry_sdk/integrations/__init__.py 77.01% <ø> (ø)
sentry_sdk/integrations/unleash.py 90.00% <ø> (ø)
sentry_sdk/integrations/statsig.py 84.00% <84.00%> (ø)

... and 1 file with indirect coverage changes

@aliu39 aliu39 added the New Integration Integrating with a new framework or library label Feb 8, 2025
@aliu39 aliu39 requested review from a team February 11, 2025 21:05
@aliu39
Copy link
Member Author

aliu39 commented Feb 11, 2025

May need some help debugging the failed CI.. it's warning about unknown config options found in pytest.ini: asyncio_mode and asyncio_default_fixture_loop_scope

Copy link
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

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

Folks, this looks good to me. I fixed up the test setup a bit and added a minimum version check to the integration (set to 0.55.3). Feel free to merge if the changes look good to you.

@sentrivana
Copy link
Contributor

We will also need integration docs for this -- anyone on it already? Otherwise I'll whip something up

@aliu39
Copy link
Member Author

aliu39 commented Feb 12, 2025

We will also need integration docs for this -- anyone on it already? Otherwise I'll whip something up

I was planning to whip one up tomorrow or friday!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Integration Integrating with a new framework or library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants