File size: 1,426 Bytes
fea495a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import type { SpanId, TraceEvent, TraceState } from './types';
export declare enum SpanStatus {
    Started = "started",
    Stopped = "stopped"
}
interface Attributes {
    [key: string]: string;
}
export declare class Span {
    private name;
    private id;
    private parentId?;
    private attrs;
    private status;
    private now;
    private _start;
    constructor({ name, parentId, attrs, startTime, }: {
        name: string;
        parentId?: SpanId;
        startTime?: bigint;
        attrs?: Attributes;
    });
    stop(stopTime?: bigint): void;
    traceChild(name: string, attrs?: Attributes): Span;
    manualTraceChild(name: string, startTime?: bigint, stopTime?: bigint, attrs?: Attributes): void;
    getId(): number;
    setAttribute(key: string, value: string): void;
    traceFn<T>(fn: (span: Span) => T): T;
    traceAsyncFn<T>(fn: (span: Span) => T | Promise<T>): Promise<T>;
}
export declare const trace: (name: string, parentId?: SpanId, attrs?: {
    [key: string]: string;
}) => Span;
export declare const flushAllTraces: (opts?: {
    end: boolean;
}) => Promise<void>;
export declare const exportTraceState: () => TraceState;
export declare const initializeTraceState: (state: TraceState) => void;
export declare function getTraceEvents(): TraceEvent[];
export declare function recordTraceEvents(events: TraceEvent[]): void;
export declare const clearTraceEvents: () => never[];
export {};