startSpan method
Create and start a new span. Returns a reference to the new span on success and null on failure.
Implementation
@override
Future<EmbraceSpan?> startSpan(
String name, {
EmbraceSpan? parent,
int? startTimeMs,
}) async {
return _runCatchingAndReturn<EmbraceSpan?>(
'startSpan',
() async {
final id = await _platform.startSpan(
name,
parentSpanId: parent?.id,
startTimeMs: startTimeMs,
);
if (id != null) {
return Future.value(EmbraceSpanImpl(id, _platform));
} else {
return Future.value();
}
},
defaultValue: null,
);
}