-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
docs(flags): Add OpenFeature JS integration docs #11837
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
Bundle ReportChanges will increase total bundle size by 255 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
|
const client = OpenFeature.getClient(); | ||
client.addHooks(new OpenFeatureIntegrationHook()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More of a review to be done here: getsentry/sentry-javascript#14326
But could the integration itself do this? Since it's a "global" function that we're calling we could just auto register and avoid having the user do this bit of code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not without taking on a dependency. We either ask them to pass the client to us at integration init time (which may or may not be desired depending on their code's structure) or we ask them to register the hook explicitly. Just my two cents. Could be more options I don't know about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be Sentry.OpenFeatureIntegrationHook
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not without taking on a dependency.
I see so we're not shipping a @sentry/openfeature
here and this is the way?
It's not the easist set up but it does make our lives much easier for now at least (no additional package requirements)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah its just a browser integration so no extra install steps. I agree its not an ideal setup. But I don't think its unexpected setup friction either.
If one day the flag buffer is a property on the scope we could remove the integration registration step all together and just have people register the hook. Which would be a one line change on the customer's side rather than two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Talking about the integration init here being removed: https://github.com/getsentry/sentry-docs/pull/11837/files#diff-9f766b64b39c2a17b915efb1536f14ed4dede9c406a6e9fe920f1f1110ba7bcfR38
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this, I've left a few wording suggestions.
@@ -0,0 +1,51 @@ | |||
--- | |||
title: OpenFeature | |||
description: "Attaches recent OpenFeature feature flag evaluations to error event context." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: "Attaches recent OpenFeature feature flag evaluations to error event context." | |
description: "Learn how to attach Sentry's OpenFeature feature flag evaluations to error event context." |
|
||
_Import name: `Sentry.openFeatureIntegration` and `Sentry.OpenFeatureIntegrationHook`_ | ||
|
||
The [OpenFeature](https://https://openfeature.dev/) integration tracks feature flag evaluations produced by the OpenFeature SDK. These evaluations are held in memory and, in the event an error occurs, sent to Sentry for review and analysis. **At the moment, we only support boolean flag evaluations.** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The [OpenFeature](https://https://openfeature.dev/) integration tracks feature flag evaluations produced by the OpenFeature SDK. These evaluations are held in memory and, in the event an error occurs, sent to Sentry for review and analysis. **At the moment, we only support boolean flag evaluations.** | |
The [OpenFeature](https://openfeature.dev/) integration tracks feature flag evaluations produced by the OpenFeature SDK. These evaluations are held in memory and, if an error occurs, sent to Sentry for review and analysis. **At the moment, we only support boolean flag evaluations.** |
const client = OpenFeature.getClient(); | ||
client.addHooks(new Sentry.OpenFeatureIntegrationHook()); | ||
|
||
// Evaluating flags will record the result on the Sentry client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Evaluating flags will record the result on the Sentry client. | |
// When you evaluate flags, the result will be recorded by the Sentry client. |
## Options | ||
|
||
There are no setup options for this integration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Options | |
There are no setup options for this integration. | |
## Options | |
There are no setup options for this integration. |
Maybe it's better to just not have this section since there aren't any options?
|
||
</Alert> | ||
|
||
_Import name: `Sentry.openFeatureIntegration` and `Sentry.OpenFeatureIntegrationHook`_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should also add an alert saying this is in beta to match the other docs (same with the LD JS doc too)
i've been doing this:
<Alert level="info" title="Currently in Beta">
The support for **feature flag change tracking** and **feature flag evaluation tracking** is currently in beta.
</Alert>
looks like this got pulled into the big docs PR here: https://github.com/getsentry/sentry-docs/pull/12005/files#diff-9f766b64b39c2a17b915efb1536f14ed4dede9c406a6e9fe920f1f1110ba7bcf closing this so we can focus there. |
DESCRIBE YOUR PR
Tell us what you're changing and why. If your PR resolves an issue, please link it so it closes automatically.
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
SLA
Thanks in advance for your help!
PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes:
LEGAL BOILERPLATE
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.
EXTRA RESOURCES