Skip to content

Commit e7bff6c

Browse files
authored
Merge branch 'master' into aliu/ff-integration-doc-python
2 parents c43046d + 764e66f commit e7bff6c

File tree

136 files changed

+1981
-193
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+1981
-193
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,6 @@
5151
# /src/platforms/javascript/common/session-replay/ @getsentry/replay @getsentry/replay-sdk-web
5252
# /src/wizard/javascript/replay-onboarding/ @getsentry/replay @getsentry/replay-sdk-web
5353

54+
# /src/docs/product/dev-toolbar/ @getsentry/replay
55+
5456
# ###### End Replays #######

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ We use Next.js, `yarn` and `volta` to manage the environment.
1111
```
1212
cp .env.example .env.development
1313
yarn
14+
15+
# Start dev server for user docs
1416
yarn dev
17+
18+
# Start dev server for developer docs
19+
yarn dev:developer-docs
1520
```
1621

1722
With that, the repo is fully set up and you are ready to open local docs under http://localhost:3000

develop-docs/application-architecture/feedback-architecture.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ event[”contexts”][”feedback”] = {
6868

6969
- This doc refers to the payload format (`event` in the pseudo-code above) as a “**feedback event”**.
7070
- The feedback [widget](https://docs.sentry.io/platforms/javascript/user-feedback/#user-feedback-widget), which is installed by default, sends these envelopes.
71-
- API: for SDK v8.0.0+, we use the `sendFeedback` function.
71+
- SDK API: to manually capture feedback, use `captureFeedback()`. [Example for Javascript v8+](https://docs.sentry.io/platforms/javascript/user-feedback/#user-feedback-api). This function still needs
72+
to be implemented for most platforms.
7273
<br />
7374
<br />
7475

develop-docs/backend/application-domains/database-migrations/index.mdx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -440,28 +440,30 @@ With postgres 14, columns can be added to tables of all sizes as deploy time
440440
migrations if you follow the guidelines on default values & allowing nulls. When
441441
creating new columns they should either be:
442442

443-
- Not null with a default. https://develop.sentry.dev/database-migrations/#adding-not-null-to-columns
443+
- Not null with a default
444444
- Created as nullable. If no default value can be set on the column, then it's best just to make it nullable.
445445

446+
For nullable columns with a constraint and not null columns with a default, see [Adding Constraints to Columns](#adding-constraints-to-columns-including-not-null). For bigger tables, these constraints can lock the table and cause downtime.
447+
448+
446449
### Adding Columns With a Default
447450

448451
Since we run Postgres >= 14 in production we are able to add columns with a default. To do so, instead of using `default=<your_default>`, use `db_default=<your_default>`. This tells Django to set a default at the database level and manage it there, rather than managing it in application code.
449452

450453
We can't use `default` because Django's default behaviour for creating a new not null column with a default is dangerous. When using default, in the migration Django will add the default to backfill all fields, then immediately remove it so that it can handle them in the app layer. This means that during a deploy, the column is sitting in production without a default until all code rolls out, which means that inserts will fail for this table until the deploy completes.
451454

452-
### Adding Not Null To Columns
455+
### Adding Constraints to Columns (Including Not Null)
453456

454-
It can be dangerous to add not null to columns, even if there is data in every row of the table for that column. This is because Postgres still needs to perform a not null check on all rows before it can add the constraint. On small tables this can be fine since
455-
the check will be quick, but on larger tables this can cause downtime. There are a few options here to make this safe:
457+
It can be dangerous to add constraints to columns, whether they are new or existing columns, even if the data in every row of the table does not violate the constraint. This is because Postgres still needs to perform a constraint check on all rows before it can add the constraint. On small tables this can be fine since the check will be quick, but on larger tables this can cause downtime. There are a few options here to make this safe:
456458

457459
```sql
458-
ALTER TABLE tbl ADD CONSTRAINT cnstr CHECK (col IS NOT NULL) NOT VALID;
460+
ALTER TABLE tbl ADD CONSTRAINT cnstr CHECK (col IS NOT NULL) NOT VALID; -- example with a not null constraint
459461
ALTER TABLE tbl VALIDATE CONSTRAINT cnstr;
460462
```
461463

462-
One approach is to create the constraint as not valid. Then we validate it afterwards. We still need to scan the whole table to validate, but we only need to hold a `SHARE UPDATE EXCLUSIVE` lock, which only blocks other `ALTER TABLE` commands, but will allow reads/writes to continue. This works well, but has a slight performance penalty of 0.5-1%. After Postgres 12 we can extend this method to add a real `NOT NULL` constraint.
464+
One approach is to create the constraint as not valid. Then we validate it afterwards. We still need to scan the whole table to validate, but we only need to hold a `SHARE UPDATE EXCLUSIVE` lock, which only blocks other `ALTER TABLE` commands, but will allow reads/writes to continue. This works well, but has a slight performance penalty of 0.5-1%. After Postgres 12 we can extend this method to add the real constraint.
463465

464-
Alternatively, if the table is small enough and has low enough volume it should be safe to just create a normal `NOT NULL` constraint. Small being a few million rows or less.
466+
Alternatively, if the table is small enough and has low enough volume it should be safe to just create the constraint as is. Small being a few million rows or less.
465467

466468
### Altering Column Types
467469

develop-docs/backend/application-domains/feature-flags/flagpole.mdx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ options:
228228
rollout: 100
229229
```
230230

231-
You can push your feature option to your local devserver using the following `getsentry` CLI command:
231+
You can push your feature option to your local devserver using the following `getsentry configoptions` CLI command:
232232

233233
```bash
234234
getsentry configoptions -f <path>/<to>/<your>/<config>.yml -l DEBUG patch
@@ -240,3 +240,10 @@ you remove the feature option.
240240

241241
To unset your feature, comment out or remove your feature config from the
242242
`option` object, and rerun the `getsentry configoptions` command above.
243+
244+
## Removing Flagpole features
245+
246+
Because our options automator CI relies on the feature definitions in both Sentry and GetSentry, flags must be removed in a specific order to avoid causing test failures:
247+
1. Remove all flag checks from the codebase and set a default value of `True` for the flag.
248+
2. Once all flag checks have been removed and the changes have been deployed to all environments, remove the feature flag config from options automator.
249+
3. Remove the [feature registration](#rolling-out-a-new-flagpole-feature) from GetSentry or Sentry.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Snuba
3+
description: A service that provides a rich data model on top of Clickhouse together with a fast ingestion consumer and a query optimizer.
4+
---
5+
6+
Repository: https://github.com/getsentry/snuba
7+
8+
Documentation: https://getsentry.github.io/snuba/
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Symbolic
3+
description: A library written in Rust for symbolication of native stack traces and more.
4+
---
5+
6+
Repository: https://github.com/getsentry/symbolic
7+
8+
Documentation: https://docs.rs/symbolic/latest/symbolic/

0 commit comments

Comments
 (0)