Skip to content

Commit ceebc60

Browse files
authored
Merge branch 'master' into sergical/faster-builds
2 parents 634b053 + 4b5cbc3 commit ceebc60

File tree

264 files changed

+4837
-4799
lines changed

Some content is hidden

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

264 files changed

+4837
-4799
lines changed

develop-docs/development-infrastructure/environment/index.mdx

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
title: Environment
3-
description: This guide steps you through configuring a local development environment for the Sentry server on macOS and Linux.
3+
description: This guide steps you through configuring a local development environment for the Sentry server on macOS.
44
sidebar_order: 2
55
---
66

7-
If you're using
8-
another operating system (Plan 9, BeOS, Windows, …) the instructions are still roughly the same, but we don't maintain any official documentation
9-
for anything else for now.
7+
We primarily support development on macOS (arm64 only), but Linux (amd64) should be possible too.
8+
If you run into any problems on either platform, please open an issue on [devenv](https://github.com/getsentry/devenv/).
9+
1010

1111
## Setup
1212

@@ -16,11 +16,17 @@ After installation you should be able to run `devenv bootstrap` which will guide
1616

1717
When you're done with setup, you'll want to also review the <Link to="/development/workflow/">development workflow</Link>.
1818

19+
1920
## Keeping your environment up-to-date
2021

21-
Simply run `devenv sync` inside of your sentry or getsentry repo.
22+
First make sure your branch is rebased or remerged onto latest `master`.
23+
24+
Running `devenv sync` (which runs `devenv/sync.py`) will bring your environment up-to-date (dependencies, migrations, etc.).
25+
26+
You may also need to run `direnv allow` if you haven't already (sometimes it's easy to miss the prompt).
27+
28+
Any issues? See [troubleshooting](#troubleshooting).
2229

23-
NOTE: After running `devenv sync` you may need to restart your terminal to continue.
2430

2531
## Running the Development Server
2632

@@ -94,9 +100,11 @@ After the server is running we can visit the dev server using `https` at port `:
94100

95101
See also: <Link to="/application/sentry-vs-getsentry/">Sentry vs Getsentry</Link>
96102

97-
Before running `getsentry`, you might need to run `devenv sync` inside the `getsentry` directory if you have previously run `sentry` locally, as there might be differences between the environments.
103+
To set up and keep getsentry up to date, you need to run `devenv sync` inside `sentry` before you run `devenv sync` inside `getsentry`.
104+
105+
`getsentry` depends on what commit `../sentry` is checked out to, so keeping your sentry repo up to date is important.
98106

99-
Just like running `sentry` (see above), you can start the `devservices` using the following command in the `getsentry` folder:
107+
Just like running `sentry` (see above), you can start the `devservices` using the following command in the `getsentry` repo:
100108

101109
```shell
102110
devservices up
@@ -120,7 +128,9 @@ After that, you can start the development server inside the `getsentry` folder:
120128
devservices serve
121129
```
122130

123-
**Note**: You **cannot** have both sentry and getsentry devserver running at the same time.
131+
<Alert title="Note">
132+
You **cannot** have both sentry and getsentry devserver running at the same time.
133+
</Alert>
124134

125135
After the server warms up, access it at [http://dev.getsentry.net:8000](http://dev.getsentry.net:8000/). Using localhost won't work. Note that the **http** protocol is used, not **https**. If you encounter a certificate error while accessing it locally, it might be because your browser has remembered that `dev.getsentry.net` previously used the https protocol (possibly while running `pnpm dev-ui`) and is now redirecting all http requests to https. To resolve this, open the site in an **incognito window** of your browser.
126136

@@ -175,7 +185,7 @@ SENTRY_SILO_DEVSERVER=1 SENTRY_SILO_MODE=REGION SENTRY_REGION=us getsentry djang
175185

176186
## Troubleshooting
177187

178-
The more up-to-date troubleshooting docs for the internal development environment on MacOS are <Link to="https://www.notion.so/sentry/devenv-troubleshooting-1448b10e4b5d8080ba04f452e33de48d">here</Link>.
188+
The more up-to-date troubleshooting docs for the _internal_ development environment on MacOS are <Link to="https://www.notion.so/sentry/devenv-troubleshooting-1448b10e4b5d8080ba04f452e33de48d">here</Link>.
179189

180190
You might also be interested in <Link to="/development/continuous-integration/#troubleshooting-ci">Troubleshooting CI</Link>.
181191

develop-docs/development-infrastructure/python-dependencies.mdx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,26 @@ data if they turn out to be malicious.
1414

1515
Any new dependency needs to be thoroughly reviewed and approved by [owners-python-build](https://github.com/orgs/getsentry/teams/owners-python-build/members). This group is already automatically tagged in your PR to `sentry` or `getsentry` as soon as you edit relevant files. For other repos you might need to do it manually.
1616

17+
Dependencies must:
18+
- be on [internal pypi](https://github.com/getsentry/pypi)
19+
- not be added to repos as non-specifier requirements (see sentry's `tools/lint_requirements.py`)
20+
1721
To add or update a dependency:
1822

1923
1. Clone https://github.com/getsentry/pypi/.
2024
2. `cd` into your clone and run `python3 -m add_pkg PKGNAME` (or `python3 -m add_pkg PKGNAME==PKGVERSION` if you want a version other than the latest).
2125
3. Commit the resulting changes to a branch, open a PR in `getsentry/pypi`, and tag someone on your team (any engineer can approve PRs on this repo).
2226
4. Once your PR is merged, go back to the main repo whose dependencies you want to change (`sentry`, `getsentry`, etc.).
23-
5. In that repo, add to or update the dependency in `pyproject.toml`.
27+
5. In that repo, add to or update the dependency in `pyproject.toml` (or `requirements*.txt` if the repo isn't [using `uv` yet](https://www.notion.so/Standard-Spec-python-uv-2248b10e4b5d8045b8fff30f8b8b67ca)).
2428
- In sentry, you can do this with the [bump-version action](https://github.com/getsentry/sentry/actions/workflows/bump-version.yml).
2529
- Click the **Run workflow** dropdown.
2630
- Fill in your package name and version.
2731
- Click the **Run workflow** button.
28-
- Some projects are still using `requirements*.txt`, in which case update those files.
29-
- The eventual goal is that every python project will [use `uv` to lock python dependencies](https://www.notion.so/Standard-Spec-python-uv-2248b10e4b5d8045b8fff30f8b8b67ca).
30-
- Note that dependencies should pinned with lower bounds only, to encourage updating to latest versions.
32+
33+
<Alert level="warning" title="Note">
34+
Dependencies should pinned with lower bounds `>=`, to encourage updating to latest versions.
35+
</Alert>
36+
3137
6. Run `make freeze-requirements` (or `uv lock`). You might need to wait a few minutes for the changes to `getsentry/pypi` to be deployed before this will work without erroring.
3238
7. Commit your changes (which should consist of changes to both one of the `requirements` files and its corresponding lockfile) to a branch and open a PR in the relevant repo. If it's not obvious, explain why you're adding or updating the dependency. Tag `owners-python-build` if they haven't already been auto-tagged.
3339
8. Merge your PR, pull `master`, and run `devenv sync`.
@@ -36,15 +42,12 @@ To add or update a dependency:
3642
## Depending on forks
3743

3844
If you need to make modifications to a dependency and need to deploy the result
39-
before it is accepted upstream, you can fork the dependency.
45+
before it is accepted upstream, you must fork the dependency and publish it to pypi and internal pypi.
4046

41-
Depending on forks is generally discouraged unless necessary, and you should
42-
make sure that the changes in your fork are **not required for self-hosted to
43-
function,** because they won't be included in the PyPI distribution of Sentry.
47+
1. Fork into the `getsentry` organization and make your changes.
48+
2. Add craft configuration to publish to pypi+internal pypi ([example](https://github.com/getsentry/sentry-forked-djangorestframework-stubs/pull/1)).
49+
3. Add the dependency to your repository.
4450

45-
1. Fork into the `getsentry` organization.
46-
2. Depend on the fork using `library-name @ https://github.com/getsentry/<repo>/archive/<40 char sha>.zip` in `getsentry`'s `requirements-base.txt`.
47-
3. The requirement in `sentry` stays the same, because we upload `sentry` to PyPI, and PyPI does not allow us to depend on URLs.
4851

4952
## Unclear?
5053

develop-docs/frontend/using-rtl.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ As a part of this goal, we avoid testing implementation details so refactors (ch
2020
We are generally in favor of Use Case Coverage over Code Coverage.
2121

2222
## Use our built-in contexts
23-
By default, `render()` has some default contexts setup for you. The organization context is set to `OrganizationFixture()` and the router context has some default params like orgId and projectId. These can be overriden by passing a proptery to the 2nd argument of the `render()` function.
23+
By default, `render()` has some default contexts setup for you. The organization context is set to `OrganizationFixture()` and the router context has some default params like orgId and projectId. These can be overriden by passing a property to the 2nd argument of the `render()` function.
2424

2525
Example of overriding the default organization features and access:
2626
```tsx
-14.4 KB
Loading

develop-docs/integrations/msteams/index.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@ You will need to be a Microsoft Teams Administrator to perform some of the requi
1414

1515
1. Visit the [Developer Portal](https://dev.teams.microsoft.com/apps). Note: You may have to sign up for the [MS 365 Developer Program](https://developer.microsoft.com/en-us/microsoft-365/dev-program) if you're having trouble accessing this.
1616
2. Click "New App".
17-
3. Name your app (something specific to you to make it easier to find, e.g. `Bob's Sentry`).
17+
3. Name your app (if you're an employee, add your name, `{Your Name}'s Sentry`).
1818
4. Under "Basic Information" use the following values (all other fields are optional and may be left blank):
1919

2020
| Setting | Value |
2121
| ------------------------- | --------------------------- |
2222
| Short description | enter anything |
2323
| Long description | enter anything |
2424
| Developer or company name | Sentry |
25-
| Website | https://www.sentry.io |
25+
| Website | https://sentry.io |
2626
| Privacy policy | https://sentry.io/privacy/ |
27-
| Terms of use | https://www.sentry.io/terms/|
27+
| Terms of use | https://sentry.io/terms/ |
2828

2929

30-
5. Hit "Save" at the bottom of the page.
31-
6. On the left hand sidebar click "App features" >> "Bot" >> "Create a new bot" >> "New bot". You may name this whatever you like.
30+
5. Hit **Save** at the bottom of the page.
31+
6. On the left hand sidebar click **App features** >> **Bot** >> **Create a new bot** >> **New bot**. You may name this whatever you like.
3232
7. Enter the bot endpoint address as `{YOUR_DOMAIN}/extensions/msteams/webhook/` and hit "Save". Take note of your bot ID (shown in the URL, e.g. https://dev.teams.microsoft.com/bots/{BOT-ID}/configure).
33-
8. Go to "Client secrets" and create a secret. Copy the secret as we'll use it later on.
34-
9. To go back, click "Apps" >> Sentry >> "App features" >> "Bot". Then choose the bot you just created from the "Select an existing bot" dropdown.
35-
10. Enable your bot to "Only send notifications (one-way conversations)" and select "Personal" and "Team" as the scopes.
33+
8. Go to **Client secrets** and create a secret. Copy the secret as we'll use it later on.
34+
9. To go back, click **Apps** >> _Your App Name_ >> **App features** >> **Bot**. Then choose the bot you just created from the "Select an existing bot" dropdown.
35+
10. Enable your bot to "Only send notification" and select "Personal" and "Team" as the scopes.
3636

3737
![Microsoft Teams Bot Settings](./bot-settings.png)
3838

39-
11. Click "Add a command" and call it anything you like (e.g. `/sentry`). Give your command a description, select "Personal" and "Team" as the scopes, then click "Add".
39+
11. Click **Create your first activity bot command**. If you're an employee, use a unique command name such as `/{name}-sentry`, otherwise `/sentry` is fine. Give your command a description, select *Personal* and *Team* as the scopes, then click **Add**.
4040

4141
![Microsoft Teams Bot Add a Command](./add-bot-command.png)
4242

develop-docs/sdk/data-model/envelope-items.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,10 @@ _None_
457457

458458
_None_
459459

460+
### Spans
461+
462+
For Version 2 of the spans protocol, see <Link to="/sdk/telemetry/spans/span-protocol">Span Protocol</Link>.
463+
460464
### Reserved Types
461465

462466
Reserved types may not be written by any implementation. They are reserved for

develop-docs/sdk/data-model/event-payloads/stacktrace.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ follow this rule of thumb:
2626
ordered from caller to callee, or oldest to youngest. The last frame is the
2727
one creating the exception.
2828

29+
In cases where the event payload is oversized (for instance, for recursion / stackoverflow errors),
30+
some SDKs truncate the frames to make sure the event gets sent and is not dropped completely.
31+
The recommended way to truncate in this case is take 500 frames on both sides so that Relay can further truncate on both sides as it wishes.
32+
2933
`registers`
3034

3135
: _Optional_. A map of register names and their values. The values should

develop-docs/sdk/expected-features/data-handling.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ Fields in the event payload that allow user-specified or dynamic values are rest
121121
- Messages are limited to 8192 characters.
122122
- HTTP data (the body) is limited to 8kB. Always trim HTTP data before attaching it to the event.
123123
- Stack traces are limited to 50 frames. If more are sent, data will be removed from the middle of the stack.
124+
- Input messages in AI integrations recorded in the span attribute `gen_ai.request.messages` are limited to 20kB per span. Messages are trimmed and truncated if they exceed the limit, retaining the most recent messages.
124125

125126
Additionally, size limits apply to all store requests for the total size of the request, event payload, and attachments. Sentry rejects all requests exceeding these limits. Please refer the following resources for the exact size limits:
126127

develop-docs/sdk/miscellaneous/hub_and_scope_refactoring.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Hubs and scopes is a complicated system, that can easily be misused (also see [h
3131

3232
## B) What Is the Outcome of the Refactoring?
3333

34-
1. The SDKs model of Scope forking is aligned with the one from OTel. Paving the way for making it possble to use OTel tooling for performance monitoring and still see their data in Sentry. (And Sentry error events are still connected to the spans captured by OTel).
34+
1. The SDKs model of Scope forking is aligned with the one from OTel. Paving the way for making it possible to use OTel tooling for performance monitoring and still see their data in Sentry. (And Sentry error events are still connected to the spans captured by OTel).
3535
2. The new Scopes API is implemented in the API and can be used.
3636
3. The old `Hub` based API still works as expected for backwards compatibility. After a transition phase the `Hub` will be removed in a major update of the SDK.
3737

develop-docs/sdk/philosophy.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ At no point should a customer upgrade the library and find themselves in a situa
4949

5050
## Enable Customers
5151

52-
While we generally should try to keep the API surfaces of SDKs reasonable small. At the same time we also need to make sure that we enable customers to achieve their goals. Think about cases that the SDK maybe wouldn't be able to solve out of the box. If there are enough APIs that customers can use our SDKs in more creative ways, we generally see this as a added benefit.
52+
While we generally should try to keep the API surfaces of SDKs reasonable small. At the same time we also need to make sure that we enable customers to achieve their goals. Think about cases that the SDK maybe wouldn't be able to solve out of the box. If there are enough APIs that customers can use our SDKs in more creative ways, we generally see this as an added benefit.
5353

5454
## Handle PII and Sensitive Data with Care
5555

0 commit comments

Comments
 (0)