function startSpanManual(
  context,
  callback,
) {
  const spanContext = normalizeContext(context);

  return hub.runWithAsyncContext(() => {
    return exports$1.withScope(context.scope, scope => {
      // eslint-disable-next-line deprecation/deprecation
      const hub$1 = hub.getCurrentHub();
      // eslint-disable-next-line deprecation/deprecation
      const parentSpan = scope.getSpan();

      const shouldSkipSpan = context.onlyIfParent && !parentSpan;
      const activeSpan = shouldSkipSpan
        ? undefined
        : createChildSpanOrTransaction(hub$1, {
            parentSpan,
            spanContext,
            forceTransaction: context.forceTransaction,
            scope,
          });

      function finishAndSetSpan() {
        activeSpan && activeSpan.end();
      }

      return handleCallbackErrors.handleCallbackErrors(
        () => callback(activeSpan, finishAndSetSpan),
        () => {
          // Only update the span status if it hasn't been changed yet, and the span is not yet finished
          if (activeSpan && activeSpan.isRecording()) {
            const { status } = spanUtils.spanToJSON(activeSpan);
            if (!status || status === 'ok') {
              activeSpan.setStatus('internal_error');
            }
          }
        },
      );
    });
  });
}
Similar to `Sentry.startSpan`. Wraps a function with a transaction/span, but does not finish the span
after the function is done automatically. You'll have to call `span.end()` manually.

The created span is the active span and will be used as parent by other spans created inside the function
and can be accessed via `Sentry.getActiveSpan()`, as long as the function is executed while the scope is active.

Note that if you have not enabled tracing extensions via `addTracingExtensions`
or you didn't set `tracesSampleRate`, this function will not generate spans
and the `span` returned from the callback will be undefined.