autotel-plugins 0.19.26 → 0.19.27
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.
- package/dist/bigquery.cjs +393 -309
- package/dist/bigquery.d.cts +56 -44
- package/dist/bigquery.d.ts +56 -44
- package/dist/bigquery.js +389 -308
- package/dist/constants-DKKe2D25.d.cts +94 -47
- package/dist/constants-DKKe2D25.d.ts +94 -47
- package/dist/index.cjs +853 -627
- package/dist/index.d.cts +124 -4
- package/dist/index.d.ts +124 -4
- package/dist/index.js +856 -598
- package/dist/kafka.cjs +330 -226
- package/dist/kafka.d.cts +458 -345
- package/dist/kafka.d.ts +458 -345
- package/dist/kafka.js +326 -210
- package/dist/rabbitmq.cjs +117 -84
- package/dist/rabbitmq.d.cts +218 -151
- package/dist/rabbitmq.d.ts +218 -151
- package/dist/rabbitmq.js +129 -79
- package/package.json +2 -2
- package/binding.gyp +0 -9
- package/index.js +0 -1
package/dist/rabbitmq.d.ts
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
import { SpanLink, Span, Context } from 'autotel';
|
|
2
|
-
export {
|
|
2
|
+
export {
|
|
3
|
+
C as CORRELATION_ID_HEADER,
|
|
4
|
+
t as SEMATTRS_LINKED_TRACE_ID_COUNT,
|
|
5
|
+
u as SEMATTRS_LINKED_TRACE_ID_HASH,
|
|
6
|
+
w as SEMATTRS_MESSAGING_CONSUMER_ID,
|
|
7
|
+
x as SEMATTRS_MESSAGING_DESTINATION_NAME,
|
|
8
|
+
I as SEMATTRS_MESSAGING_MESSAGE_CONVERSATION_ID,
|
|
9
|
+
J as SEMATTRS_MESSAGING_MESSAGE_ID,
|
|
10
|
+
L as SEMATTRS_MESSAGING_OPERATION_NAME,
|
|
11
|
+
M as SEMATTRS_MESSAGING_RABBITMQ_ACK_RESULT,
|
|
12
|
+
N as SEMATTRS_MESSAGING_RABBITMQ_DESTINATION_EXCHANGE,
|
|
13
|
+
O as SEMATTRS_MESSAGING_RABBITMQ_DESTINATION_ROUTING_KEY,
|
|
14
|
+
P as SEMATTRS_MESSAGING_RABBITMQ_REQUEUE,
|
|
15
|
+
Q as SEMATTRS_MESSAGING_SYSTEM,
|
|
16
|
+
} from './constants-DKKe2D25.js';
|
|
3
17
|
|
|
4
18
|
/**
|
|
5
19
|
* RabbitMQ plugin types - Processing spans, ack tracking, and correlation
|
|
@@ -12,7 +26,9 @@ export { C as CORRELATION_ID_HEADER, t as SEMATTRS_LINKED_TRACE_ID_COUNT, u as S
|
|
|
12
26
|
* Raw AMQP headers as provided by amqplib.
|
|
13
27
|
* Values can be string, Buffer, number, boolean, or undefined.
|
|
14
28
|
*/
|
|
15
|
-
type RawAmqpHeaders =
|
|
29
|
+
type RawAmqpHeaders =
|
|
30
|
+
| Record<string, string | Buffer | number | boolean | object | undefined>
|
|
31
|
+
| undefined;
|
|
16
32
|
/**
|
|
17
33
|
* Context mode for processing spans.
|
|
18
34
|
*
|
|
@@ -39,162 +55,158 @@ type AckOutcome = 'ack' | 'nack' | 'reject';
|
|
|
39
55
|
* Controls for deferred ack tracking mode.
|
|
40
56
|
*/
|
|
41
57
|
interface AckControls {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
*/
|
|
57
|
-
reject(options?: {
|
|
58
|
-
requeue?: boolean;
|
|
59
|
-
}): void;
|
|
58
|
+
/**
|
|
59
|
+
* Acknowledge the message successfully. Ends the span with success.
|
|
60
|
+
*/
|
|
61
|
+
ack(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Negative acknowledge the message. Ends the span with the nack outcome.
|
|
64
|
+
* @param options - Options for nack behavior
|
|
65
|
+
*/
|
|
66
|
+
nack(options?: { requeue?: boolean }): void;
|
|
67
|
+
/**
|
|
68
|
+
* Reject the message. Ends the span with the reject outcome.
|
|
69
|
+
* @param options - Options for reject behavior
|
|
70
|
+
*/
|
|
71
|
+
reject(options?: { requeue?: boolean }): void;
|
|
60
72
|
}
|
|
61
73
|
/**
|
|
62
74
|
* Descriptor for creating a consume/processing span.
|
|
63
75
|
*/
|
|
64
76
|
interface ConsumeDescriptor {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Name for the processing span (e.g., "order.process")
|
|
79
|
+
*/
|
|
80
|
+
name: string;
|
|
81
|
+
/**
|
|
82
|
+
* AMQP message headers for context extraction.
|
|
83
|
+
*/
|
|
84
|
+
headers: RawAmqpHeaders;
|
|
85
|
+
/**
|
|
86
|
+
* Context mode for relating to extracted remote context.
|
|
87
|
+
* @default 'inherit'
|
|
88
|
+
*/
|
|
89
|
+
contextMode?: ContextMode;
|
|
90
|
+
/**
|
|
91
|
+
* Additional span links to include.
|
|
92
|
+
*/
|
|
93
|
+
links?: SpanLink[];
|
|
94
|
+
/**
|
|
95
|
+
* Queue name. Sets `messaging.destination.name` attribute.
|
|
96
|
+
*/
|
|
97
|
+
queue?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Source exchange name. Sets `messaging.rabbitmq.destination.exchange` attribute.
|
|
100
|
+
*/
|
|
101
|
+
exchange?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Routing key. Sets `messaging.rabbitmq.destination.routing_key` attribute.
|
|
104
|
+
*/
|
|
105
|
+
routingKey?: string;
|
|
106
|
+
/**
|
|
107
|
+
* AMQP message ID. Sets `messaging.message.id` attribute.
|
|
108
|
+
*/
|
|
109
|
+
messageId?: string;
|
|
110
|
+
/**
|
|
111
|
+
* AMQP correlation ID. Sets `messaging.message.conversation_id` attribute.
|
|
112
|
+
*/
|
|
113
|
+
correlationId?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Consumer tag. Sets `messaging.consumer.id` attribute.
|
|
116
|
+
*/
|
|
117
|
+
consumerTag?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Defer span end until ack/nack/reject is called.
|
|
120
|
+
* When true, the callback receives AckControls and span ends when one is called.
|
|
121
|
+
* @default false
|
|
122
|
+
*/
|
|
123
|
+
deferSpanEnd?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Timeout in milliseconds for deferred span end.
|
|
126
|
+
* Required when `deferSpanEnd` is true.
|
|
127
|
+
*/
|
|
128
|
+
ackTimeoutMs?: number;
|
|
117
129
|
}
|
|
118
130
|
/**
|
|
119
131
|
* Descriptor for creating a publish span.
|
|
120
132
|
*/
|
|
121
133
|
interface PublishDescriptor {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
134
|
+
/**
|
|
135
|
+
* Name for the publish span (e.g., "order.publish")
|
|
136
|
+
*/
|
|
137
|
+
name: string;
|
|
138
|
+
/**
|
|
139
|
+
* Exchange name. Sets `messaging.destination.name` attribute.
|
|
140
|
+
* Defaults to 'amq.default' for default exchange.
|
|
141
|
+
*/
|
|
142
|
+
exchange?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Routing key. Sets `messaging.rabbitmq.destination.routing_key` attribute.
|
|
145
|
+
*/
|
|
146
|
+
routingKey: string;
|
|
147
|
+
/**
|
|
148
|
+
* AMQP message ID. Sets `messaging.message.id` attribute.
|
|
149
|
+
*/
|
|
150
|
+
messageId?: string;
|
|
151
|
+
/**
|
|
152
|
+
* AMQP correlation ID. Sets `messaging.message.conversation_id` attribute.
|
|
153
|
+
*/
|
|
154
|
+
correlationId?: string;
|
|
155
|
+
/**
|
|
156
|
+
* Messaging system. Defaults to 'rabbitmq'.
|
|
157
|
+
*/
|
|
158
|
+
system?: string;
|
|
147
159
|
}
|
|
148
160
|
/**
|
|
149
161
|
* Options for injecting trace headers.
|
|
150
162
|
*/
|
|
151
163
|
interface InjectOptions {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
164
|
+
/**
|
|
165
|
+
* Explicit correlation ID to use. If not provided, derives from current context.
|
|
166
|
+
*/
|
|
167
|
+
correlationId?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Whether to include x-correlation-id header.
|
|
170
|
+
* @default true
|
|
171
|
+
*/
|
|
172
|
+
includeCorrelationIdHeader?: boolean;
|
|
161
173
|
}
|
|
162
174
|
/**
|
|
163
175
|
* Options for batch lineage extraction.
|
|
164
176
|
*/
|
|
165
177
|
interface BatchLineageOptions {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
178
|
+
/**
|
|
179
|
+
* Include raw trace IDs in the result.
|
|
180
|
+
* @default false (privacy consideration)
|
|
181
|
+
*/
|
|
182
|
+
includeTraceIds?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Maximum number of links to include.
|
|
185
|
+
* @default 128
|
|
186
|
+
*/
|
|
187
|
+
maxLinks?: number;
|
|
176
188
|
}
|
|
177
189
|
/**
|
|
178
190
|
* Result of batch lineage extraction.
|
|
179
191
|
*/
|
|
180
192
|
interface BatchLineageResult {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
193
|
+
/**
|
|
194
|
+
* Count of unique, linked trace IDs.
|
|
195
|
+
*/
|
|
196
|
+
linked_trace_id_count: number;
|
|
197
|
+
/**
|
|
198
|
+
* Hash of sorted trace IDs (16 hex chars, 64-bit).
|
|
199
|
+
* Useful for comparing batches without exposing individual trace IDs.
|
|
200
|
+
*/
|
|
201
|
+
linked_trace_id_hash: string;
|
|
202
|
+
/**
|
|
203
|
+
* Raw trace IDs, only if includeTraceIds was true.
|
|
204
|
+
*/
|
|
205
|
+
trace_ids?: string[];
|
|
206
|
+
/**
|
|
207
|
+
* Valid SpanLinks from extracted contexts (capped at maxLinks).
|
|
208
|
+
*/
|
|
209
|
+
links: SpanLink[];
|
|
198
210
|
}
|
|
199
211
|
/**
|
|
200
212
|
* Type for the consume span callback function without deferred ack.
|
|
@@ -203,7 +215,10 @@ type ConsumeSpanCallback<T> = (span: Span) => Promise<T>;
|
|
|
203
215
|
/**
|
|
204
216
|
* Type for the consume span callback function with deferred ack controls.
|
|
205
217
|
*/
|
|
206
|
-
type DeferredConsumeSpanCallback<T> = (
|
|
218
|
+
type DeferredConsumeSpanCallback<T> = (
|
|
219
|
+
span: Span,
|
|
220
|
+
controls: AckControls,
|
|
221
|
+
) => Promise<T>;
|
|
207
222
|
/**
|
|
208
223
|
* Type for the publish span callback function.
|
|
209
224
|
*/
|
|
@@ -212,7 +227,7 @@ type PublishSpanCallback<T> = (span: Span) => Promise<T>;
|
|
|
212
227
|
* Item with optional headers for batch lineage extraction.
|
|
213
228
|
*/
|
|
214
229
|
interface BatchItem {
|
|
215
|
-
|
|
230
|
+
headers?: RawAmqpHeaders;
|
|
216
231
|
}
|
|
217
232
|
|
|
218
233
|
/**
|
|
@@ -248,7 +263,9 @@ interface BatchItem {
|
|
|
248
263
|
* // { traceparent: '00-abc...', 'content-type': 'application/json', retryCount: '3' }
|
|
249
264
|
* ```
|
|
250
265
|
*/
|
|
251
|
-
declare function normalizeHeaders(
|
|
266
|
+
declare function normalizeHeaders(
|
|
267
|
+
headers?: RawAmqpHeaders,
|
|
268
|
+
): Record<string, string>;
|
|
252
269
|
/**
|
|
253
270
|
* Extract trace context from normalized headers using OTel propagators.
|
|
254
271
|
*
|
|
@@ -332,7 +349,10 @@ declare function deriveCorrelationId(): string;
|
|
|
332
349
|
* }
|
|
333
350
|
* ```
|
|
334
351
|
*/
|
|
335
|
-
declare function extractCorrelationId(
|
|
352
|
+
declare function extractCorrelationId(
|
|
353
|
+
headers: Record<string, string>,
|
|
354
|
+
amqpCorrelationId?: string,
|
|
355
|
+
): string | undefined;
|
|
336
356
|
/**
|
|
337
357
|
* Inject trace headers into outgoing message headers.
|
|
338
358
|
*
|
|
@@ -362,7 +382,10 @@ declare function extractCorrelationId(headers: Record<string, string>, amqpCorre
|
|
|
362
382
|
* });
|
|
363
383
|
* ```
|
|
364
384
|
*/
|
|
365
|
-
declare function injectTraceHeaders(
|
|
385
|
+
declare function injectTraceHeaders(
|
|
386
|
+
base?: Record<string, string>,
|
|
387
|
+
options?: InjectOptions,
|
|
388
|
+
): Record<string, string>;
|
|
366
389
|
|
|
367
390
|
/**
|
|
368
391
|
* Processing span wrapper for RabbitMQ message handling.
|
|
@@ -427,14 +450,23 @@ declare function injectTraceHeaders(base?: Record<string, string>, options?: Inj
|
|
|
427
450
|
* });
|
|
428
451
|
* ```
|
|
429
452
|
*/
|
|
430
|
-
declare function withConsumeSpan<T>(
|
|
453
|
+
declare function withConsumeSpan<T>(
|
|
454
|
+
descriptor: ConsumeDescriptor & {
|
|
431
455
|
deferSpanEnd: true;
|
|
432
456
|
ackTimeoutMs: number;
|
|
433
|
-
},
|
|
434
|
-
|
|
457
|
+
},
|
|
458
|
+
fn: DeferredConsumeSpanCallback<T>,
|
|
459
|
+
): Promise<T>;
|
|
460
|
+
declare function withConsumeSpan<T>(
|
|
461
|
+
descriptor: ConsumeDescriptor & {
|
|
435
462
|
deferSpanEnd?: false;
|
|
436
|
-
},
|
|
437
|
-
|
|
463
|
+
},
|
|
464
|
+
fn: ConsumeSpanCallback<T>,
|
|
465
|
+
): Promise<T>;
|
|
466
|
+
declare function withConsumeSpan<T>(
|
|
467
|
+
descriptor: ConsumeDescriptor,
|
|
468
|
+
fn: ConsumeSpanCallback<T> | DeferredConsumeSpanCallback<T>,
|
|
469
|
+
): Promise<T>;
|
|
438
470
|
|
|
439
471
|
/**
|
|
440
472
|
* Publish span wrapper for RabbitMQ message publishing.
|
|
@@ -495,7 +527,10 @@ declare function withConsumeSpan<T>(descriptor: ConsumeDescriptor, fn: ConsumeSp
|
|
|
495
527
|
* });
|
|
496
528
|
* ```
|
|
497
529
|
*/
|
|
498
|
-
declare function withPublishSpan<T>(
|
|
530
|
+
declare function withPublishSpan<T>(
|
|
531
|
+
descriptor: PublishDescriptor,
|
|
532
|
+
fn: PublishSpanCallback<T>,
|
|
533
|
+
): Promise<T>;
|
|
499
534
|
|
|
500
535
|
/**
|
|
501
536
|
* Batch lineage utilities for fan-in trace correlation.
|
|
@@ -545,7 +580,10 @@ declare function withPublishSpan<T>(descriptor: PublishDescriptor, fn: PublishSp
|
|
|
545
580
|
* });
|
|
546
581
|
* ```
|
|
547
582
|
*/
|
|
548
|
-
declare function extractBatchLineage(
|
|
583
|
+
declare function extractBatchLineage(
|
|
584
|
+
items: BatchItem[],
|
|
585
|
+
options?: BatchLineageOptions,
|
|
586
|
+
): BatchLineageResult;
|
|
549
587
|
|
|
550
588
|
/**
|
|
551
589
|
* Ack tracking utilities for RabbitMQ message processing.
|
|
@@ -562,10 +600,10 @@ type AckResult = 'ack' | 'nack' | 'reject';
|
|
|
562
600
|
* Options for recording ack results.
|
|
563
601
|
*/
|
|
564
602
|
interface RecordAckOptions {
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
603
|
+
/**
|
|
604
|
+
* Whether the message will be requeued (for nack/reject).
|
|
605
|
+
*/
|
|
606
|
+
requeue?: boolean;
|
|
569
607
|
}
|
|
570
608
|
/**
|
|
571
609
|
* Record an ack result on a span.
|
|
@@ -598,6 +636,35 @@ interface RecordAckOptions {
|
|
|
598
636
|
* });
|
|
599
637
|
* ```
|
|
600
638
|
*/
|
|
601
|
-
declare function recordAckResult(
|
|
639
|
+
declare function recordAckResult(
|
|
640
|
+
span: Span,
|
|
641
|
+
result: AckResult,
|
|
642
|
+
options?: RecordAckOptions,
|
|
643
|
+
): void;
|
|
602
644
|
|
|
603
|
-
export {
|
|
645
|
+
export {
|
|
646
|
+
type AckControls,
|
|
647
|
+
type AckOutcome,
|
|
648
|
+
type AckResult,
|
|
649
|
+
type BatchItem,
|
|
650
|
+
type BatchLineageOptions,
|
|
651
|
+
type BatchLineageResult,
|
|
652
|
+
type ConsumeDescriptor,
|
|
653
|
+
type ConsumeSpanCallback,
|
|
654
|
+
type ContextMode,
|
|
655
|
+
type DeferredConsumeSpanCallback,
|
|
656
|
+
type InjectOptions,
|
|
657
|
+
type PublishDescriptor,
|
|
658
|
+
type PublishSpanCallback,
|
|
659
|
+
type RawAmqpHeaders,
|
|
660
|
+
type RecordAckOptions,
|
|
661
|
+
deriveCorrelationId,
|
|
662
|
+
extractBatchLineage,
|
|
663
|
+
extractCorrelationId,
|
|
664
|
+
extractTraceContext,
|
|
665
|
+
injectTraceHeaders,
|
|
666
|
+
normalizeHeaders,
|
|
667
|
+
recordAckResult,
|
|
668
|
+
withConsumeSpan,
|
|
669
|
+
withPublishSpan,
|
|
670
|
+
};
|