import { Span } from 'opentracing'; import { Observable } from 'rxjs'; /** * Traces a synchronous function by passing it a new child span. * The span is finished when the function returns. * If the function throws an Error, it is logged and the `error` tag set. * * @param operationName The operation name for the new span * @param childOf The parent span * @param operation The function to call */ export declare function traceSync(operationName: string, childOf: Span, operation: (span: Span) => T): T; /** * Traces a Promise-returning (or async) function by passing it a new child span. * The span is finished when the Promise is resolved. * If the Promise is rejected, the Error is logged and the `error` tag set. * * @param operationName The operation name for the new span * @param childOf The parent span * @param operation The function to call */ export declare function tracePromise(operationName: string, childOf: Span, operation: (span: Span) => Promise): Promise; /** * Traces an Observable-returning function by passing it a new child span. * The span is finished when the Observable completes or is unsubscribed from. * If the Observable errors or the function throws an Error, the Error is logged and the `error` tag set. * * @param operationName The operation name for the new span * @param childOf The parent span * @param operation The function to call */ export declare function traceObservable(operationName: string, childOf: Span, operation: (span: Span) => Observable): Observable;