createTrace method

  1. @override
Future<SentryTrace> createTrace({
  1. required String name,
  2. String operation = 'custom',
})
override

Implementation

@override
Future<SentryTrace> createTrace({required String name, String operation = 'custom'}) async {
  if (!isReady) {
    logger.warning(this, '$providerName: Sentry is not initialized');
    throw Exception('$providerName: Sentry is not initialized');
  }

  logger.debug(this, 'Creating Trace:$name');

  SentryTrace trace = SentryTrace(name: name, operation: operation);

  await trace.initialize(
    autoStart: true,
    canTrace: (settings?.mode == TraceMode.appOnly ||
        settings?.mode == TraceMode.both),
  );

  logger.debug(this, 'Trace:$name created');

  return trace;
}