Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/guides/logs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,6 @@ await SentryFlutter.init(
options.dsn = '...';
options.environment = 'development';
options.tracesSampleRate = 1.0; // 100% of traces
options.enableLogs = true;
},
appRunner: () => runApp(MyApp()),
);
Expand Down
5 changes: 0 additions & 5 deletions docs/platforms/dart/guides/flutter/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,6 @@ Future<void> main() async {
// Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0
options.profilesSampleRate = 1.0;
// ___PRODUCT_OPTION_END___ profiling
// ___PRODUCT_OPTION_START___ logs

// Enable logs to be sent to Sentry
options.enableLogs = true;
// ___PRODUCT_OPTION_END___ logs
// ___PRODUCT_OPTION_START___ session-replay
// Record session replays for 100% of errors and 10% of sessions
options.replay.onErrorSampleRate = 1.0;
Expand Down
4 changes: 0 additions & 4 deletions docs/platforms/dart/guides/flutter/manual-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ Future<void> main() async {
// Note: Profiling alpha is available for iOS and macOS since SDK version 7.12.0
options.profilesSampleRate = 1.0;
// ___PRODUCT_OPTION_END___ profiling
// ___PRODUCT_OPTION_START___ logs
// Enable logs to be sent to Sentry
options.enableLogs = true;
// ___PRODUCT_OPTION_END___ logs
},
appRunner: () => runApp(
SentryWidget(
Expand Down
2 changes: 1 addition & 1 deletion docs/pricing/quotas/manage-application-metrics-quota.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ sentry_sdk.init(

### Disabling Metrics

If you want to stop sending Application Metrics from a specific SDK entirely, most SDKs expose an option to disable metrics without removing the rest of your Sentry configuration (for example, `enableMetrics: false` in JavaScript SDKs or `experimental.enableMetrics = false` on Apple platforms). See the [platform-specific metrics docs](/product/metrics/getting-started/) for the option name on your SDK.
If you want to stop sending Application Metrics from a specific SDK entirely, check the [platform-specific metrics docs](/product/metrics/getting-started/) for its option or filtering callback. In the Dart and Flutter SDKs version 9.28.0 and later, use `beforeSendMetric` to return `null` for metrics you don't want to send.

### Application Metrics Filtering

Expand Down
8 changes: 3 additions & 5 deletions includes/dart-integrations/logging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ platforms:

This integration connects Sentry with the popular [Dart logging package](https://pub.dev/packages/logging), providing the following capabilities:

- If `enableLogs` is set to `true`, Sentry will send your log messages as [Sentry Structured Logs](/platforms/dart/logs/) (new in `9.5.0`)
- Sends log messages as [Sentry Structured Logs](/platforms/dart/logs/) (available since version 9.5.0 and enabled by default in version 9.28.0 and later)
- Captures breadcrumbs from your log calls
- Converts error-level logs into Sentry error events
- Works with your existing logging code
Expand Down Expand Up @@ -47,8 +47,6 @@ Future<void> main() async {
(options) {
options.dsn = '___PUBLIC_DSN___';
options.addIntegration(LoggingIntegration());
// If you want to enable sending structured logs, set `enableLogs` to `true`
options.enableLogs = true;
},
appRunner: initApp, // Init your App.
);
Expand All @@ -61,7 +59,7 @@ Future<void> main() async {
|-----------|---------|-------------|
| `minBreadcrumbLevel` | `Level.INFO` | Minimum level for creating breadcrumbs |
| `minEventLevel` | `Level.SEVERE` | Minimum level for creating error events |
| `minSentryLogLevel` | `Level.INFO` | Minimum level for sending structured logs (requires `enableLogs` to be `true`) |
| `minSentryLogLevel` | `Level.INFO` | Minimum level for sending structured logs |

You can customize which log levels trigger different Sentry features:

Expand Down Expand Up @@ -107,7 +105,7 @@ void testLogging() {
### What You'll See in Sentry:
- **Breadcrumbs**: All three log calls will appear as breadcrumbs on the error event
- **Error Event**: The `severe` log creates a full error event with stack trace
- **Structured Logs**: (if `enableLogs` is `true`) Navigate to **Logs** in your Sentry project to see all three entries as searchable structured logs
- **Structured Logs**: Navigate to **Logs** in your Sentry project to see all three entries as searchable structured logs

## Stack Traces

Expand Down
10 changes: 8 additions & 2 deletions platform-includes/logs/options/dart.flutter.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#### beforeSendLog

To filter logs, or update them before they are sent to Sentry, you can use the `beforeSendLog` option.
Use the `beforeSendLog` option to filter or modify logs before the SDK sends them. Return `null` to drop a log.

<Alert>

Logs are enabled by default in version 9.28.0 and later. In versions 9.5.0 through 9.27.x, set `options.enableLogs` to `true`.

</Alert>

```dart
await SentryFlutter.init(
Expand All @@ -18,4 +24,4 @@ await SentryFlutter.init(
);
```

The `beforeSend` function receives a log object, and should return the log object if you want it to be sent to Sentry, or `null` if you want to discard it.
The `beforeSendLog` function receives a log object. Return the log to send it, or return `null` to drop it.
10 changes: 8 additions & 2 deletions platform-includes/logs/options/dart.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#### beforeSendLog

To filter logs, or update them before they are sent to Sentry, you can use the `beforeSendLog` option.
Use the `beforeSendLog` option to filter or modify logs before the SDK sends them. Return `null` to drop a log.

<Alert>

Logs are enabled by default in version 9.28.0 and later. In versions 9.5.0 through 9.27.x, set `options.enableLogs` to `true`.

</Alert>

```dart
await Sentry.init(
Expand All @@ -18,4 +24,4 @@ await Sentry.init(
);
```

The `beforeSend` function receives a log object, and should return the log object if you want it to be sent to Sentry, or `null` if you want to discard it.
The `beforeSendLog` function receives a log object. Return the log to send it, or return `null` to drop it.
4 changes: 3 additions & 1 deletion platform-includes/logs/setup/dart.flutter.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
To enable logging, you need to initialize the SDK with the `enableLogs` option set to `true`.
Logs are enabled by default in version 9.28.0 and later. No additional setup is required.

In versions 9.5.0 through 9.27.x, set the `enableLogs` option to `true`:

```dart
await SentryFlutter.init(
Expand Down
4 changes: 3 additions & 1 deletion platform-includes/logs/setup/dart.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
To enable logging, you need to initialize the SDK with the `enableLogs` option set to `true`.
Logs are enabled by default in version 9.28.0 and later. No additional setup is required.

In versions 9.5.0 through 9.27.x, set the `enableLogs` option to `true`:

```dart
await Sentry.init(
Expand Down
23 changes: 2 additions & 21 deletions platform-includes/metrics/options/dart.flutter.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Metrics are enabled by default and are not collected automatically. Call the metrics API to record metrics. Use `beforeSendMetric` to filter, modify, or drop metrics before the SDK sends them.

<SplitLayout>
<SplitSection>
<SplitSectionText>
Expand Down Expand Up @@ -29,25 +31,4 @@ await SentryFlutter.init((options) {
</SplitSectionCode>
</SplitSection>

<SplitSection>
<SplitSectionText>

### Disable Metrics

Set `enableMetrics: false` to disable metrics collection entirely.

</SplitSectionText>
<SplitSectionCode>

```dart
import 'package:sentry_flutter/sentry_flutter.dart';

await SentryFlutter.init((options) {
options.dsn = '___PUBLIC_DSN___';
options.enableMetrics = false;
});
```

</SplitSectionCode>
</SplitSection>
</SplitLayout>
24 changes: 2 additions & 22 deletions platform-includes/metrics/options/dart.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Metrics are enabled by default and are not collected automatically. Call the metrics API to record metrics. Use `beforeSendMetric` to filter, modify, or drop metrics before the SDK sends them.

<SplitLayout>
<SplitSection>
<SplitSectionText>
Expand Down Expand Up @@ -29,26 +31,4 @@ await Sentry.init((options) {
</SplitSectionCode>
</SplitSection>

<SplitSection>
<SplitSectionText>

### Disable Metrics

Set `enableMetrics: false` to disable metrics collection entirely.

</SplitSectionText>
<SplitSectionCode>

```dart
import 'package:sentry/sentry.dart';

// Disable metrics
await Sentry.init((options) {
options.dsn = '___PUBLIC_DSN___';
options.enableMetrics = false;
});
```

</SplitSectionCode>
</SplitSection>
</SplitLayout>
Loading