Skip to content

Conversation

madhuchavva
Copy link

@madhuchavva madhuchavva commented Aug 21, 2025

Adds GrowthBook's integration for tracking feature evaluations.

This PR includes changes to wrap isOn, getFeatureValue and evalFeature methods, record results of type (booleans, strings, numbers, null, objects/arrays) and attach them to active span or current scope buffer for errors.

Closes https://linear.app/getsentry/issue/REPLAY-728/add-growthbook-feature-flag-integrations


Note

Adds GrowthBook integration that captures boolean feature evaluations via isOn/getFeatureValue to spans and error events, and exports it across SDKs with browser/node tests.

  • Core:
    • New growthbookIntegration: Wraps isOn/getFeatureValue to capture boolean results; inserts into active span attributes and copies to error events via scope.
    • Exposed from @sentry/core feature flags exports.
  • Runtimes/Frameworks:
    • Browser/Node: Add runtime adapter/shim and re-export growthbookIntegration.
    • SDK re-exports: Astro, AWS Serverless, Bun, Cloudflare, Google Cloud Serverless, Next.js (types), Nuxt (types), Remix (types), React Router (types), SolidStart (types), SvelteKit (types), TanStack Start (types) now expose growthbookIntegration.
  • Tests:
    • Browser integration tests: onError (buffer eviction, updates, boolean-only capture, scope isolation) and onSpan (attributes on span end, per-span cap).
    • Node integration tests: Scenarios validating onError and onSpan; add @growthbook/growthbook test dependency.

Written by Cursor Bugbot for commit 8fe30ac. This will update automatically on new commits. Configure here.

@madhuchavva madhuchavva changed the title Feat/growthbook integration feat(flags): Adds Growthbook integration Aug 21, 2025
@madhuchavva madhuchavva marked this pull request as ready for review August 21, 2025 23:14
@Lms24 Lms24 requested a review from aliu39 August 25, 2025 10:45
@madhuchavva
Copy link
Author

@Lms24 Would you approve the workflows to run again?

@aliu39
Copy link
Member

aliu39 commented Sep 3, 2025

Tysm for the integration @madhuchavva !! Will take a look soon

record results of type (booleans, strings, numbers, null, objects/arrays)

For now Sentry is limiting all FF integrations to boolean only. We plan to rollout non-bool support later - would you mind removing those types from this PR?

@aliu39
Copy link
Member

aliu39 commented Sep 3, 2025

relates to getsentry/sentry#82157

@aliu39
Copy link
Member

aliu39 commented Sep 15, 2025

Changes lgtm but could use a review from the js experts for safety! I'm fine with node support getting added in a followup

@AbhiPrasad @chargome

cursor[bot]

This comment was marked as outdated.

@madhuchavva
Copy link
Author

@chargome @aliu39 Thanks for the feedback. Apologies for the delay in getting back(I was off). Please take a look when you can. Thank you!

@aliu39
Copy link
Member

aliu39 commented Sep 24, 2025

Thanks sm for the updates! Just approved tests to run. For server-side, I believe there are a few more pkgs to export from besides node. See https://github.com/getsentry/sentry-javascript/pull/16585/files as a reference -
Screenshot 2025-09-24 at 2 47 33 PM

To verify it works for node, could we copy tests to dev-packages/node-integration-tests/ as well?

@chargome chargome force-pushed the feat/growthbook-integration branch from 6e459ee to e1379ca Compare October 1, 2025 13:11
@madhuchavva
Copy link
Author

@AbhiPrasad do you mind taking a look at this?

@chargome
Copy link
Member

chargome commented Oct 6, 2025

@madhuchavva once we fix CI: Build & Test / Lint we're good to go

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@madhuchavva
Copy link
Author

@aliu39 do you mind giving the approval to let the workflows run?

@madhuchavva
Copy link
Author

@madhuchavva once we fix CI: Build & Test / Lint we're good to go

@chargome Lint check is fixed now. Do you mind taking a look?

@madhuchavva
Copy link
Author

@aliu39 had to click on "update branch" to get it out of sync. Mind approving the workflows to run?

@chargome Appreciate if you could review this PR one last time. Thank you!

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.

3 participants