startGlobalSpan method
Starts a global custom span on the native SDK. Returns null if the SDK
refuses (e.g. another global span is active).
Implementation
@override
Future<Map<String, dynamic>?> startGlobalSpan({
required String name,
Map<String, dynamic>? labels,
required List<String> ignoredInstruments,
}) async {
// Null means the native SDK refused a new global span (e.g. one already
// active — Q3). [PlatformException] is not caught here so callers can tell
// bridge failures apart from an explicit null response.
final dynamic result = await methodChannel.invokeMethod<dynamic>(
'startGlobalSpan',
<String, dynamic>{
'name': name,
'labels': labels,
'ignoredInstruments': ignoredInstruments,
},
);
if (result == null) return null;
return Map<String, dynamic>.from(result as Map<dynamic, dynamic>);
}