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/v8): Add Unleash integration #14948

Open
wants to merge 23 commits into
base: v8
Choose a base branch
from
Open

feat(flags/v8): Add Unleash integration #14948

wants to merge 23 commits into from

Conversation

aliu39
Copy link
Member

@aliu39 aliu39 commented Jan 8, 2025

Ref https://github.com/getsentry/team-replay/issues/514. Adds an integration for tracking Unleash flag evaluations, by patching the isEnabled method prototype.
Ref https://develop.sentry.dev/sdk/expected-features/#feature-flags

@aliu39 aliu39 marked this pull request as ready for review January 10, 2025 00:05
Copy link

codecov bot commented Jan 15, 2025

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
634 4 630 303
View the top 3 failed tests by shortest run time
tracing/request/fetch/test.ts should create spans for fetch requests
Stack Traces | 10.1s run time
test.ts:7:11 should create spans for fetch requests
tracing/metrics/web-vitals/test.ts captures time origin and navigation activationStart as span attributes
Stack Traces | 30s run time
test.ts:62:11 captures time origin and navigation activationStart as span attributes
tracing/dsc-txn-name-update/test.ts updates the DSC when the txn name is updated and high-quality
Stack Traces | 30s run time
test.ts:12:11 updates the DSC when the txn name is updated and high-quality

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

@aliu39 aliu39 requested a review from billyvg January 15, 2025 18:54
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

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

Looks good, would you want to point that PR at develop and backport it to v8 maybe?

@aliu39 aliu39 changed the title feat(flags): add Unleash integration feat(flags): add Unleash integration (v8) Jan 16, 2025
@aliu39
Copy link
Member Author

aliu39 commented Jan 16, 2025

Looks good, would you want to point that PR at develop and backport it to v8 maybe?

@chargome Sounds good! I opened #15036

Comment on lines +60 to +61
original: (this: UnleashClient, ...args: unknown[]) => unknown,
): (this: UnleashClient, ...args: unknown[]) => unknown {
Copy link
Member

Choose a reason for hiding this comment

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

Does this affect typescript at all after we wrap it?

e.g. does your IDE still show the right types after we load this integration?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I installed w/yalc, and this is what I get for the wrapped method (same as original):
Screenshot 2025-01-16 at 10 32 58 AM

Copy link
Member Author

Choose a reason for hiding this comment

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

Constructor (UnleashClientClass) type was too general and raised lint though, pushing a commit

Comment on lines +18 to +22
* const unleashIntegration = Sentry.unleashIntegration({unleashClientClass: UnleashClient});
*
* Sentry.init({
* dsn: '___PUBLIC_DSN___',
* integrations: [unleashIntegration],
Copy link
Member

Choose a reason for hiding this comment

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

Maybe simplify this

Suggested change
* const unleashIntegration = Sentry.unleashIntegration({unleashClientClass: UnleashClient});
*
* Sentry.init({
* dsn: '___PUBLIC_DSN___',
* integrations: [unleashIntegration],
* Sentry.init({
* dsn: '___PUBLIC_DSN___',
* integrations: [Sentry.unleashIntegration({unleashClientClass: UnleashClient})],

@lforst lforst changed the title feat(flags): add Unleash integration (v8) feat(flags/v8): Add Unleash integration Jan 16, 2025
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