sentry_dio 6.5.1 icon indicating copy to clipboard operation
sentry_dio: ^6.5.1 copied to clipboard

An integration which adds support for performance tracing for the Dio package.


Sentry integration for dio package #

packagebuildpublikespopularitypub points
sentry_diobuildpub packagelikespopularitypub points

Integration for the dio package.

dio is in an experimental stage and it could lead to bugs. We recognize the irony.

Usage

  • Sign up for a Sentry.io account and get a DSN at http://sentry.io.

  • Follow the installing instructions on pub.dev.

  • Initialize the Sentry SDK using the DSN issued by Sentry.io.

  • Call dio.addSentry(). This must be the last initialization step of the Dio setup, otherwise your configuration of Dio might overwrite the Sentry configuration.

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

Future<void> main() async {
  await Sentry.init(
    (options) {
      options.dsn = 'https://example@sentry.io/example';
    },
    appRunner: initDio, // Init your App.
  );
}

void initDio() {
  final dio = Dio();
  /// This *must* be the last initialization step of the Dio setup, otherwise
  /// your configuration of Dio might overwrite the Sentry configuration.
  dio.addSentry(...);
}

Depending on your configuration, this adds performance tracing and http breadcrumbs. Also, exceptions from invalid http status codes or parsing exceptions are automatically captured.

Resources

  • Documentation
  • Forum
  • Discord
  • Stack Overflow
  • Twitter Follow
7
likes
130
pub points
89%
popularity

Publisher

verified publisher iconsentry.io

An integration which adds support for performance tracing for the Dio package.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

dio, meta, sentry

More

Packages that depend on sentry_dio