sentry_dio
10.6.0, released yesterday by sentry.io
Adds Sentry performance tracing and error capture to Dio HTTP requests.
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.
- native_dio_adapter
A Dio HTTP client adapter that uses native platform HTTP stacks via cupertino_http and cronet_http.
87Compare - dio_cache_plus
Advanced Dio interceptor that adds flexible caching, expiry and deduplication.
70Compare - firebase_performance_dio
Dio interceptor that records HTTP request metrics in Firebase Performance.
47Compare - flutter_cache_manager_dio
A Dio‑based cache manager that extends flutter_cache_manager for downloading and caching files.
46Compare
Works with
Packages commonly used together with sentry_dio: ones it builds on, ones built on it, and its own family.
- diosentry_dio depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- sentrysentry_dio depends on itCrash reporting and error tracking library for Dart and Flutter applications.
- sentry_flutterSame familySentry SDK for Flutter to capture errors, crashes and performance data across platforms.
- sentry_dart_pluginSame familyUploads debug symbols and source maps to Sentry for server-side symbolication.
- sentry_loggingSame familyAdds Sentry logging integration for the Dart logging package
- sentry_linkSame familyAutomatic capture of exceptions and GraphQL errors for the gql ecosystem like graphql and ferry.
- sentry_driftSame familyPerformance tracing integration for the drift SQL package using Sentry.