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

x/sentry/index.mjs>startTransaction

The Official Sentry Deno SDK
Latest
function startTransaction
Deprecated
Deprecated

Use startSpan(), startSpanManual() or startInactiveSpan() instead.

import { startTransaction } from "https://deno.land/x/sentry@7.120.0/index.mjs";

Starts a new Transaction and returns it. This is the entry point to manual tracing instrumentation.

A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a new child span within the transaction or any span, call the respective .startChild() method.

Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.

The transaction must be finished with a call to its .end() method, at which point the transaction with all its finished child spans will be sent to Sentry.

NOTE: This function should only be used for manual instrumentation. Auto-instrumentation should call startTransaction directly on the hub.

Parameters

context: TransactionContext

Properties of the new Transaction.

optional
customSamplingContext: CustomSamplingContext

Information given to the transaction sampling function (along with context-dependent default values). See Options.tracesSampler.

Returns

ReturnType<Hub["startTransaction"]>

The transaction which was just started