littlefish_monitoring_sentry 1.2.0 copy "littlefish_monitoring_sentry: ^1.2.0" to clipboard
littlefish_monitoring_sentry: ^1.2.0 copied to clipboard

The project for littlefish monitoring implementation of sentry performance monitoring

littlefish_monitoring_sentry #

The Sentry implementation of the littlefish monitoring package for performance monitoring and tracing.

Features #

  • Performance tracing via Sentry transactions and spans
  • HTTP request monitoring
  • Custom trace attributes and metrics

Getting Started #

Add this package to your pubspec.yaml:

dependencies:
  littlefish_monitoring_sentry: ^1.0.0

Usage #

import 'package:littlefish_monitoring_sentry/sentry_monitoring_service.dart';

// Initialize the service
final monitoringService = SentryMonitoringService();
await monitoringService.initailize(
  settings: MonitoringSettings(
    enabled: true,
    mode: TraceMode.both,
  ),
);

// Create a trace
final trace = await monitoringService.createTrace(name: 'my_operation');
await trace.start();
// ... perform operation ...
await trace.stop();

// Create an HTTP trace
final httpMetric = await monitoringService.createHttpTrace(
  name: 'api_call',
  url: 'https://api.example.com/data',
  method: MonitoringHttpMethod.GET,
);
await httpMetric.start();
// ... make HTTP request ...
httpMetric.setHttpResponseCode(200);
await httpMetric.stop();

Note #

Sentry must be initialized before using this service. You can either:

  1. Initialize Sentry via littlefish_observability_sentry first
  2. Initialize Sentry directly in your application using SentryFlutter.init()

If Sentry is not initialized, the service will mark itself as not ready and tracing operations will be skipped.

0
likes
140
points
103
downloads

Publisher

unverified uploader

Weekly Downloads

The project for littlefish monitoring implementation of sentry performance monitoring

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, littlefish_core, sentry_flutter

More

Packages that depend on littlefish_monitoring_sentry