Skip to main content
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.109.0/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