vestig 0.15.1 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Span Processor for vestig
3
+ *
4
+ * Provides a mechanism to process spans when they end, enabling
5
+ * export to external systems like OTLP-compatible backends.
6
+ */
7
+ import type { Span } from '../tracing/types';
8
+ /**
9
+ * Interface for processing spans
10
+ *
11
+ * SpanProcessors are notified when spans start and end,
12
+ * allowing them to batch and export span data.
13
+ */
14
+ export interface SpanProcessor {
15
+ /**
16
+ * Called when a span starts
17
+ * @param span - The span that started
18
+ */
19
+ onStart?(span: Span): void;
20
+ /**
21
+ * Called when a span ends
22
+ * @param span - The span that ended
23
+ */
24
+ onEnd(span: Span): void;
25
+ /**
26
+ * Force flush any buffered spans
27
+ */
28
+ forceFlush?(): Promise<void>;
29
+ /**
30
+ * Shutdown the processor
31
+ */
32
+ shutdown?(): Promise<void>;
33
+ }
34
+ /**
35
+ * Global registry of span processors
36
+ */
37
+ declare class SpanProcessorRegistry {
38
+ private processors;
39
+ /**
40
+ * Register a span processor
41
+ */
42
+ addProcessor(processor: SpanProcessor): void;
43
+ /**
44
+ * Remove a span processor
45
+ */
46
+ removeProcessor(processor: SpanProcessor): boolean;
47
+ /**
48
+ * Get all registered processors
49
+ */
50
+ getProcessors(): readonly SpanProcessor[];
51
+ /**
52
+ * Clear all processors
53
+ */
54
+ clearProcessors(): void;
55
+ /**
56
+ * Notify all processors that a span started
57
+ */
58
+ notifyStart(span: Span): void;
59
+ /**
60
+ * Notify all processors that a span ended
61
+ */
62
+ notifyEnd(span: Span): void;
63
+ /**
64
+ * Force flush all processors
65
+ */
66
+ forceFlush(): Promise<void>;
67
+ /**
68
+ * Shutdown all processors
69
+ */
70
+ shutdown(): Promise<void>;
71
+ }
72
+ /**
73
+ * Global span processor registry singleton
74
+ */
75
+ export declare const spanProcessors: SpanProcessorRegistry;
76
+ /**
77
+ * Register a span processor globally
78
+ *
79
+ * @example
80
+ * ```typescript
81
+ * import { registerSpanProcessor } from 'vestig'
82
+ * import { OTLPExporter } from 'vestig/otlp'
83
+ *
84
+ * const exporter = new OTLPExporter({
85
+ * endpoint: 'https://otel.example.com/v1/traces',
86
+ * serviceName: 'my-service',
87
+ * })
88
+ *
89
+ * registerSpanProcessor(exporter)
90
+ * ```
91
+ */
92
+ export declare function registerSpanProcessor(processor: SpanProcessor): void;
93
+ /**
94
+ * Unregister a span processor
95
+ */
96
+ export declare function unregisterSpanProcessor(processor: SpanProcessor): boolean;
97
+ /**
98
+ * Get all registered span processors
99
+ */
100
+ export declare function getSpanProcessors(): readonly SpanProcessor[];
101
+ /**
102
+ * Force flush all span processors
103
+ */
104
+ export declare function flushSpanProcessors(): Promise<void>;
105
+ /**
106
+ * Shutdown all span processors
107
+ */
108
+ export declare function shutdownSpanProcessors(): Promise<void>;
109
+ export {};
110
+ //# sourceMappingURL=processor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processor.d.ts","sourceRoot":"","sources":["../../src/otlp/processor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAE5C;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,OAAO,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAA;IAE1B;;;OAGG;IACH,KAAK,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAA;IAEvB;;OAEG;IACH,UAAU,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5B;;OAEG;IACH,QAAQ,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC1B;AAED;;GAEG;AACH,cAAM,qBAAqB;IAC1B,OAAO,CAAC,UAAU,CAAsB;IAExC;;OAEG;IACH,YAAY,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI;IAI5C;;OAEG;IACH,eAAe,CAAC,SAAS,EAAE,aAAa,GAAG,OAAO;IAOlD;;OAEG;IACH,aAAa,IAAI,SAAS,aAAa,EAAE;IAIzC;;OAEG;IACH,eAAe,IAAI,IAAI;IAIvB;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAU7B;;OAEG;IACH,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;IAU3B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAUjC;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAU/B;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,uBAA8B,CAAA;AAEzD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI,CAEpE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,aAAa,GAAG,OAAO,CAEzE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,SAAS,aAAa,EAAE,CAE5D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAEnD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAEtD"}
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Span Processor for vestig
3
+ *
4
+ * Provides a mechanism to process spans when they end, enabling
5
+ * export to external systems like OTLP-compatible backends.
6
+ */
7
+ /**
8
+ * Global registry of span processors
9
+ */
10
+ class SpanProcessorRegistry {
11
+ processors = [];
12
+ /**
13
+ * Register a span processor
14
+ */
15
+ addProcessor(processor) {
16
+ this.processors.push(processor);
17
+ }
18
+ /**
19
+ * Remove a span processor
20
+ */
21
+ removeProcessor(processor) {
22
+ const index = this.processors.indexOf(processor);
23
+ if (index === -1)
24
+ return false;
25
+ this.processors.splice(index, 1);
26
+ return true;
27
+ }
28
+ /**
29
+ * Get all registered processors
30
+ */
31
+ getProcessors() {
32
+ return this.processors;
33
+ }
34
+ /**
35
+ * Clear all processors
36
+ */
37
+ clearProcessors() {
38
+ this.processors = [];
39
+ }
40
+ /**
41
+ * Notify all processors that a span started
42
+ */
43
+ notifyStart(span) {
44
+ for (const processor of this.processors) {
45
+ try {
46
+ processor.onStart?.(span);
47
+ }
48
+ catch (err) {
49
+ console.error('[vestig] SpanProcessor.onStart error:', err);
50
+ }
51
+ }
52
+ }
53
+ /**
54
+ * Notify all processors that a span ended
55
+ */
56
+ notifyEnd(span) {
57
+ for (const processor of this.processors) {
58
+ try {
59
+ processor.onEnd(span);
60
+ }
61
+ catch (err) {
62
+ console.error('[vestig] SpanProcessor.onEnd error:', err);
63
+ }
64
+ }
65
+ }
66
+ /**
67
+ * Force flush all processors
68
+ */
69
+ async forceFlush() {
70
+ await Promise.all(this.processors.map((p) => p.forceFlush?.().catch((err) => {
71
+ console.error('[vestig] SpanProcessor.forceFlush error:', err);
72
+ })));
73
+ }
74
+ /**
75
+ * Shutdown all processors
76
+ */
77
+ async shutdown() {
78
+ await Promise.all(this.processors.map((p) => p.shutdown?.().catch((err) => {
79
+ console.error('[vestig] SpanProcessor.shutdown error:', err);
80
+ })));
81
+ this.processors = [];
82
+ }
83
+ }
84
+ /**
85
+ * Global span processor registry singleton
86
+ */
87
+ export const spanProcessors = new SpanProcessorRegistry();
88
+ /**
89
+ * Register a span processor globally
90
+ *
91
+ * @example
92
+ * ```typescript
93
+ * import { registerSpanProcessor } from 'vestig'
94
+ * import { OTLPExporter } from 'vestig/otlp'
95
+ *
96
+ * const exporter = new OTLPExporter({
97
+ * endpoint: 'https://otel.example.com/v1/traces',
98
+ * serviceName: 'my-service',
99
+ * })
100
+ *
101
+ * registerSpanProcessor(exporter)
102
+ * ```
103
+ */
104
+ export function registerSpanProcessor(processor) {
105
+ spanProcessors.addProcessor(processor);
106
+ }
107
+ /**
108
+ * Unregister a span processor
109
+ */
110
+ export function unregisterSpanProcessor(processor) {
111
+ return spanProcessors.removeProcessor(processor);
112
+ }
113
+ /**
114
+ * Get all registered span processors
115
+ */
116
+ export function getSpanProcessors() {
117
+ return spanProcessors.getProcessors();
118
+ }
119
+ /**
120
+ * Force flush all span processors
121
+ */
122
+ export function flushSpanProcessors() {
123
+ return spanProcessors.forceFlush();
124
+ }
125
+ /**
126
+ * Shutdown all span processors
127
+ */
128
+ export function shutdownSpanProcessors() {
129
+ return spanProcessors.shutdown();
130
+ }
131
+ //# sourceMappingURL=processor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processor.js","sourceRoot":"","sources":["../../src/otlp/processor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAkCH;;GAEG;AACH,MAAM,qBAAqB;IAClB,UAAU,GAAoB,EAAE,CAAA;IAExC;;OAEG;IACH,YAAY,CAAC,SAAwB;QACpC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IAChC,CAAC;IAED;;OAEG;IACH,eAAe,CAAC,SAAwB;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;QAChD,IAAI,KAAK,KAAK,CAAC,CAAC;YAAE,OAAO,KAAK,CAAA;QAC9B,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;QAChC,OAAO,IAAI,CAAA;IACZ,CAAC;IAED;;OAEG;IACH,aAAa;QACZ,OAAO,IAAI,CAAC,UAAU,CAAA;IACvB,CAAC;IAED;;OAEG;IACH,eAAe;QACd,IAAI,CAAC,UAAU,GAAG,EAAE,CAAA;IACrB,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,IAAU;QACrB,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACzC,IAAI,CAAC;gBACJ,SAAS,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAA;YAC1B,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACd,OAAO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C,YAAY,CAAC,SAAS,CAAC,CAAA;AACvC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,SAAwB;IAC/D,OAAO,cAAc,CAAC,eAAe,CAAC,SAAS,CAAC,CAAA;AACjD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAChC,OAAO,cAAc,CAAC,aAAa,EAAE,CAAA;AACtC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB;IAClC,OAAO,cAAc,CAAC,UAAU,EAAE,CAAA;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,sBAAsB;IACrC,OAAO,cAAc,CAAC,QAAQ,EAAE,CAAA;AACjC,CAAC"}
@@ -0,0 +1,237 @@
1
+ /**
2
+ * OpenTelemetry Protocol (OTLP) types for vestig
3
+ *
4
+ * These types follow the OTLP/JSON specification for traces and logs.
5
+ * @see https://opentelemetry.io/docs/specs/otlp/
6
+ */
7
+ import type { Span, SpanStatus } from '../tracing/types';
8
+ /**
9
+ * OTLP attribute value types
10
+ */
11
+ export type OTLPAttributeValue = {
12
+ stringValue: string;
13
+ } | {
14
+ intValue: string;
15
+ } | {
16
+ doubleValue: number;
17
+ } | {
18
+ boolValue: boolean;
19
+ } | {
20
+ arrayValue: {
21
+ values: OTLPAttributeValue[];
22
+ };
23
+ } | {
24
+ kvlistValue: {
25
+ values: OTLPKeyValue[];
26
+ };
27
+ };
28
+ /**
29
+ * OTLP key-value pair for attributes
30
+ */
31
+ export interface OTLPKeyValue {
32
+ key: string;
33
+ value: OTLPAttributeValue;
34
+ }
35
+ /**
36
+ * OTLP Resource represents the entity producing telemetry
37
+ */
38
+ export interface OTLPResource {
39
+ attributes: OTLPKeyValue[];
40
+ droppedAttributesCount?: number;
41
+ }
42
+ /**
43
+ * OTLP InstrumentationScope identifies the instrumentation library
44
+ */
45
+ export interface OTLPInstrumentationScope {
46
+ name: string;
47
+ version?: string;
48
+ attributes?: OTLPKeyValue[];
49
+ }
50
+ /**
51
+ * OTLP Span status codes
52
+ * @see https://opentelemetry.io/docs/specs/otel/trace/api/#set-status
53
+ */
54
+ export declare enum OTLPStatusCode {
55
+ /** Default status */
56
+ UNSET = 0,
57
+ /** Operation completed successfully */
58
+ OK = 1,
59
+ /** Operation failed */
60
+ ERROR = 2
61
+ }
62
+ /**
63
+ * OTLP Span Kind
64
+ * @see https://opentelemetry.io/docs/specs/otel/trace/api/#spankind
65
+ */
66
+ export declare enum OTLPSpanKind {
67
+ /** Default, internal operation */
68
+ INTERNAL = 1,
69
+ /** Server handling a request */
70
+ SERVER = 2,
71
+ /** Client making a request */
72
+ CLIENT = 3,
73
+ /** Producer sending a message */
74
+ PRODUCER = 4,
75
+ /** Consumer receiving a message */
76
+ CONSUMER = 5
77
+ }
78
+ /**
79
+ * OTLP Span status
80
+ */
81
+ export interface OTLPSpanStatus {
82
+ code: OTLPStatusCode;
83
+ message?: string;
84
+ }
85
+ /**
86
+ * OTLP Span event
87
+ */
88
+ export interface OTLPSpanEvent {
89
+ timeUnixNano: string;
90
+ name: string;
91
+ attributes?: OTLPKeyValue[];
92
+ droppedAttributesCount?: number;
93
+ }
94
+ /**
95
+ * OTLP Span link (for distributed traces)
96
+ */
97
+ export interface OTLPSpanLink {
98
+ traceId: string;
99
+ spanId: string;
100
+ traceState?: string;
101
+ attributes?: OTLPKeyValue[];
102
+ droppedAttributesCount?: number;
103
+ }
104
+ /**
105
+ * OTLP Span representation
106
+ */
107
+ export interface OTLPSpan {
108
+ traceId: string;
109
+ spanId: string;
110
+ traceState?: string;
111
+ parentSpanId?: string;
112
+ name: string;
113
+ kind: OTLPSpanKind;
114
+ startTimeUnixNano: string;
115
+ endTimeUnixNano: string;
116
+ attributes?: OTLPKeyValue[];
117
+ droppedAttributesCount?: number;
118
+ events?: OTLPSpanEvent[];
119
+ droppedEventsCount?: number;
120
+ links?: OTLPSpanLink[];
121
+ droppedLinksCount?: number;
122
+ status?: OTLPSpanStatus;
123
+ }
124
+ /**
125
+ * OTLP ScopeSpans groups spans by instrumentation scope
126
+ */
127
+ export interface OTLPScopeSpans {
128
+ scope?: OTLPInstrumentationScope;
129
+ spans: OTLPSpan[];
130
+ schemaUrl?: string;
131
+ }
132
+ /**
133
+ * OTLP ResourceSpans groups spans by resource
134
+ */
135
+ export interface OTLPResourceSpans {
136
+ resource?: OTLPResource;
137
+ scopeSpans: OTLPScopeSpans[];
138
+ schemaUrl?: string;
139
+ }
140
+ /**
141
+ * OTLP ExportTraceServiceRequest - the payload sent to /v1/traces
142
+ */
143
+ export interface OTLPExportTraceServiceRequest {
144
+ resourceSpans: OTLPResourceSpans[];
145
+ }
146
+ /**
147
+ * OTLP Log Severity Number
148
+ * @see https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-severitynumber
149
+ */
150
+ export declare enum OTLPSeverityNumber {
151
+ TRACE = 1,
152
+ TRACE2 = 2,
153
+ TRACE3 = 3,
154
+ TRACE4 = 4,
155
+ DEBUG = 5,
156
+ DEBUG2 = 6,
157
+ DEBUG3 = 7,
158
+ DEBUG4 = 8,
159
+ INFO = 9,
160
+ INFO2 = 10,
161
+ INFO3 = 11,
162
+ INFO4 = 12,
163
+ WARN = 13,
164
+ WARN2 = 14,
165
+ WARN3 = 15,
166
+ WARN4 = 16,
167
+ ERROR = 17,
168
+ ERROR2 = 18,
169
+ ERROR3 = 19,
170
+ ERROR4 = 20,
171
+ FATAL = 21,
172
+ FATAL2 = 22,
173
+ FATAL3 = 23,
174
+ FATAL4 = 24
175
+ }
176
+ /**
177
+ * OTLP Log Record
178
+ */
179
+ export interface OTLPLogRecord {
180
+ timeUnixNano: string;
181
+ observedTimeUnixNano?: string;
182
+ severityNumber?: OTLPSeverityNumber;
183
+ severityText?: string;
184
+ body?: OTLPAttributeValue;
185
+ attributes?: OTLPKeyValue[];
186
+ droppedAttributesCount?: number;
187
+ flags?: number;
188
+ traceId?: string;
189
+ spanId?: string;
190
+ }
191
+ /**
192
+ * OTLP ScopeLogs groups logs by instrumentation scope
193
+ */
194
+ export interface OTLPScopeLogs {
195
+ scope?: OTLPInstrumentationScope;
196
+ logRecords: OTLPLogRecord[];
197
+ schemaUrl?: string;
198
+ }
199
+ /**
200
+ * OTLP ResourceLogs groups logs by resource
201
+ */
202
+ export interface OTLPResourceLogs {
203
+ resource?: OTLPResource;
204
+ scopeLogs: OTLPScopeLogs[];
205
+ schemaUrl?: string;
206
+ }
207
+ /**
208
+ * OTLP ExportLogsServiceRequest - the payload sent to /v1/logs
209
+ */
210
+ export interface OTLPExportLogsServiceRequest {
211
+ resourceLogs: OTLPResourceLogs[];
212
+ }
213
+ /**
214
+ * Convert vestig SpanStatus to OTLP StatusCode
215
+ */
216
+ export declare function toOTLPStatusCode(status: SpanStatus): OTLPStatusCode;
217
+ /**
218
+ * Convert a value to an OTLP attribute value
219
+ */
220
+ export declare function toOTLPAttributeValue(value: unknown): OTLPAttributeValue;
221
+ /**
222
+ * Convert a Record to OTLP key-value pairs
223
+ */
224
+ export declare function toOTLPAttributes(attrs: Record<string, unknown>): OTLPKeyValue[];
225
+ /**
226
+ * Convert milliseconds timestamp to nanoseconds string (OTLP format)
227
+ */
228
+ export declare function msToNano(ms: number): string;
229
+ /**
230
+ * Convert ISO date string to nanoseconds string
231
+ */
232
+ export declare function isoToNano(isoString: string): string;
233
+ /**
234
+ * Convert vestig Span to OTLP Span format
235
+ */
236
+ export declare function toOTLPSpan(span: Span, epochStartMs: number): OTLPSpan;
237
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/otlp/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAExD;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC3B;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GACvB;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GACpB;IAAE,WAAW,E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,gBAAgB,CAAC,MAAM,EAAE,UAAU,GAAG,cAAc,CAUnE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,CAyCvE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,YAAY,EAAE,CAW/E;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAI3C;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGnD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,GAAG,QAAQ,CAwCrE"}
@@ -0,0 +1,190 @@
1
+ /**
2
+ * OpenTelemetry Protocol (OTLP) types for vestig
3
+ *
4
+ * These types follow the OTLP/JSON specification for traces and logs.
5
+ * @see https://opentelemetry.io/docs/specs/otlp/
6
+ */
7
+ /**
8
+ * OTLP Span status codes
9
+ * @see https://opentelemetry.io/docs/specs/otel/trace/api/#set-status
10
+ */
11
+ export var OTLPStatusCode;
12
+ (function (OTLPStatusCode) {
13
+ /** Default status */
14
+ OTLPStatusCode[OTLPStatusCode["UNSET"] = 0] = "UNSET";
15
+ /** Operation completed successfully */
16
+ OTLPStatusCode[OTLPStatusCode["OK"] = 1] = "OK";
17
+ /** Operation failed */
18
+ OTLPStatusCode[OTLPStatusCode["ERROR"] = 2] = "ERROR";
19
+ })(OTLPStatusCode || (OTLPStatusCode = {}));
20
+ /**
21
+ * OTLP Span Kind
22
+ * @see https://opentelemetry.io/docs/specs/otel/trace/api/#spankind
23
+ */
24
+ export var OTLPSpanKind;
25
+ (function (OTLPSpanKind) {
26
+ /** Default, internal operation */
27
+ OTLPSpanKind[OTLPSpanKind["INTERNAL"] = 1] = "INTERNAL";
28
+ /** Server handling a request */
29
+ OTLPSpanKind[OTLPSpanKind["SERVER"] = 2] = "SERVER";
30
+ /** Client making a request */
31
+ OTLPSpanKind[OTLPSpanKind["CLIENT"] = 3] = "CLIENT";
32
+ /** Producer sending a message */
33
+ OTLPSpanKind[OTLPSpanKind["PRODUCER"] = 4] = "PRODUCER";
34
+ /** Consumer receiving a message */
35
+ OTLPSpanKind[OTLPSpanKind["CONSUMER"] = 5] = "CONSUMER";
36
+ })(OTLPSpanKind || (OTLPSpanKind = {}));
37
+ /**
38
+ * OTLP Log Severity Number
39
+ * @see https://opentelemetry.io/docs/specs/otel/logs/data-model/#field-severitynumber
40
+ */
41
+ export var OTLPSeverityNumber;
42
+ (function (OTLPSeverityNumber) {
43
+ OTLPSeverityNumber[OTLPSeverityNumber["TRACE"] = 1] = "TRACE";
44
+ OTLPSeverityNumber[OTLPSeverityNumber["TRACE2"] = 2] = "TRACE2";
45
+ OTLPSeverityNumber[OTLPSeverityNumber["TRACE3"] = 3] = "TRACE3";
46
+ OTLPSeverityNumber[OTLPSeverityNumber["TRACE4"] = 4] = "TRACE4";
47
+ OTLPSeverityNumber[OTLPSeverityNumber["DEBUG"] = 5] = "DEBUG";
48
+ OTLPSeverityNumber[OTLPSeverityNumber["DEBUG2"] = 6] = "DEBUG2";
49
+ OTLPSeverityNumber[OTLPSeverityNumber["DEBUG3"] = 7] = "DEBUG3";
50
+ OTLPSeverityNumber[OTLPSeverityNumber["DEBUG4"] = 8] = "DEBUG4";
51
+ OTLPSeverityNumber[OTLPSeverityNumber["INFO"] = 9] = "INFO";
52
+ OTLPSeverityNumber[OTLPSeverityNumber["INFO2"] = 10] = "INFO2";
53
+ OTLPSeverityNumber[OTLPSeverityNumber["INFO3"] = 11] = "INFO3";
54
+ OTLPSeverityNumber[OTLPSeverityNumber["INFO4"] = 12] = "INFO4";
55
+ OTLPSeverityNumber[OTLPSeverityNumber["WARN"] = 13] = "WARN";
56
+ OTLPSeverityNumber[OTLPSeverityNumber["WARN2"] = 14] = "WARN2";
57
+ OTLPSeverityNumber[OTLPSeverityNumber["WARN3"] = 15] = "WARN3";
58
+ OTLPSeverityNumber[OTLPSeverityNumber["WARN4"] = 16] = "WARN4";
59
+ OTLPSeverityNumber[OTLPSeverityNumber["ERROR"] = 17] = "ERROR";
60
+ OTLPSeverityNumber[OTLPSeverityNumber["ERROR2"] = 18] = "ERROR2";
61
+ OTLPSeverityNumber[OTLPSeverityNumber["ERROR3"] = 19] = "ERROR3";
62
+ OTLPSeverityNumber[OTLPSeverityNumber["ERROR4"] = 20] = "ERROR4";
63
+ OTLPSeverityNumber[OTLPSeverityNumber["FATAL"] = 21] = "FATAL";
64
+ OTLPSeverityNumber[OTLPSeverityNumber["FATAL2"] = 22] = "FATAL2";
65
+ OTLPSeverityNumber[OTLPSeverityNumber["FATAL3"] = 23] = "FATAL3";
66
+ OTLPSeverityNumber[OTLPSeverityNumber["FATAL4"] = 24] = "FATAL4";
67
+ })(OTLPSeverityNumber || (OTLPSeverityNumber = {}));
68
+ /**
69
+ * Convert vestig SpanStatus to OTLP StatusCode
70
+ */
71
+ export function toOTLPStatusCode(status) {
72
+ switch (status) {
73
+ case 'ok':
74
+ return OTLPStatusCode.OK;
75
+ case 'error':
76
+ return OTLPStatusCode.ERROR;
77
+ case 'unset':
78
+ default:
79
+ return OTLPStatusCode.UNSET;
80
+ }
81
+ }
82
+ /**
83
+ * Convert a value to an OTLP attribute value
84
+ */
85
+ export function toOTLPAttributeValue(value) {
86
+ if (value === null || value === undefined) {
87
+ return { stringValue: '' };
88
+ }
89
+ if (typeof value === 'string') {
90
+ return { stringValue: value };
91
+ }
92
+ if (typeof value === 'number') {
93
+ if (Number.isInteger(value)) {
94
+ return { intValue: String(value) };
95
+ }
96
+ return { doubleValue: value };
97
+ }
98
+ if (typeof value === 'boolean') {
99
+ return { boolValue: value };
100
+ }
101
+ if (Array.isArray(value)) {
102
+ return {
103
+ arrayValue: {
104
+ values: value.map(toOTLPAttributeValue),
105
+ },
106
+ };
107
+ }
108
+ if (typeof value === 'object') {
109
+ const kvList = [];
110
+ for (const [k, v] of Object.entries(value)) {
111
+ kvList.push({
112
+ key: k,
113
+ value: toOTLPAttributeValue(v),
114
+ });
115
+ }
116
+ return { kvlistValue: { values: kvList } };
117
+ }
118
+ // Fallback: stringify
119
+ return { stringValue: String(value) };
120
+ }
121
+ /**
122
+ * Convert a Record to OTLP key-value pairs
123
+ */
124
+ export function toOTLPAttributes(attrs) {
125
+ const result = [];
126
+ for (const [key, value] of Object.entries(attrs)) {
127
+ if (value !== undefined) {
128
+ result.push({
129
+ key,
130
+ value: toOTLPAttributeValue(value),
131
+ });
132
+ }
133
+ }
134
+ return result;
135
+ }
136
+ /**
137
+ * Convert milliseconds timestamp to nanoseconds string (OTLP format)
138
+ */
139
+ export function msToNano(ms) {
140
+ // Convert ms to nanoseconds (ms * 1_000_000)
141
+ // Use BigInt for precision with large numbers
142
+ return String(BigInt(Math.round(ms)) * BigInt(1_000_000));
143
+ }
144
+ /**
145
+ * Convert ISO date string to nanoseconds string
146
+ */
147
+ export function isoToNano(isoString) {
148
+ const ms = new Date(isoString).getTime();
149
+ return msToNano(ms);
150
+ }
151
+ /**
152
+ * Convert vestig Span to OTLP Span format
153
+ */
154
+ export function toOTLPSpan(span, epochStartMs) {
155
+ // Calculate absolute timestamps from performance.now() offsets
156
+ const startTimeMs = epochStartMs + span.startTime;
157
+ const endTimeMs = span.endTime !== undefined ? epochStartMs + span.endTime : Date.now();
158
+ const otlpSpan = {
159
+ traceId: span.traceId,
160
+ spanId: span.spanId,
161
+ name: span.name,
162
+ kind: OTLPSpanKind.INTERNAL,
163
+ startTimeUnixNano: msToNano(startTimeMs),
164
+ endTimeUnixNano: msToNano(endTimeMs),
165
+ status: {
166
+ code: toOTLPStatusCode(span.status),
167
+ message: span.statusMessage,
168
+ },
169
+ };
170
+ // Add parent span ID if present
171
+ if (span.parentSpanId) {
172
+ otlpSpan.parentSpanId = span.parentSpanId;
173
+ }
174
+ // Add attributes
175
+ const attrs = span.attributes;
176
+ if (Object.keys(attrs).length > 0) {
177
+ otlpSpan.attributes = toOTLPAttributes(attrs);
178
+ }
179
+ // Add events
180
+ const events = span.events;
181
+ if (events.length > 0) {
182
+ otlpSpan.events = events.map((e) => ({
183
+ timeUnixNano: isoToNano(e.timestamp),
184
+ name: e.name,
185
+ attributes: e.attributes ? toOTLPAttributes(e.attributes) : undefined,
186
+ }));
187
+ }
188
+ return otlpSpan;
189
+ }
190
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/otlp/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwCH;;;GAGG;AACH,MAAM,CAAN,IAAY,cAOX;AAPD,WAAY,cAAc;IACzB,qBAAqB;IACrB,qDAAS,CAAA;IACT,uCAAuC;IACvC,+CAAM,CAAA;IACN,uBAAuB;IACvB,qDAAS,CAAA;AACV,CAAC,EAPW,cAAc,KAAd,cAAc,QAOzB;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,YAWX;AAXD,WAAY,YAAY;IACvB,kCAAkC;IAClC,uDAAY,CAAA;IACZ,gCAAgC;IAChC,mDAAU,CAAA;IACV,8BAA8B;IAC9B,mDAAU,CAAA;IACV,iCAAiC;IACjC,uDAAY,CAAA;IACZ,mCAAmC;IACnC,uDAAY,CAAA;AACb,CAAC,EAXW,YAAY,KAAZ,YAAY,QAWvB;AA6ED;;;GAGG;AACH,MAAM,CAAN,IAAY,kBAyBX;AAzBD,WAAY,kBAAkB;IAC7B,6DAAS,CAAA;IACT,+DAAU,CAAA;IACV,+DAAU,CAAA;IACV,+DAAU,CAAA;IACV,6DAAS,CAAA;IACT,+DAAU,CAAA;IACV,+DAAU,CAAA;IACV,+DAAU,CAAA;IACV,2DAAQ,CAAA;IACR,8DAAU,CAAA;IACV,8DAAU,CAAA;IACV,8DAAU,CAAA;IACV,4DAAS,CAAA;IACT,8DAAU,CAAA;IACV,8DAAU,CAAA;IACV,8DAAU,CAAA;IACV,8DAAU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