setSpanStatus method

  1. @override
Future<bool> setSpanStatus(
  1. String spanId,
  2. SpanStatusCode statusCode, {
  3. String? description,
})
override

Sets the status of an active span.

description is only relevant when statusCode is SpanStatusCode.error.

Implementation

@override
Future<bool> setSpanStatus(
  String spanId,
  SpanStatusCode statusCode, {
  String? description,
}) async {
  throwIfNotStarted();
  return await methodChannel.invokeMethod(_setSpanStatusMethodName, {
        _spanIdArgName: spanId,
        _statusCodeArgName: statusCode.name,
        if (description != null) _descriptionArgName: description,
      }) as bool? ??
      false;
}