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

x/sentry/index.d.ts>trace

The Official Sentry Deno SDK
Go to Latest
function trace
Deprecated
Deprecated

Use startSpan instead.

import { trace } from "https://deno.land/x/sentry@7.100.1/index.d.ts";

Wraps a function with a transaction/span and finishes the span after the function is done.

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.

This function is meant to be used internally and may break at any time. Use at your own risk.

Parameters

context: TransactionContext
callback: (span?: Span) => T
optional
onError: (error: unknown, span?: Span) => void
optional
afterFinish: () => void