Creates and starts a new span, sets it as the active span in the current context, and executes a provided function within this context.
This method creates a span, makes it active during the execution of the provided function, and automatically ends the span when the function completes (or throws). This provides automatic span lifecycle management and context propagation. If the function is asynchronous the span will be ended when the returned Promise resolves or rejects. Note: The callback will be executed even if the traceHost is unable to create a span (returns null).
The result of executing the provided function
Creates and starts a new span, sets it as the active span in the current context, and executes a provided function within this context.
This method creates a span, makes it active during the execution of the provided function, and automatically ends the span when the function completes (or throws). This provides automatic span lifecycle management and context propagation. If the function is asynchronous the span will be ended when the returned Promise resolves or rejects. Note: The callback will be executed even if the traceHost is unable to create a span (returns null).
The name of the span, should be descriptive of the operation being traced
Optional configuration for span creation (parent context, attributes, etc.)
The function to execute within the span's active context
OptionalthisArg: ThisParameterType<F>The this argument for the callback. If not provided, ISpanScope is used as this
The result of executing the provided function
Creates and starts a new span, sets it as the active span in the current context, and executes a provided function within this context.
This method creates a span, makes it active during the execution of the provided function, and automatically ends the span when the function completes (or throws). This provides automatic span lifecycle management and context propagation. If the function is asynchronous the span will be ended when the returned Promise resolves or rejects. Note: The callback will be executed even if the traceHost is unable to create a span (returns null).
Remarks
This overloaded version supports both optional span creation options and the
thisargument for the callback.Param: name
The name of the span, should be descriptive of the operation being traced
Param: optionsOrFn
Optional configuration for span creation (parent context, attributes, etc.) or the function to execute within the span's active context
Param: maybeFnOrThis
The function to execute within the span's active context or the
thisargument for the callbackParam: thisArg
The
thisargument for the callback. If not provided, ISpanScope is used asthisReturns
The result of executing the provided function