Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/sentry/index.d.ts>startSpan

The Official Sentry Deno SDK
Latest
function startSpan
import { startSpan } from "https://deno.land/x/sentry@8.39.0-beta.0/index.d.ts";

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.getActiveSpan(), 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.

You'll always get a span passed to the callback, it may just be a non-recording span if the span is not sampled or if tracing is disabled.

Parameters

options: StartSpanOptions
callback: (span: Span) => T