Skip to content
pubscout

sentry_dio

10.6.0, released yesterday by sentry.io

Adds Sentry performance tracing and error capture to Dio HTTP requests.

WASM-readyRock solid
$ flutter pub add sentry_dio
Source repository

What it does

The package extends Dio with Sentry integration, automatically creating performance spans and breadcrumbs for each request. It also captures exceptions from failed HTTP status codes or parsing errors.

AI-written summary of version 10.3.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You already use Dio for networking and want automatic Sentry tracing and error reporting.
  • You need performance monitoring of HTTP calls across all supported platforms.

Skip it when

  • You are not using Dio (e.g., using http or graphql packages).
  • You do not use Sentry or prefer a different crash‑reporting solution.

Strengths

  • Zero‑boilerplate integration via dio.addSentry()
  • Works on Android, iOS, Web, Windows, macOS, Linux
  • Captures both performance spans and breadcrumbs automatically

Weaknesses

  • Only works with Dio, not other HTTP clients
  • Adds a small runtime overhead to each request
  • Limited configuration compared to full Sentry SDK

Setup

Kind
Pure Dart
Effort
Medium
Code generation
No
Direct dependencies
2

Initialize Sentry SDK with a DSN before calling dio.addSentry(). No native permissions required.

import 'package:sentry/sentry.dart';
import 'package:sentry_dio/sentry_dio.dart';
import 'package:dio/dio.dart';

Future<void> main() async {
  await Sentry.init((options) => options.dsn = 'https://example@sentry.io/example');
  final dio = Dio();
  dio.addSentry(); // must be last Dio setup step
}

Alternatives

Packages that do the same job and could replace sentry_dio.

Works with

Packages commonly used together with sentry_dio: ones it builds on, ones built on it, and its own family.