import { startNewTrace } from "https://deno.land/x/sentry@8.39.0-beta.0/index.d.ts";
Starts a new trace for the duration of the provided callback. Spans started within the callback will be part of the new trace instead of a potentially previously started trace.
Important: Only use this function if you want to override the default trace lifetime and propagation mechanism of the SDK for the duration and scope of the provided callback. The newly created trace will also be the root of a new distributed trace, for example if you make http requests within the callback. This function might be useful if the operation you want to instrument should not be part of a potentially ongoing trace.
Default behavior:
- Server-side: A new trace is started for each incoming request.
- Browser: A new trace is started for each page our route. Navigating to a new route or page will automatically create a new trace.
Parameters
callback: () => T