Skip to content

Commit eddbdb0

Browse files
committed
Merge branch 'master' of github.com:getsentry/sentry-docs into smi/quick-start/nextjs
2 parents e183e6a + d833918 commit eddbdb0

File tree

87 files changed

+239
-89
lines changed

Some content is hidden

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

87 files changed

+239
-89
lines changed

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@
1212
"git.ignoreLimitWarning": true,
1313
"search.exclude": {
1414
"**/src/wizard/**": true
15-
}
15+
},
16+
"cSpell.words": [
17+
"laravel"
18+
]
1619
}

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ Some examples of data guarded by this flag:
2323
- On desktop applications
2424
- The username logged in the device is not included. This is often a person's name.
2525
- The machine name is not included, for example `Bruno's laptop`
26-
- SDKs don't set `{{auto}}` as `user.ip`. This instructs the server to keep the connection's IP address.
26+
- SDKs don't set `{{auto}}` as `user.ip_address`. This instructs the server to keep the connection's IP address.
2727
- Server SDKs remove the IP address of incoming HTTP requests.
2828

2929
Sentry server is always aware of the connecting IP address and can use it for logging in some platforms. Namely JavaScript and iOS/macOS/tvOS.
30-
All other platforms require the event to include `user.ip={{auto}}` which happens if `sendDefaultPii` is set to true.
30+
All other platforms require the event to include `user.ip_address={{auto}}` which happens if `sendDefaultPii` is set to true.
3131

3232
Before sending events to Sentry, the SDKs should invokes callbacks. That allows users to remove any sensitive data client-side.
3333

@@ -63,12 +63,16 @@ This helps Relay to know what kind of data it receives and this helps with scrub
6363
If query strings are present in the URL or fragments (Browser SDKs only) are present in the URI, both are set into the data attribute of the span.
6464

6565
```js
66-
span.setData({
66+
span.setAttributes({
6767
"http.query": url.getQuery(),
6868
"http.fragment": uri.getFragment(),
6969
});
7070
```
7171

72+
```python
73+
span.set_data("http.query", query)
74+
```
75+
7276
Additionally all semantic conventions of OpenTelementry for http spans should be set in the `span.data` if applicable:
7377
https://opentelemetry.io/docs/reference/specification/trace/semantic_conventions/http/
7478

@@ -86,7 +90,7 @@ If the `message` in a breadcrumb contains an URL it should be formatted the same
8690
If query strings are present in the URL or fragments (Browser SDKs only) are present in the URI, both should also be set in the data attribute like with `http` spans.
8791

