Skip to content

Commit 6e47511

Browse files
kneeyo1lucas-zimerman
authored andcommitted
Cleaning up the options documentation to prevent future confusion (#14419)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## 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. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [ x ] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> 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 - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
1 parent 1fcc0ef commit 6e47511

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

develop-docs/backend/application-domains/options.mdx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ sidebar_order: 10
55

66
Options are a way to store generic system-wide configuration. They serve a similar purpose to configuration files, but they are backed by a database, so it's possible to change them at runtime without a deploy. Options are stored in the database and cached, so they are performant and reliable. This makes options well-suited for rates, quotas, and limits.
77

8+
While the process for creating and using options in the codebase is universal, the method for *managing their values* differs between Sentry's internal SaaS platform and self-hosted instances.
9+
10+
> **For Sentry Employees**
11+
>
12+
> Option management for Sentry's internal SaaS environments is handled via a GitOps workflow. All changes to option values are proposed, reviewed, and deployed through pull requests. For complete details on changing values, handling drift, and deployment, please see the **[sentry-options-automator](https://github.com/getsentry/sentry-options-automator)** repository.
13+
814
## Adding New Options
915

10-
To add a new system option, add it to [`sentry/options/defaults.py`](https://github.com/getsentry/sentry/blob/master/src/sentry/options/defaults.py) by registering it. e.g.,
16+
The process for registering a new option is the same for all environments and is done in the Sentry codebase. Add your option to [`sentry/options/defaults.py`](https://github.com/getsentry/sentry/blob/master/sentry/options/defaults.py).
1117

1218
```python
1319
register("performance.some-feature-rate", default=0.0)
@@ -23,24 +29,23 @@ Follow these rules when adding new options:
2329
The value of an option can be any pickleable value.
2430

2531
<Alert>
26-
It is safe to declare and use an option in the same pull request, you don't need to
27-
split them up.
32+
It is safe to declare and use an option in the same pull request; you don't need to split them up.
2833
</Alert>
2934

3035
## Using Options
36+
To check the value of an option, import the options module and use the get method. This is universal across all environments.
3137

32-
To check the value of an option, import the `options` module and use the `get` method. e.g.,
3338

3439
```python
3540
from sentry import options
3641
feature_rate = options.get("performance.some-feature-rate")
3742
```
3843

3944
## Setting Options
40-
41-
You can change the value of an option using `sentry shell`, or by using the [options UI](#options-ui).
45+
For self-hosted instances, you can change the value of an option using `sentry shell`, or by using the [options UI](#options-ui).
4246

4347
### Sentry Shell
48+
For direct database manipulation, you can set option values using sentry shell.
4449

4550
You can set option values using `sentry shell`. e.g.,
4651

@@ -110,7 +115,9 @@ def test_some_feature(self):
110115

111116
## Removing Options
112117

113-
If your option is short-lived, you should remove it once it's no longer needed. First, create a pull request to remove the option and its usage. Once it's merged and deployed, remove the option from the database. To do this, you can use the Sentry shell. e.g.,
118+
If your option is short-lived, you should remove it once it's no longer needed. First, create a pull request to remove the option and its usage. Once it's merged and deployed, remove the option from the database. For self-hosted instances, this is done via the Sentry shell. Otherwise, remove it from the Options Automator repository.
119+
120+
For self hosted instances, you can use the Sentry shell. e.g.,
114121

115122
```bash
116123
sentry shell
@@ -122,8 +129,3 @@ then,
122129
from sentry import options
123130
options.delete("performance.some-feature-rate")
124131
```
125-
126-
<Alert>
127-
If you do not have access to the shell, you'll need to contact OPS to remove the option
128-
for you.
129-
</Alert>

0 commit comments

Comments
 (0)