startExecutionTrace static method

  1. @Deprecated('Please migrate to the App Flows APIs: APM.startAppFlow, APM.endFlow, and APM.setFlowAttribute. This feature was deprecated in v13.0.0')
Future<Trace> startExecutionTrace(
  1. String name
)

Starts an execution trace. String name of the trace.

Please migrate to the App Flows APIs: startFlow, setFlowAttribute, and endFlow.

Implementation

@Deprecated(
  'Please migrate to the App Flows APIs: APM.startAppFlow, APM.endFlow, and APM.setFlowAttribute. This feature was deprecated in v13.0.0',
)
static Future<Trace> startExecutionTrace(String name) async {
  final id = IBGDateTime.instance.now();
  final traceId = await _host.startExecutionTrace(id.toString(), name);

  if (traceId == null) {
    return Future.error(
      "Execution trace $name wasn't created. Please make sure to enable APM first by following "
      'the instructions at this link: https://docs.instabug.com/reference#enable-or-disable-apm',
    );
  }

  return Trace(
    id: traceId,
    name: name,
  );
}