Takaro - v0.4.11
Preparing search index...
@takaro/util
withSpan
Function withSpan
withSpan
<
T
>
(
name
:
string
,
fn
:
(
span
:
Span
|
null
)
=>
Promise
<
T
>
,
attributes
?:
Record
<
string
,
string
|
number
|
boolean
>
,
)
:
Promise
<
T
>
Wrap an async operation in a span. If tracing is disabled, just runs the function directly.
Type Parameters
T
Parameters
name
:
string
fn
:
(
span
:
Span
|
null
)
=>
Promise
<
T
>
Optional
attributes
:
Record
<
string
,
string
|
number
|
boolean
>
Returns
Promise
<
T
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
Takaro - v0.4.11
Loading...
Wrap an async operation in a span. If tracing is disabled, just runs the function directly.