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 LaunchDarkly integration #14207

Open
wants to merge 45 commits into
base: develop
Choose a base branch
from

Conversation

aliu39
Copy link
Member

@aliu39 aliu39 commented Nov 7, 2024

Notion doc summarizing our goal, constraints, and potential approaches: https://www.notion.so/sentry/Feature-Flags-JavaScript-SDK-1358b10e4b5d805288abe1a4fede75ed?pvs=4. This PR implements approach 1.

Ref

packages/types/src/context.ts Outdated Show resolved Hide resolved
/**
* Sentry integration for capturing feature flags from LaunchDarkly.
*
* See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
Copy link
Member Author

Choose a reason for hiding this comment

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

Section added by getsentry/sentry-docs#11746

Copy link

codecov bot commented Nov 12, 2024

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
649 2 647 29
View the top 2 failed tests by shortest run time
integrations/featureFlags/launchdarkly/withScope/test.ts Flag evaluations in forked scopes are stored separately.
Stack Traces | 0.195s run time
test.ts:9:11 Flag evaluations in forked scopes are stored separately.
integrations/featureFlags/launchdarkly/basic/test.ts Basic test with eviction, update, and no async tasks
Stack Traces | 0.227s run time
test.ts:8:11 Basic test with eviction, update, and no async tasks

To view more test analytics, go to the Test Analytics Dashboard
Got feedback? Let us know on Github

@aliu39 aliu39 requested review from billyvg, cmanallen, AbhiPrasad and a team November 12, 2024 15:29
@aliu39 aliu39 marked this pull request as ready for review November 12, 2024 17:44
@HofmannZ
Copy link

Will this also work for @launchdarkly/node-server-sdk?

@aliu39
Copy link
Member Author

aliu39 commented Nov 12, 2024

Will this also work for @launchdarkly/node-server-sdk?

No, because the LDInspectionFlagUsedHandler interface is not available for server side JS. This will work for the other client sdks though (react, node-client)

@HofmannZ
Copy link

Will this also work for @launchdarkly/node-server-sdk?

No, because the LDInspectionFlagUsedHandler interface is not available for server side JS. This will work for the other client sdks though (react, node-client)

Ah to bad, we were hoping we could use it with Next.js, but best practice is to use a combination of @launchdarkly/node-server-sdk and launchdarkly-react-client-sdk. (See: https://docs.launchdarkly.com/guides/infrastructure/nextjs).

Copy link
Member

@billyvg billyvg left a comment

Choose a reason for hiding this comment

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

aside from the nits, looks pretty good to me

@billyvg billyvg requested review from a team and andreiborza and removed request for a team November 12, 2024 21:26
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.

6 participants