otel_flutter_local_notifications 0.2.0
otel_flutter_local_notifications: ^0.2.0 copied to clipboard
OpenTelemetry instrumentation for `package:flutter_local_notifications`. Wraps show / schedule / cancel with notification.* spans.
otel_flutter_local_notifications #
OpenTelemetry instrumentation for
package:flutter_local_notifications.
final fln = FlutterLocalNotificationsPlugin();
// Show: wrap in a traced call
await tracedLocalNotificationCall<void>(
operation: 'show',
id: 42,
invoke: () => fln.show(42, 'Title', 'Body', notificationDetails),
);
// Tap: bridge into your active span
await fln.initialize(
initSettings,
onDidReceiveNotificationResponse: (response) {
recordNotificationResponse(
id: response.id,
payload: response.payload,
);
// ... your handler
},
);
Each call opens a PRODUCER span named local_notif <op> <id>
with notification.system=flutter_local_notifications,
notification.operation, notification.id. The keys are
exported as the LocalNotificationsSemantics enum.
Notification body (title/text) is intentionally not recorded — it often contains user-visible PII.
Suppression: runWithoutLocalNotificationsInstrumentationAsync.
License #
Apache 2.0