sentry_grpc 9.29.0 copy "sentry_grpc: ^9.29.0" to clipboard
sentry_grpc: ^9.29.0 copied to clipboard

An integration which adds support for performance tracing and error monitoring for gRPC calls.


Sentry integration for gRPC package #

package build pub likes popularity pub points
sentry_grpc build pub package likes popularity pub points

Integration for the gRPC package.

Usage

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

  • Follow the installing instructions on pub.dev.

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

  • Call your client with the gRPC interceptor SentryGrpcInterceptor and you should get gRPC integration out of the box.

import 'package:grpc/grpc.dart';
import 'package:sentry/sentry.dart';
import 'package:sentry_grpc/sentry_grpc.dart';

Future<void> main() async {
  await Sentry.init(
    (options) {
      options.dsn = 'https://example@sentry.io/example';
      options.tracesSampleRate = 1.0;
      options.captureFailedRequests = true;
    },
    appRunner: runApp,
  );
}

Future<void> runApp() async {
  final channel = ClientChannel(
    'api.example.com',
    options: const ChannelOptions(credentials: ChannelCredentials.secure()),
  );

  final client = MyServiceClient(
    channel,
    interceptors: [SentryGrpcInterceptor()],
  );

  // Calls are now automatically instrumented with Sentry tracing
  // and failed requests are captured as Sentry exceptions.
}

Resources

  • Flutter docs
  • Dart docs
  • Discussions
  • Discord Chat
  • Stack Overflow
  • Twitter Follow
0
likes
130
points
1.24k
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

An integration which adds support for performance tracing and error monitoring for gRPC calls.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

grpc, meta, sentry

More

Packages that depend on sentry_grpc