import type { opentelemetry } from "./lib"; /** * Starts a new Span and calls the given function passing it the created span as first argument. * Additionally the new span gets set in context and this context is activated for the duration of the function call. * That means that any following span will have this span as a parent span. * Will also set the core session context as attributes on the span. * * The span is not ended automatically and `span.end()` has to be called explicitly. * * @param name The name of the span * @param fn The callback function which executes under the span * @returns A promise resolving with the callback's return value */ export declare function startActiveSpan(name: string, fn: (span: opentelemetry.api.Span) => Promise): Promise; /** * Like `startActiveSpan` but automatically ends the span when the Promise returned by the callback resolves. * * @param name The name of the span * @param fn The callback function which executes under the span * @returns A promise resolving with the callback's return value */ export declare function wrapActiveSpan(name: string, fn: (span: opentelemetry.api.Span) => Promise): Promise; /** * Starts a new Span. * Start the span without setting it on context. * That means it will not automatically be a parent span for subsequent spans. * Best used to trace linear and synchronous codepaths. * * Will also set the core session context as attributes on the span. * * @param name The name of the span * @returns The span */ export declare function startSpan(name: string): opentelemetry.api.Span;