8892
```js
89-
getCurrentHub().addBreadcrumb({
93+
Sentry.addBreadcrumb({
9094
type: "http",
9195
category: "xhr",
9296
data: {

develop-docs/sdk/telemetry/traces/index.mdx

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -228,24 +228,23 @@ A transaction's sampling decision should be passed to all of its children, inclu
228228

229229
To improve the likelihood of capturing complete traces when backend services use a custom sample rate via `tracesSampler`, the SDK propagates the same random value used for sampling decisions across all services in a trace. This ensures consistent sampling decisions across a trace instead of generating a new random value for each service.
230230

231-
If no `tracesSampler` callback is used, the SDK fully inherits sampling decisions for propagated traces, and the presence of `sample_rand` in the DSC doesn't affect the decision. However, this behavior may change in the future.
231+
The random value (`sample_rand`) is set according to the following rules:
232232

233-
The random value is set according to the following rules:
233+
1. When tracing is enabled and a new trace is started, the SDK generates a `sample_rand` value for the current execution context. A `sample_rand` is a float (`0.1234` notation) in the range of `[0, 1)` (including 0.0, excluding 1.0).
234+
1. It is _recommended_ to generate the random number deterministically using the trace ID as seed or source of randomness. The exact method by which the random number is created is implementation defined and may vary between SDK implementations.
235+
1. The `sample_rand` is part of the DSC (Dynamic Sampling Context) and as with other values on the `baggage` header, the `sample_rand` value from the current execution context should be propagated to downstream SDKs.
236+
1. On incoming traces, an SDK takes the incoming `sentry-sample_rand` value in the `baggage` header and uses it for the rest of the current execution context (e.g. request).
237+
1. If `sample_rand` is missing on an incoming trace, the SDK creates a new one applying **special rules** and uses it for the current execution context:
238+
1. If `sample_rate` (inside `baggage`) and the sampling decision (trailing `-1` or `-0` from the `sentry-trace` header) are present in the incoming trace, create `sample_rand` so that when compared to the incoming `sample_rate` it would lead to the same sampling decision that is in the `sentry-trace` header. This means, for a decision of `True` generate a random number in half-open range `[0, rate)` and for a decision of `False` generate a random number in range `[rate, 1)`.
239+
1. If the sampling decision is missing on the incoming trace, generate a random number in range of `[0, 1)` (including 0.0, excluding 1.0), like for a new trace.
234240

235-
1. When an SDK starts a new trace, `sample_rand` is always set to a random number in the range of `[0, 1)` (including 0.0, excluding 1.0). This explicitly includes traces that aren't sampled, as well as when the `tracesSampleRate` is set to `0.0` or `1.0`.
236-
2. It is _recommended_ to generate the random number deterministically using the trace ID as seed or source of randomness. The exact method by which the random number is created is implementation defined and may vary between SDK implementations. See 4. on why this behaviour is desirable.
237-
3. On incoming traces, an SDK assumes the `sample_rand` value along with the rest of the DSC, overriding an existing value if needed.
238-
4. If `sample_rand` is missing on an incoming trace, the SDK creates and from now on propagates a new random number on-the-fly, based on the following rules:
239-
1. If `sample_rate` and the sampling decision (from the `sentry-trace` header) are propgated, create `sample_rand` so that it adheres to the invariant. This means, for a decision of `True` generate a random number in half-open range `[0, rate)` and for a decision of `False` generate a random number in range `[rate, 1]`.
240-
2. If the sampling decision is missing, generate a random number in range of `[0, 1)` (including 0.0, excluding 1.0), like for a new trace.
241+
The SDK should always use the stored random number (`sentry-sample_rand`) for sampling decisions and should not directly rely on `math.random()` when deciding to sample or not:
241242

242-
The SDK should always use the stored random number (`sentry-sample_rand`) for sampling decisions and should no longer rely on `math.random()` or similar functions in tracing code:
243+
1. When the `tracesSampler` is invoked, the return value should be compared with `sample_rand`: `trace["sentry-sample_rand"] < tracesSampler(context)`
244+
1. When there is an incoming trace, the SDK fully inherits incoming sampling decisions from the `sentry-trace` header.
245+
1. Otherwise, when the SDK is the head of a trace (and `tracesSampleRate` is defined), the sampling is done comparing the `tracesSampleRate` with the `sample_rand`: `trace["sentry-sample_rand"] < config.tracesSampleRate`
243246

244-
1. When the `tracesSampler` is invoked, this also applies to the return value of traces sampler. That is, `trace["sentry-sample_rand"] < tracesSampler(context)`
245-
2. Otherwise, when the SDK is the head of a trace, this also applies to sample decisions based on `tracesSampleRate`. That is, `trace["sentry-sample_rand"] < config.tracesSampleRate`
246-
3. There is no more direct comparison with `math.random()` during the sampling process.
247-
248-
When using a `tracesSampler`, the proper way to inherit a parent's sampling decision is to return the parent's sample rate, instead of leaving the decision as a float (for example, 1.0). This way, Sentry can still extrapolate counts correctly.
247+
Something that should be documented for every SDK is the recommended way to use a `tracesSampler` to inherit the parent's sampling decision using the `parentSampleRate`. This way, Sentry can still extrapolate counts correctly:
249248

250249
```js
251250
tracesSampler: ({ name, parentSampleRate }) => {

develop-docs/self-hosted/geolocation.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ With this configuration file in place, subsequent runs of Sentry's `install.sh`
2424

2525
1. For the `web` service: **User Settings > Security > Session History** should display country code and region (for example, "US (CA)") underneath the IP addresses in the table.
2626

27-
It's normal to see the `sentry_self_hosted_geoipupdate_1` container exit soon after startup, since updating the geolocation database is a one-off batch process and not a long-running job.
27+
If you ever need to manually refresh the IP address geolocation database, you can run the following command:
28+
29+
```bash
30+
./install/geoip.sh
31+
```
2832

2933
## Upgrading
3034

develop-docs/self-hosted/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To put things simply, consider self-hosted as the Business plan without any soft
2525

2626
## Getting Started
2727

28-
Our recommendation is to download the [latest release of the self-hosted repository](https://github.com/getsentry/self-hosted/releases/latest), and then run `./install.sh` inside this directory. This script will take care of all the things you need to get started, including a base-line configuration, and then will tell you to run `docker compose up -d` to start Sentry. Sentry binds to port `9000` by default. You should be able to reach the login page at [http://127.0.0.1:9000](http://127.0.0.1:9000/).
28+
Our recommendation is to download the [latest release of the self-hosted repository](https://github.com/getsentry/self-hosted/releases/latest), and then run `./install.sh` inside this directory. This script will take care of all the things you need to get started, including a base-line configuration, and then will tell you to run `docker compose up --wait` to start Sentry. Sentry binds to port `9000` by default. You should be able to reach the login page at [http://127.0.0.1:9000](http://127.0.0.1:9000/).
2929

3030
To have easy maintainability for future upgrades, it is recommended to use Git workflow by cloning the self-hosted repository and check out to a specific CalVer tag. More about this on [Releases & Upgrading](/self-hosted/releases/).
3131

@@ -142,7 +142,7 @@ You very likely will want to adjust the default configuration for your Sentry in
142142

143143
1. **`sentry/enhance-image.sh`**—To install plugins and their dependencies or make other modifications to the Sentry base image, copy `sentry/enhance-image.example.sh` to `sentry/enhance-image.sh` and add necessary steps there. For example, you can use `apt-get` to install dependencies and use `pip` to install plugins. After making modifications to `sentry/enhance-image.sh`, run `./install.sh` again to apply them.
144144

145-
1. **Environment variables**—The available keys are defined in [.env](https://github.com/getsentry/self-hosted/blob/master/.env). Use some system-dependent means of setting environment variables if you need to override any of them. To avoid Git changes, simply create a file called `.env.custom` and insert your system-dependent environment variables there. In order to use this, please use `docker compose --env-file /path/to/.env.custom up -d`.
145+
1. **Environment variables**—The available keys are defined in [.env](https://github.com/getsentry/self-hosted/blob/master/.env). Use some system-dependent means of setting environment variables if you need to override any of them. To avoid Git changes, simply create a file called `.env.custom` and insert your system-dependent environment variables there. In order to use this, please use `docker compose --env-file /path/to/.env.custom up --wait`.
146146

147147
1. [Geolocation](/self-hosted/geolocation/) uses **a custom configuration file** to conform to the underlying technology.
148148

@@ -183,11 +183,11 @@ Please keep in mind to check the `.env` file for changes, when you perform an up
183183
For all Docker Compose commands, you should specify your `.env.custom`, otherwise the default `.env` file will be used. Some examples are:
184184

185185
```bash
186-
docker compose --env-file .env.custom up -d
186+
docker compose --env-file .env.custom up --wait
187187

188188
# You can also specify the original `.env` file as a fallback if the
189189
# environment variable doesn't exists on the `.env.custom` file.
190-
docker compose --env-file .env --env-file .env.custom up -d
190+
docker compose --env-file .env --env-file .env.custom up --wait
191191
```
192192

193193
### Enhance Sentry image

develop-docs/self-hosted/releases.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ We may have some updated configuration, especially for new features, so always c
3838

3939
If you have a `.env.custom` file, make sure to copy new environment variables from the `.env` file into the `.env.custom` file before running the install script.
4040

41-
Finally, to upgrade, run `./install.sh`. Upon completion, run `docker compose up -d` (or if you have `.env.custom` file, run `docker compose --env-file .env --env-file .env.custom up -d`).
41+
Finally, to upgrade, run `./install.sh`. Upon completion, run `docker compose up --wait` (or if you have `.env.custom` file, run `docker compose --env-file .env --env-file .env.custom up --wait`).
4242

4343
### Hard Stops
4444

develop-docs/self-hosted/troubleshooting/kafka.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ The _nuclear option_ is removing all Kafka-related volumes and recreating them w
7676
```
7777
4. Start the instance:
7878
```shell
79-
docker compose up -d
79+
docker compose up --wait
8080
```
8181
## Reducing disk usage
8282

docs/contributing/approach/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ If you're uncertain, [ask](https://github.com/getsentry/sentry-docs/issues).
3333
Keep these concepts in mind when contributing to docs:
3434

3535
1. Technical accuracy is our primary consideration. Our content helps every developer diagnose, fix, and optimize their code.
36-
2. Use inclusive language, which we discuss more fully [here](https://develop.sentry.dev/inclusion/).
36+
2. Use inclusive language, which we discuss more fully [here](https://develop.sentry.dev/getting-started/inclusive-language/).
3737
3. Feedback is a gift - share your PR so we can improve our content.
3838

3939
<PageGrid />

docs/platforms/flutter/enriching-events/viewhierarchy/index.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,31 @@ View hierarchy debugging is an opt-in feature. You can enable it as shown below:
2121

2222
<PlatformContent includePath="enriching-events/attach-viewhierarchy" />
2323

24+
### Customize View Hierarchy Capturing
25+
26+
<Note>
27+
28+
Requires SDK version `8.13.0` or higher.
29+
30+
</Note>
31+
32+
Capturing view hierarchies on Flutter is limited to once every 2 seconds by default to minimize performance impact. While this debounce interval is fixed, you can override individual capture decisions by implementing the `beforeCaptureViewHierarchy` option in your `SentryFlutterOptions`.
33+
34+
The `beforeCaptureViewHierarchy` option allows you to customize behavior based on event data so you can decide when to capture view hierarchy and when not to. For example, you can decide to only capture view hierarchy for fatal events:
35+
36+
```flutter {2-9}
37+
await SentryFlutter.init((options) {
38+
options.beforeCaptureViewHierarchy = (event, hint, debounce) async {
39+
// If debounce is active, skip capturing
40+
if (debounce) {
41+
return false;
42+
}
43+
// Capture if it's a fatal event
44+
return event.level == SentryLevel.fatal;
45+
};
46+
});
47+
```
48+
2449
## Viewing View Hierarchy Attachments
2550

2651
View hierarchies appear in the "Attachments" tab, where you can view all attachments, as well as associated events. Click the event ID to open the [Issue Details](/product/issues/issue-details) page of that specific event.

docs/platforms/javascript/common/configuration/integrations/prisma.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ supported:
2424

2525
<Alert level="info">
2626

27-
This integration only works in the Node.js and Bun runtimes.
27+
This integration only works in the Node.js and Bun runtimes. This integration only supports Prisma v5 at the current time. If you're interested in Prisma v6 support, please leave your thoughts on the [Prisma v6 tracking issue for the Sentry SDK](https://github.com/getsentry/sentry-javascript/issues/14793).
2828

2929
</Alert>
3030

@@ -51,3 +51,8 @@ Sentry.init({
5151
integrations: [Sentry.prismaIntegration()],
5252
});
5353
```
54+
55+
56+
## Supported Versions
57+
58+
- `prisma`: `>=5 <6`

0 commit comments

Comments
 (0)