Execute the callback fn function with the passed span as the active span. The callback receives an ISpanScope object as its first parameter and the this context (when no thisArg is provided). Note: The callback will be executed even if the span is null.

The current trace host instance (core or AISKU instance)

The span to set as the active span during the execution of the callback

the callback function that receives an ISpanScope and additional arguments

the this argument for the callback. If not provided, ISpanScope is used as this

Additional arguments to be passed to the function

  • Execute the callback fn function with the passed span as the active span. The callback receives an ISpanScope object as its first parameter and the this context (when no thisArg is provided). Note: The callback will be executed even if the span is null.

    Type Parameters

    Parameters

    • traceHost: T

      The current trace host instance (core or AISKU instance)

    • span: IReadableSpan

      The span to set as the active span during the execution of the callback

    • fn: F

      the callback function that receives an ISpanScope

    • OptionalthisArg: ThisParameterType<F>

      the this argument for the callback. If not provided, ISpanScope is used as this

    Returns ReturnType<F>

    The result of the function

  • Execute the callback fn function with the passed span as the active span. The callback receives an ISpanScope object as its first parameter and the this context (when no thisArg is provided). Note: The callback will be executed even if the span is null.

    Type Parameters

    Parameters

    • traceHost: T

      The current trace host instance (core or AISKU instance)

    • span: IReadableSpan

      The span to set as the active span during the execution of the callback

    • fn: F

      the callback function that receives an ISpanScope and additional arguments

    • OptionalthisArg: ThisParameterType<F>

      the this argument for the callback. If not provided, ISpanScope is used as this

    • Rest..._args: A

      Additional arguments to be passed to the function

    Returns ReturnType<F>

    The result of the function