Skip to content

Commit 0cfdcac

Browse files
committed
Merge branch 'master' into cmanallens/flags-spans-docs
2 parents 7115267 + e9195c7 commit 0cfdcac

File tree

93 files changed

+769
-234
lines changed

Some content is hidden

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

93 files changed

+769
-234
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Attachments
3+
sidebar_order: 20
4+
---
5+
6+
## View Hierarchy
7+
The Native SDK allows you to attach a `view-hierarchy.json` file that follows the structure described in [RFC#33](https://github.com/getsentry/rfcs/blob/main/text/0033-view-hierarchy.md). This is mainly meant for downstream SDKs (e.g., [sentry-godot](https://github.com/getsentry/sentry-godot/pull/143)).
8+
9+
10+
To add a view hierarchy attachment, the path to the file has to be configured when initializing the SDK. It will monitor the file and upload it along with any event or crash that is sent to Sentry:
11+
12+
```c
13+
sentry_options_add_view_hierarchy(options, "./view-hierarchy.json");
14+
```
15+
16+
17+
<Alert>
18+
When using `Crashpad` as the crash-capturing backend in the Native SDK, the file must have the exact name `view-hierarchy.json` to be parsed correctly by the ingestion pipeline.
19+
</Alert>
20+
21+
Along with the file appearing in the _Attachments_ tab, it is visualized on the issue as such:
22+
23+
<Include name="common-imgs/viewhierarchy-example" />

docs/platforms/dart/guides/flutter/index.mdx

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -96,54 +96,6 @@ Future<void> main() async {
9696
}
9797
```
9898

99-
```dart {tabTitle:With custom zone}
100-
import 'package:flutter/widgets.dart';
101-
import 'package:sentry_flutter/sentry_flutter.dart';
102-
103-
Future<void> main() async {
104-
// The SDK creates it's own custom zone on web for automatic error and breadcrumb tracking on web.
105-
// This could lead to zone mismatch errors if you needed to call `WidgetsBinding.ensureInitialized()` before Sentry in a cusom zone.
106-
// With `Sentry.runZonedGuarded` you still get convenient auto error and breadcrumb tracking and can also call `WidgetsBinding.ensureInitialized()` before Sentry.
107-
Sentry.runZonedGuarded(() async {
108-
WidgetsBinding.ensureInitialized();
109-
110-
// Errors before init will not be handled by Sentry
111-
112-
await SentryFlutter.init(
113-
(options) {
114-
options.dsn = '___PUBLIC_DSN___';
115-
// Adds request headers and IP for users, for more info visit:
116-
// https://docs.sentry.io/platforms/dart/guides/flutter/data-management/data-collected/ for more info
117-
options.sendDefaultPii = true;
118-
// ___PRODUCT_OPTION_START___ performance
119-
// Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
120-
// We recommend adjusting this value in production.
121-
options.tracesSampleRate = 1.0;
122-
// ___PRODUCT_OPTION_END___ performance
123-
// ___PRODUCT_OPTION_START___ profiling
124-
// The sampling rate for profiling is relative to tracesSampleRate
125-
// Setting to 1.0 will profile 100% of sampled transactions:
126-
// Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0
127-
options.profilesSampleRate = 1.0;
128-
// ___PRODUCT_OPTION_END___ profiling
129-
},
130-
appRunner: () => runApp(
131-
SentryWidget(
132-
child: MyApp(),
133-
),
134-
),
135-
);
136-
} (error, stackTrace) {
137-
// Automatically sends errors to Sentry, no need to do any
138-
// captureException calls on your part.
139-
// On top of that, you can do your own custom stuff in this callback.
140-
});
141-
142-
// you can also configure SENTRY_DSN, SENTRY_RELEASE, SENTRY_DIST, and
143-
// SENTRY_ENVIRONMENT via Dart environment variable (--dart-define)
144-
}
145-
```
146-
14799
## Verify
148100

149101
Verify that your app is sending events to Sentry by adding the following snippet, which includes an intentional error. You should see the error reported in Sentry within a few minutes.

docs/platforms/dart/guides/flutter/manual-setup.mdx

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -62,54 +62,6 @@ Future<void> main() async {
6262
}
6363
```
6464

65-
```dart {tabTitle:With custom zone}
66-
import 'package:flutter/widgets.dart';
67-
import 'package:sentry_flutter/sentry_flutter.dart';
68-
69-
Future<void> main() async {
70-
// The SDK creates it's own custom zone on web for automatic error and breadcrumb tracking on web.
71-
// This could lead to zone mismatch errors if you needed to call `WidgetsBinding.ensureInitialized()` before Sentry in a cusom zone.
72-
// With `Sentry.runZonedGuarded` you still get convenient auto error and breadcrumb tracking and can also call `WidgetsBinding.ensureInitialized()` before Sentry.
73-
Sentry.runZonedGuarded(() async {
74-
WidgetsBinding.ensureInitialized();
75-
76-
// Errors before init will not be handled by Sentry
77-
78-
await SentryFlutter.init(
79-
(options) {
80-
options.dsn = '___PUBLIC_DSN___';
81-
// Adds request headers and IP for users, for more info visit:
82-
// https://docs.sentry.io/platforms/dart/data-management/data-collected/
83-
options.sendDefaultPii = true;
84-
// ___PRODUCT_OPTION_START___ performance
85-
// Set tracesSampleRate to 1.0 to capture 100% of transactions for tracing.
86-
// We recommend adjusting this value in production.
87-
options.tracesSampleRate = 1.0;
88-
// ___PRODUCT_OPTION_END___ performance
89-
// ___PRODUCT_OPTION_START___ profiling
90-
// The sampling rate for profiling is relative to tracesSampleRate
91-
// Setting to 1.0 will profile 100% of sampled transactions:
92-
// Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0
93-
options.profilesSampleRate = 1.0;
94-
// ___PRODUCT_OPTION_END___ profiling
95-
},
96-
appRunner: () => runApp(
97-
SentryWidget(
98-
child: MyApp(),
99-
),
100-
),
101-
);
102-
} (error, stackTrace) {
103-
// Automatically sends errors to Sentry, no need to do any
104-
// captureException calls on your part.
105-
// On top of that, you can do your own custom stuff in this callback.
106-
});
107-
108-
// you can also configure SENTRY_DSN, SENTRY_RELEASE, SENTRY_DIST, and
109-
// SENTRY_ENVIRONMENT via Dart environment variable (--dart-define)
110-
}
111-
```
112-
11365
## Verify
11466

11567
Verify that your app is sending events to Sentry by adding the following snippet, which includes an intentional error. You should see the error reported in Sentry within a few minutes.

docs/platforms/dart/guides/flutter/troubleshooting.mdx

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ If you need help solving issues with Sentry's Flutter SDK, you can read the edge
88

99
## Support 16 KB Page Sizes on Android
1010

11-
Starting with Android 15, AOSP supports devices with a 16 KB page size. If your app uses NDK libraries (directly or via an SDK), youll need to rebuild it for compatibility with these devices.
11+
Starting with Android 15, AOSP supports devices with a 16 KB page size. If your app uses NDK libraries (directly or via an SDK), you'll need to rebuild it for compatibility with these devices.
1212

1313
Update to Sentry Flutter SDK version `8.11.0` and above order to support 16 KB page sizes on Android devices.
1414

@@ -73,6 +73,38 @@ This is an [issue](https://github.com/flutter/flutter/issues/135245) with Flutte
7373

7474
For prior versions, you can work around this by configuring the SDK only to take screenshots when the app is in the `resumed` state. To do this, set `SentryFlutterOptions.attachScreenshotOnlyWhenResumed` to `true`.
7575

76+
## Zone Mismatch Error on Web
77+
78+
By default, the Sentry Flutter SDK creates a custom zone on web for automatic error and breadcrumb tracking. This can lead to zone mismatch errors when your application calls `WidgetsBinding.ensureInitialized()` before initializing Sentry.
79+
80+
To resolve this issue, use the `Sentry.runZonedGuarded` method to initialize both your application and Sentry within the same zone. This approach ensures proper zone consistency throughout your application:
81+
82+
```dart
83+
import 'package:flutter/widgets.dart';
84+
import 'package:sentry_flutter/sentry_flutter.dart';
85+
86+
Future<void> main() async {
87+
Sentry.runZonedGuarded(() async {
88+
WidgetsBinding.ensureInitialized();
89+
90+
await SentryFlutter.init(
91+
(options) {
92+
// your config...
93+
},
94+
appRunner: () => runApp(
95+
SentryWidget(
96+
child: MyApp(),
97+
),
98+
),
99+
);
100+
} (error, stackTrace) {
101+
// Note: Errors in this zone are already sent to Sentry automatically.
102+
// This callback lets you add your own custom error handling (like logging)
103+
// in addition to Sentry's reporting.
104+
});
105+
}
106+
```
107+
76108
## Using Flutter Multi-view for Web
77109

78110
Multi-view embedding was introduced in Flutter 3.24. You'll find a detailed guide about it in the [Flutter docs](https://docs.flutter.dev/platform-integration/web/embedding-flutter-web) .
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
---
2+
title: Supabase
3+
description: "Adds instrumentation for Supabase client operations."
4+
supported:
5+
- javascript.browser
6+
- javascript.node
7+
- javascript.aws-lambda
8+
- javascript.azure-functions
9+
- javascript.connect
10+
- javascript.express
11+
- javascript.fastify
12+
- javascript.gcp-functions
13+
- javascript.hapi
14+
- javascript.hono
15+
- javascript.koa
16+
- javascript.nestjs
17+
- javascript.electron
18+
- javascript.nextjs
19+
- javascript.nuxt
20+
- javascript.solidstart
21+
- javascript.sveltekit
22+
- javascript.remix
23+
- javascript.react-router
24+
- javascript.astro
25+
- javascript.bun
26+
- javascript.tanstackstart-react
27+
---
28+
29+
_Import name: `Sentry.supabaseIntegration`_
30+
31+
The `supabaseIntegration` adds instrumentation for the Supabase client to capture spans for both authentication and database operations.
32+
33+
## Installation
34+
35+
You need to have both the Sentry SDK and the Supabase library installed. For Supabase installation instructions, refer to the [Supabase JavaScript documentation](https://supabase.com/docs/reference/javascript/introduction).
36+
37+
38+
## Configuration
39+
40+
This is the preferred method for most use cases. and follows Sentry's standard integration pattern.
41+
42+
```javascript
43+
import * as Sentry from '@sentry/browser';
44+
import { createClient } from '@supabase/supabase-js';
45+
46+
const supabaseClient = createClient('YOUR_SUPABASE_URL', 'YOUR_SUPABASE_KEY');
47+
48+
Sentry.init({
49+
dsn: 'YOUR_DSN',
50+
integrations: [
51+
Sentry.browserTracingIntegration(),
52+
Sentry.supabaseIntegration({ supabaseClient })
53+
],
54+
tracesSampleRate: 1.0,
55+
});
56+
```
57+
58+
## Generated Spans
59+
60+
The integration provides comprehensive monitoring for both authentication and database operations:
61+
62+
### Authentication Spans
63+
64+
The integration automatically instruments the following auth operations:
65+
- `signInWithPassword`
66+
- `signOut`
67+
- `signInAnonymously`
68+
- `signInWithOAuth`
69+
- `signInWithIdToken`
70+
- `signInWithOtp`
71+
- `signInWithSSO`
72+
- `signUp`
73+
- `verifyOtp`
74+
- `reauthenticate`
75+
76+
Admin operations are also instrumented:
77+
- `createUser`
78+
- `deleteUser`
79+
- `listUsers`
80+
- `getUserById`
81+
- `updateUserById`
82+
- `inviteUserByEmail`
83+
84+
### Database Operation Spans
85+
86+
These spans are used to populate Sentry's [Query Insights](/product/insights/backend/queries/) feature, which provides performance metrics and analysis for your database operations. With Query Insights, you can identify slow queries, track query frequency, and optimize your database interactions.
87+
88+
- `db.table`: The table being queried
89+
- `db.schema`: The database schema
90+
- `db.url`: The Supabase instance URL
91+
- `db.sdk`: Client information
92+
- `db.system`: Set to 'postgresql'
93+
- `db.query`: The query parameters
94+
- `db.body`: The request body (for mutations)
95+
96+
### Queue Operation Spans (in progress)
97+
98+
Coming soon, the Sentry SDK will also support generating spans for interactions with Supabase queues. For more information, please follow [this GitHub issue](https://github.com/getsentry/sentry-javascript/issues/14611).
99+
100+
101+
## Error Tracking
102+
103+
The integration automatically:
104+
- Captures errors from failed operations
105+
- Adds breadcrumbs for database operations
106+
- Includes detailed context about the operation that failed
107+
108+
109+
## Supported Versions
110+
111+
- `@supabase/supabase-js`: `>=2.0.0`

docs/platforms/python/index.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ categories:
3131

3232
Install the Sentry SDK using [`pip`](https://pip.pypa.io/en/stable/):
3333

34-
```bash
35-
pip install --upgrade sentry-sdk
34+
```bash {tabTitle:pip}
35+
pip install "sentry-sdk"
36+
```
37+
```bash {tabTitle:uv}
38+
uv add "sentry-sdk"
3639
```
3740

3841
## Configure

docs/platforms/python/integrations/aiohttp/aiohttp-client.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ This integration also supports AIOHTTP servers. See <PlatformLink to="/integrati
1313

1414
Install `sentry-sdk` from PyPI with the `aiohttp` extra.
1515

16-
```bash
17-
pip install --upgrade 'sentry-sdk[aiohttp]'
16+
```bash {tabTitle:pip}
17+
pip install "sentry-sdk[aiohttp]"
18+
```
19+
```bash {tabTitle:uv}
20+
uv add "sentry-sdk[aiohttp]"
1821
```
1922

2023
## Configure

docs/platforms/python/integrations/aiohttp/index.mdx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,21 @@ If you use AIOHTTP as your HTTP client and want to instrument outgoing HTTP requ
1111

1212
Install `sentry-sdk` from PyPI with the `aiohttp` extra:
1313

14-
```bash
15-
pip install --upgrade sentry-sdk[aiohttp]
14+
```bash {tabTitle:pip}
15+
pip install "sentry-sdk[aiohttp]"
1616
```
17+
```bash {tabTitle:uv}
18+
uv add "sentry-sdk[aiohttp]"
19+
```
20+
1721

1822
If you're on Python 3.6, you also need the `aiocontextvars` package:
1923

20-
```bash
21-
pip install --upgrade aiocontextvars
24+
```bash {tabTitle:pip}
25+
pip install "aiocontextvars"
26+
```
27+
```bash {tabTitle:uv}
28+
uv add "aiocontextvars"
2229
```
2330

2431
## Configure

docs/platforms/python/integrations/airflow/index.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ description: "Learn about using Sentry with Apache Airflow."
99

1010
Install the `apache-airflow` package with the `sentry` requirement.
1111

12-
```py
13-
pip install 'apache-airflow[sentry]'
12+
13+
```bash {tabTitle:pip}
14+
pip install "apache-airflow[sentry]"
15+
```
16+
```bash {tabTitle:uv}
17+
uv add "apache-airflow[sentry]"
1418
```
1519

1620
Then, add your Sentry DSN to your configuration file (ex. `airflow.cfg`) under the `[sentry]` field.

docs/platforms/python/integrations/anthropic/index.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ Sentry LLM Monitoring will automatically collect information about prompts, toke
2424

2525
Install `sentry-sdk` from PyPI with the `anthropic` extra:
2626

27-
```bash
28-
pip install --upgrade 'sentry-sdk[anthropic]'
27+
```bash {tabTitle:pip}
28+
pip install "sentry-sdk[anthropic]"
29+
```
30+
```bash {tabTitle:uv}
31+
uv add "sentry-sdk[anthropic]"
2932
```
3033

3134
## Configure

0 commit comments

Comments
 (0)