1 | import type { Instrumenter, Primitive, Span as SpanInterface, SpanContext, TraceContext, Transaction } from '@sentry/types';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | export declare class SpanRecorder {
|
9 | spans: Span[];
|
10 | private readonly _maxlen;
|
11 | constructor(maxlen?: number);
|
12 | /**
|
13 | * This is just so that we don't run out of memory while recording a lot
|
14 | * of spans. At some point we just stop and flush out the start of the
|
15 | * trace tree (i.e.the first n spans with the smallest
|
16 | * start_timestamp).
|
17 | */
|
18 | add(span: Span): void;
|
19 | }
|
20 | /**
|
21 | * Span contains all data about a span
|
22 | */
|
23 | export declare class Span implements SpanInterface {
|
24 | |
25 |
|
26 |
|
27 | traceId: string;
|
28 | |
29 |
|
30 |
|
31 | spanId: string;
|
32 | |
33 |
|
34 |
|
35 | parentSpanId?: string;
|
36 | |
37 |
|
38 |
|
39 | status?: SpanStatusType | string;
|
40 | |
41 |
|
42 |
|
43 | sampled?: boolean;
|
44 | |
45 |
|
46 |
|
47 | startTimestamp: number;
|
48 | |
49 |
|
50 |
|
51 | endTimestamp?: number;
|
52 | |
53 |
|
54 |
|
55 | op?: string;
|
56 | |
57 |
|
58 |
|
59 | description?: string;
|
60 | |
61 |
|
62 |
|
63 | tags: {
|
64 | [key: string]: Primitive;
|
65 | };
|
66 | |
67 |
|
68 |
|
69 | data: {
|
70 | [key: string]: any;
|
71 | };
|
72 | |
73 |
|
74 |
|
75 | spanRecorder?: SpanRecorder;
|
76 | |
77 |
|
78 |
|
79 | transaction?: Transaction;
|
80 | |
81 |
|
82 |
|
83 | instrumenter: Instrumenter;
|
84 | |
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 | constructor(spanContext?: SpanContext);
|
92 | /**
|
93 | * @inheritDoc
|
94 | */
|
95 | startChild(spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>): Span;
|
96 | /**
|
97 | * @inheritDoc
|
98 | */
|
99 | setTag(key: string, value: Primitive): this;
|
100 | /**
|
101 | * @inheritDoc
|
102 | */
|
103 | setData(key: string, value: any): this;
|
104 | /**
|
105 | * @inheritDoc
|
106 | */
|
107 | setStatus(value: SpanStatusType): this;
|
108 | /**
|
109 | * @inheritDoc
|
110 | */
|
111 | setHttpStatus(httpStatus: number): this;
|
112 | /**
|
113 | * @inheritDoc
|
114 | */
|
115 | isSuccess(): boolean;
|
116 | /**
|
117 | * @inheritDoc
|
118 | */
|
119 | finish(endTimestamp?: number): void;
|
120 | /**
|
121 | * @inheritDoc
|
122 | */
|
123 | toTraceparent(): string;
|
124 | /**
|
125 | * @inheritDoc
|
126 | */
|
127 | toContext(): SpanContext;
|
128 | /**
|
129 | * @inheritDoc
|
130 | */
|
131 | updateWithContext(spanContext: SpanContext): this;
|
132 | /**
|
133 | * @inheritDoc
|
134 | */
|
135 | getTraceContext(): TraceContext;
|
136 | /**
|
137 | * @inheritDoc
|
138 | */
|
139 | toJSON(): {
|
140 | data?: {
|
141 | [key: string]: any;
|
142 | };
|
143 | description?: string;
|
144 | op?: string;
|
145 | parent_span_id?: string;
|
146 | span_id: string;
|
147 | start_timestamp: number;
|
148 | status?: string;
|
149 | tags?: {
|
150 | [key: string]: Primitive;
|
151 | };
|
152 | timestamp?: number;
|
153 | trace_id: string;
|
154 | };
|
155 | }
|
156 | export declare type SpanStatusType =
|
157 |
|
158 | 'ok'
|
159 |
|
160 | | 'deadline_exceeded'
|
161 |
|
162 | | 'unauthenticated'
|
163 |
|
164 | | 'permission_denied'
|
165 |
|
166 | | 'not_found'
|
167 |
|
168 | | 'resource_exhausted'
|
169 |
|
170 | | 'invalid_argument'
|
171 |
|
172 | | 'unimplemented'
|
173 |
|
174 | | 'unavailable'
|
175 |
|
176 | | 'internal_error'
|
177 |
|
178 | | 'unknown_error'
|
179 |
|
180 | | 'cancelled'
|
181 |
|
182 | | 'already_exists'
|
183 |
|
184 | | 'failed_precondition'
|
185 |
|
186 | | 'aborted'
|
187 |
|
188 | | 'out_of_range'
|
189 |
|
190 | | 'data_loss';
|
191 |
|
192 |
|
193 |
|
194 |
|
195 |
|
196 |
|
197 | export declare function spanStatusfromHttpCode(httpStatus: number): SpanStatusType;
|
198 |
|
\ | No newline at end of file |