MethodChannelOpentelemetry class

An implementation of OpentelemetryPlatform that uses method channels.

Inheritance

Properties

exportChannel → MethodChannel
Span-export channel. On Android its native handler runs on a background TaskQueue, so per-span pushes never touch the platform (main) thread and keep flowing even while the main thread is blocked.
final
hashCode → int
The hash code for this object.
no setterinherited
methodChannel → MethodChannel
The method channel used to interact with the native platform.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
startupChannel → MethodChannel
Startup channel. Runs on a background TaskQueue on both platforms, so a startup message never queues behind the main thread during launch — the very window in which every one of these is sent.
final

Methods

droppedAppStartWrites() → Future<int>
Cumulative native app-start events/attributes dropped because app.start had already closed. Android-only; other platforms return 0.
override
exportSpans(List<Map<String, dynamic>> spans) → Future<void>
Forwards a batch of ended spans (serialized via ReadOnlySpan.toJson) to the native layer, which owns the single telemetry egress.
override
flushSpans() → Future<bool>
Asks the native layer to persist its in-memory bridge queue to the disk buffer, completing only once the spans are durable. Returns false when the flush could not be confirmed (or the platform has no native bridge).
override
initialize(InitializationParams params) → Future<String?>
override
markTimeToDisplay({String reason = 'flutter_first_frame'}) → Future<void>
Signals native that the app has reached its first meaningful display (Time-To-Initial / Time-To-Full Display), closing the native app.start span so it can be emitted.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
publishFlutterActionContext(dynamic spanContext, Duration window) → Future<void>
Publishes the current user-action span context to native along with an expiry (window from now), so native span creators can parent to it while the action window is open.
override
recordAppStartAttribute(String key, String value) → Future<void>
Sets an attribute on the in-flight native cold-start app.start span.
override
recordAppStartEvent(String name, int epochMs) → Future<void>
Stamps an event onto the in-flight native cold-start app.start span.
override
setGlobalAttributes(Map<String, String> attributes) → Future<void>
Merges app-provided attributes into the native layer's global attribute set. Native applies them to every subsequent span and log — both native-origin and bridged Dart spans — so this is the single write path for runtime attribute updates on Android.
override
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited