Wraps a function with a transaction/span and finishes the span after the function is done.
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.getSpan(), as long as the function is executed while the scope is active.
If you want to create a span that is not set as active, use startInactiveSpan.
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.
Wraps a function with a transaction/span and finishes the span after the function is done. 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.getSpan()
, as long as the function is executed while the scope is active.If you want to create a span that is not set as active, use startInactiveSpan.
Note that if you have not enabled tracing extensions via
addTracingExtensions
or you didn't settracesSampleRate
, this function will not generate spans and thespan
returned from the callback will be undefined.