From 01280dc36fe5dc9ea34f8a564c526c0bb19030f2 Mon Sep 17 00:00:00 2001 From: "sentry-junior[bot]" <264270552+sentry-junior[bot]@users.noreply.github.com> Date: Thu, 13 Aug 2026 08:04:48 +0000 Subject: [PATCH] docs(dart): Remove obsolete logs and metrics options Co-Authored-By: Gino Buenaflor --- docs/guides/logs.mdx | 1 - docs/platforms/dart/guides/flutter/index.mdx | 5 ---- .../dart/guides/flutter/manual-setup.mdx | 4 ---- .../manage-application-metrics-quota.mdx | 2 +- includes/dart-integrations/logging.mdx | 8 +++---- .../logs/options/dart.flutter.mdx | 10 ++++++-- platform-includes/logs/options/dart.mdx | 10 ++++++-- platform-includes/logs/setup/dart.flutter.mdx | 4 +++- platform-includes/logs/setup/dart.mdx | 4 +++- .../metrics/options/dart.flutter.mdx | 23 ++---------------- platform-includes/metrics/options/dart.mdx | 24 ++----------------- 11 files changed, 30 insertions(+), 65 deletions(-) diff --git a/docs/guides/logs.mdx b/docs/guides/logs.mdx index e4a24f36b4e1ef..b3eac9e6a5767a 100644 --- a/docs/guides/logs.mdx +++ b/docs/guides/logs.mdx @@ -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()), ); diff --git a/docs/platforms/dart/guides/flutter/index.mdx b/docs/platforms/dart/guides/flutter/index.mdx index 5dd2b039849076..77692363f64f53 100644 --- a/docs/platforms/dart/guides/flutter/index.mdx +++ b/docs/platforms/dart/guides/flutter/index.mdx @@ -122,11 +122,6 @@ Future 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; diff --git a/docs/platforms/dart/guides/flutter/manual-setup.mdx b/docs/platforms/dart/guides/flutter/manual-setup.mdx index cbf07999b9b45a..41b60fcd95d14e 100644 --- a/docs/platforms/dart/guides/flutter/manual-setup.mdx +++ b/docs/platforms/dart/guides/flutter/manual-setup.mdx @@ -50,10 +50,6 @@ Future 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( diff --git a/docs/pricing/quotas/manage-application-metrics-quota.mdx b/docs/pricing/quotas/manage-application-metrics-quota.mdx index 5d364067a42e5d..16ef6b6c3798f6 100644 --- a/docs/pricing/quotas/manage-application-metrics-quota.mdx +++ b/docs/pricing/quotas/manage-application-metrics-quota.mdx @@ -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 diff --git a/includes/dart-integrations/logging.mdx b/includes/dart-integrations/logging.mdx index f2c5b7555a86b3..3d6d6102ec8065 100644 --- a/includes/dart-integrations/logging.mdx +++ b/includes/dart-integrations/logging.mdx @@ -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 @@ -47,8 +47,6 @@ Future 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. ); @@ -61,7 +59,7 @@ Future 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: @@ -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 diff --git a/platform-includes/logs/options/dart.flutter.mdx b/platform-includes/logs/options/dart.flutter.mdx index daae4f0b4ad188..44994351881348 100644 --- a/platform-includes/logs/options/dart.flutter.mdx +++ b/platform-includes/logs/options/dart.flutter.mdx @@ -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. + + + +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`. + + ```dart await SentryFlutter.init( @@ -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. diff --git a/platform-includes/logs/options/dart.mdx b/platform-includes/logs/options/dart.mdx index 41539620bbf1a3..9585f8ef4aa8ec 100644 --- a/platform-includes/logs/options/dart.mdx +++ b/platform-includes/logs/options/dart.mdx @@ -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. + + + +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`. + + ```dart await Sentry.init( @@ -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. diff --git a/platform-includes/logs/setup/dart.flutter.mdx b/platform-includes/logs/setup/dart.flutter.mdx index 75cd374cc8f77b..2a657a9fcfec51 100644 --- a/platform-includes/logs/setup/dart.flutter.mdx +++ b/platform-includes/logs/setup/dart.flutter.mdx @@ -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( diff --git a/platform-includes/logs/setup/dart.mdx b/platform-includes/logs/setup/dart.mdx index 82f29fea4fe1a5..cac8872a9b0a3a 100644 --- a/platform-includes/logs/setup/dart.mdx +++ b/platform-includes/logs/setup/dart.mdx @@ -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( diff --git a/platform-includes/metrics/options/dart.flutter.mdx b/platform-includes/metrics/options/dart.flutter.mdx index bbd4f3d74f3d36..c0400806421e3a 100644 --- a/platform-includes/metrics/options/dart.flutter.mdx +++ b/platform-includes/metrics/options/dart.flutter.mdx @@ -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. + @@ -29,25 +31,4 @@ await SentryFlutter.init((options) { - - - -### Disable Metrics - -Set `enableMetrics: false` to disable metrics collection entirely. - - - - -```dart -import 'package:sentry_flutter/sentry_flutter.dart'; - -await SentryFlutter.init((options) { - options.dsn = '___PUBLIC_DSN___'; - options.enableMetrics = false; -}); -``` - - - diff --git a/platform-includes/metrics/options/dart.mdx b/platform-includes/metrics/options/dart.mdx index b7c0fc93c994a9..e1364af97333a6 100644 --- a/platform-includes/metrics/options/dart.mdx +++ b/platform-includes/metrics/options/dart.mdx @@ -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. + @@ -29,26 +31,4 @@ await Sentry.init((options) { - - - -### Disable Metrics - -Set `enableMetrics: false` to disable metrics collection entirely. - - - - -```dart -import 'package:sentry/sentry.dart'; - -// Disable metrics -await Sentry.init((options) { - options.dsn = '___PUBLIC_DSN___'; - options.enableMetrics = false; -}); -``` - - -