Skip to content

ref(flags): instrument sdk featureFlagsIntegration to track FE flag evals #81954

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 6 commits into from
Dec 16, 2024

Conversation

aliu39
Copy link
Member

@aliu39 aliu39 commented Dec 11, 2024

Re-opening https://github.com/getsentry/sentry/pull/81159/files after releasing a custom flag tracking integration in JS SDK 8.43. WIth this integration, we don't need to manage our own buffer in featureObserver anymore. Sentry employees shouldn't notice any changes, this is a proof-of-concept for the new SDK.

The SDK has its own tests already, so I'm only unit testing the add(__)FeaturesHook fxs.

Manually tested with dev-ui sending to a test org: https://andrew-onboarding.sentry.io/share/issue/664703eb3a98441b8a203dc44e803cee/

@aliu39 aliu39 requested a review from a team December 11, 2024 01:27
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 11, 2024
@aliu39 aliu39 marked this pull request as ready for review December 11, 2024 18:52
@aliu39 aliu39 requested a review from a team as a code owner December 11, 2024 18:52
* the Sentry SDK, in the event context. If the FeatureFlagsIntegration is not
* installed, the callback is a no-op.
*/
export function getSentryFeaturesHook(): (name: string, value: unknown) => void {
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't really hook into anything

Copy link
Member Author

Choose a reason for hiding this comment

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

wdym? "hook" is the term I'm using to describe the callback taking in a flag name/val. This term is used sometimes in SDK setup code

Copy link
Member

Choose a reason for hiding this comment

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

sorry this is just semantics but you're not really returning a hook, but rather a handler for your hook. the "hook" is when features.includes() gets called.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok got it, what if I rename all instances of "hook" to "handler"?

Copy link

codecov bot commented Dec 11, 2024

Bundle Report

Changes will increase total bundle size by 89.16kB (0.28%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
app-webpack-bundle-array-push 32.11MB 89.16kB (0.28%) ⬆️

aliu39 added a commit to getsentry/sentry-javascript that referenced this pull request Dec 16, 2024
…#14741)

This isn't exported in types-hoist/index, but we found users can still
import it from a `build/` file. Discussed with @billyvg we don't want
users to accidentally import it this way.

Note we currently use this type in sentry, until
getsentry/sentry#81954 is rolled out.
@aliu39 aliu39 merged commit 977fe77 into master Dec 16, 2024
43 checks passed
@aliu39 aliu39 deleted the aliu/use-js-flags-integration branch December 16, 2024 19:09
evanh pushed a commit that referenced this pull request Dec 17, 2024
…vals (#81954)

Re-opening https://github.com/getsentry/sentry/pull/81159/files after
releasing a custom flag tracking integration in JS SDK 8.43. WIth this
integration, we don't need to manage our own buffer in featureObserver
anymore. Sentry employees shouldn't notice any changes, this is a
proof-of-concept for the new SDK.

The SDK has its own tests already, so I'm only unit testing the
add(__)FeaturesHook fxs.

Manually tested with dev-ui sending to a test org:
https://andrew-onboarding.sentry.io/share/issue/664703eb3a98441b8a203dc44e803cee/
@github-actions github-actions bot locked and limited conversation to collaborators Jan 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants