1 | import type { Instrumenter, Primitive, Span as SpanInterface, SpanContext, SpanOrigin, 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 | origin?: SpanOrigin;
|
88 | |
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 | constructor(spanContext?: SpanContext);
|
96 | /** An alias for `description` of the Span. */
|
97 | get name(): string;
|
98 | /** Update the name of the span. */
|
99 | set name(name: string);
|
100 | /**
|
101 | * @inheritDoc
|
102 | */
|
103 | startChild(spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>): Span;
|
104 | /**
|
105 | * @inheritDoc
|
106 | */
|
107 | setTag(key: string, value: Primitive): this;
|
108 | /**
|
109 | * @inheritDoc
|
110 | */
|
111 | setData(key: string, value: any): this;
|
112 | /**
|
113 | * @inheritDoc
|
114 | */
|
115 | setStatus(value: SpanStatusType): this;
|
116 | /**
|
117 | * @inheritDoc
|
118 | */
|
119 | setHttpStatus(httpStatus: number): this;
|
120 | /**
|
121 | * @inheritDoc
|
122 | */
|
123 | setName(name: string): void;
|
124 | /**
|
125 | * @inheritDoc
|
126 | */
|
127 | isSuccess(): boolean;
|
128 | /**
|
129 | * @inheritDoc
|
130 | */
|
131 | finish(endTimestamp?: number): void;
|
132 | /**
|
133 | * @inheritDoc
|
134 | */
|
135 | toTraceparent(): string;
|
136 | /**
|
137 | * @inheritDoc
|
138 | */
|
139 | toContext(): SpanContext;
|
140 | /**
|
141 | * @inheritDoc
|
142 | */
|
143 | updateWithContext(spanContext: SpanContext): this;
|
144 | /**
|
145 | * @inheritDoc
|
146 | */
|
147 | getTraceContext(): TraceContext;
|
148 | /**
|
149 | * @inheritDoc
|
150 | */
|
151 | toJSON(): {
|
152 | data?: {
|
153 | [key: string]: any;
|
154 | };
|
155 | description?: string;
|
156 | op?: string;
|
157 | parent_span_id?: string;
|
158 | span_id: string;
|
159 | start_timestamp: number;
|
160 | status?: string;
|
161 | tags?: {
|
162 | [key: string]: Primitive;
|
163 | };
|
164 | timestamp?: number;
|
165 | trace_id: string;
|
166 | origin?: SpanOrigin;
|
167 | };
|
168 | }
|
169 | export type SpanStatusType =
|
170 |
|
171 | 'ok'
|
172 |
|
173 | | 'deadline_exceeded'
|
174 |
|
175 | | 'unauthenticated'
|
176 |
|
177 | | 'permission_denied'
|
178 |
|
179 | | 'not_found'
|
180 |
|
181 | | 'resource_exhausted'
|
182 |
|
183 | | 'invalid_argument'
|
184 |
|
185 | | 'unimplemented'
|
186 |
|
187 | | 'unavailable'
|
188 |
|
189 | | 'internal_error'
|
190 |
|
191 | | 'unknown_error'
|
192 |
|
193 | | 'cancelled'
|
194 |
|
195 | | 'already_exists'
|
196 |
|
197 | | 'failed_precondition'
|
198 |
|
199 | | 'aborted'
|
200 |
|
201 | | 'out_of_range'
|
202 |
|
203 | | 'data_loss';
|
204 |
|
205 |
|
206 |
|
207 |
|
208 |
|
209 |
|
210 | export declare function spanStatusfromHttpCode(httpStatus: number): SpanStatusType;
|
211 |
|
\ | No newline at end of file |