-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(flags): document python UnleashIntegration #12216
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
Changes from 7 commits
fe943f6
f5ecd05
f91ef93
92ed334
09b3ff6
2c5e06c
4c72a14
64ccd98
ac250c5
61ec075
a4f66f4
8550c48
0c32482
a0d849b
d405816
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,73 @@ | ||||||
| --- | ||||||
| title: Unleash | ||||||
| description: "Learn how to use Sentry with Unleash." | ||||||
| --- | ||||||
|
|
||||||
| <PlatformContent includePath="feature-flags/prerelease-alert" /> | ||||||
|
|
||||||
| The [Unleash](https://www.getunleash.io/) integration tracks feature flag evaluations produced by the Unleash SDK. These evaluations are held in memory and sent to Sentry for review and analysis if an error occurs. **At the moment, we only support boolean flag evaluations.** | ||||||
|
|
||||||
| ## Install | ||||||
|
|
||||||
| Install `sentry-sdk` (>=TODO:) and `UnleashClient` (>=6.0.1) from PyPI. | ||||||
|
|
||||||
| ```bash | ||||||
| pip install --upgrade sentry-sdk UnleashClient | ||||||
| ``` | ||||||
|
|
||||||
| ## Configure | ||||||
|
|
||||||
| Add `UnleashIntegration` to your `integrations` list: | ||||||
|
|
||||||
| ```python | ||||||
| import sentry_sdk | ||||||
| import os | ||||||
|
|
||||||
| from sentry_sdk.integrations.unleash import UnleashIntegration | ||||||
| from UnleashClient import UnleashClient | ||||||
|
|
||||||
| unleash_client = UnleashClient( | ||||||
| url="<Unleash server URL>/api/", # "http://localhost:4242/api/" if you are self-hosting Unleash | ||||||
| app_name="my-app", # Identifies your app in the Unleash UI | ||||||
| custom_headers={ | ||||||
| "Authorization": os.environ["UNLEASH_CLIENT_API_TOKEN"] # See 'client token' docs | ||||||
aliu39 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| } | ||||||
| ) | ||||||
|
|
||||||
| unleash_integration = UnleashIntegration(unleash_client) | ||||||
cmanallen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| sentry_sdk.init( | ||||||
| dsn="___PUBLIC_DSN___", | ||||||
| integrations=[unleash_integration], | ||||||
antonpirker marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| ) | ||||||
| ``` | ||||||
|
|
||||||
| For more information on how to use Unleash, read Unleash's [Python reference](https://docs.getunleash.io/reference/sdks/python) and [quickstart guide](https://docs.getunleash.io/quickstart). | ||||||
|
|
||||||
| ## Verify | ||||||
|
|
||||||
| The integration is tested by evaluating a feature flag using your Unleash SDK before capturing an exception. | ||||||
|
||||||
| The integration is tested by evaluating a feature flag using your Unleash SDK before capturing an exception. | |
| Test the integration by evaluating a feature flag using your Unleash SDK before capturing an exception. |
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.
This would apply to other python FF docs too
Outdated
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.
a link into /issues would be good here.
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.
Same as above, this would apply to other python FF docs too
Uh oh!
There was an error while loading. Please reload this page.