(span: Span | null, callback: (scope: Scope) => T)
| 184 | * @returns the value returned from the provided callback function. |
| 185 | */ |
| 186 | export function withActiveSpan<T>(span: Span | null, callback: (scope: Scope) => T): T { |
| 187 | const newContextWithActiveSpan = span ? trace.setSpan(context.active(), span) : trace.deleteSpan(context.active()); |
| 188 | return context.with(newContextWithActiveSpan, () => callback(getCurrentScope())); |
| 189 | } |
| 190 | |
| 191 | function getTracer(): Tracer { |
| 192 | const client = getClient<Client & OpenTelemetryClient>(); |
no test coverage detected