autotel 7.8.0 → 7.10.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.
- package/README.md +14 -0
- package/dist/analysis.cjs +1 -1
- package/dist/analysis.d.cts +6 -7
- package/dist/analysis.d.ts +6 -7
- package/dist/analysis.js +1 -1
- package/dist/attributes.d.cts +1 -1
- package/dist/attributes.d.ts +1 -1
- package/dist/auto.cjs +1 -1
- package/dist/auto.js +1 -1
- package/dist/business-baggage.d.cts +12 -13
- package/dist/business-baggage.d.ts +12 -13
- package/dist/{canonical-log-line-processor-Bwrt_L4c.d.ts → canonical-log-line-processor-DDGzm-wi.d.ts} +1 -1
- package/dist/{canonical-log-line-processor-C0Z_N4oL.d.cts → canonical-log-line-processor-DLeAQjgb.d.cts} +1 -1
- package/dist/channel-BobQKsZd.js +64 -0
- package/dist/channel-D0eaVqn3.cjs +81 -0
- package/dist/config.d.cts +7 -7
- package/dist/config.d.ts +7 -7
- package/dist/correlation-id.cjs +1 -1
- package/dist/correlation-id.d.cts +9 -10
- package/dist/correlation-id.d.ts +9 -10
- package/dist/correlation-id.js +1 -1
- package/dist/db.d.cts +18 -19
- package/dist/db.d.ts +18 -19
- package/dist/decorators.cjs +1 -1
- package/dist/decorators.d.cts +7 -7
- package/dist/decorators.d.ts +7 -7
- package/dist/decorators.js +1 -1
- package/dist/diagnostics.cjs +10 -70
- package/dist/diagnostics.d.cts +6 -6
- package/dist/diagnostics.d.ts +6 -6
- package/dist/diagnostics.js +1 -61
- package/dist/drain-pipeline.d.cts +4 -5
- package/dist/drain-pipeline.d.ts +4 -5
- package/dist/enrichers.d.cts +7 -8
- package/dist/enrichers.d.ts +7 -8
- package/dist/event.cjs +1 -1
- package/dist/event.d.cts +6 -6
- package/dist/event.d.ts +6 -6
- package/dist/event.js +1 -1
- package/dist/evidence.d.cts +13 -14
- package/dist/evidence.d.ts +13 -14
- package/dist/exception-fingerprint.d.cts +10 -11
- package/dist/exception-fingerprint.d.ts +10 -11
- package/dist/exporters.d.cts +2 -2
- package/dist/exporters.d.ts +2 -2
- package/dist/feature-flags.d.cts +23 -24
- package/dist/feature-flags.d.ts +23 -24
- package/dist/{filtering-span-processor-vkewzbqB.d.ts → filtering-span-processor-BDGe1myy.d.ts} +1 -1
- package/dist/{filtering-span-processor-BpDagWNa.d.cts → filtering-span-processor-BYvLMiNz.d.cts} +1 -1
- package/dist/filtering-span-processor.cjs +3 -3
- package/dist/filtering-span-processor.d.cts +1 -1
- package/dist/filtering-span-processor.d.ts +1 -1
- package/dist/filtering-span-processor.js +3 -3
- package/dist/{functional-SeRUabkE.d.ts → functional-CbcInXMJ.d.ts} +1 -1
- package/dist/{functional-u5Qwjray.cjs → functional-CjZT7Jur.cjs} +19 -21
- package/dist/{functional-CC2BFGAO.js → functional-DHn-xGtR.js} +21 -23
- package/dist/{functional-DPZTpGh6.d.cts → functional-j8Joyrwd.d.cts} +1 -1
- package/dist/functional.cjs +1 -1
- package/dist/functional.d.cts +1 -1
- package/dist/functional.d.ts +1 -1
- package/dist/functional.js +1 -1
- package/dist/http.cjs +1 -1
- package/dist/http.d.cts +6 -7
- package/dist/http.d.ts +6 -7
- package/dist/http.js +1 -1
- package/dist/{index-B9aRLp6c.d.ts → index-DAH41w0W.d.ts} +4 -4
- package/dist/{index-8bFU4kmd.d.cts → index-DVPsz3DK.d.cts} +4 -4
- package/dist/index.cjs +3 -2
- package/dist/index.d.cts +38 -38
- package/dist/index.d.ts +38 -38
- package/dist/index.js +4 -4
- package/dist/{init-COfMwKbc.d.cts → init-BtYaU5n9.d.cts} +18 -4
- package/dist/{init-CnoRlJqS.d.ts → init-DUIFqRRS.d.ts} +18 -4
- package/dist/{init-8SISAGdE.js → init-rVPOUqng.js} +171 -10
- package/dist/{init-21HWbm7_.cjs → init-zb68UvOW.cjs} +180 -6
- package/dist/instrumentation.cjs +1 -1
- package/dist/instrumentation.d.cts +4 -5
- package/dist/instrumentation.d.ts +4 -5
- package/dist/instrumentation.js +1 -1
- package/dist/{logger-S1Fgl0g3.d.cts → logger-C9UT1aZ_.d.cts} +4 -4
- package/dist/{logger-S1Fgl0g3.d.ts → logger-C9UT1aZ_.d.ts} +4 -4
- package/dist/logger.d.cts +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/messaging-adapters.d.cts +10 -11
- package/dist/messaging-adapters.d.ts +10 -11
- package/dist/messaging-testing.d.cts +19 -20
- package/dist/messaging-testing.d.ts +19 -20
- package/dist/messaging.cjs +2 -2
- package/dist/messaging.d.cts +23 -24
- package/dist/messaging.d.ts +23 -24
- package/dist/messaging.js +2 -2
- package/dist/metric-helpers.d.cts +6 -7
- package/dist/metric-helpers.d.ts +6 -7
- package/dist/metric.d.cts +7 -7
- package/dist/metric.d.ts +7 -7
- package/dist/parse-error.d.cts +3 -4
- package/dist/parse-error.d.ts +3 -4
- package/dist/policy.cjs +0 -0
- package/dist/policy.js +0 -0
- package/dist/processors.d.cts +1 -1
- package/dist/processors.d.ts +1 -1
- package/dist/{sampling-CZi7OM9u.d.ts → sampling-B_8orhSB.d.ts} +1 -1
- package/dist/{sampling-DENUjT_8.d.cts → sampling-Dud4XU2m.d.cts} +1 -1
- package/dist/sampling.cjs +1 -1
- package/dist/sampling.d.cts +1 -1
- package/dist/sampling.d.ts +1 -1
- package/dist/sampling.js +1 -1
- package/dist/security-schema.d.cts +30 -31
- package/dist/security-schema.d.ts +30 -31
- package/dist/semantic-conventions-yG0X2AsN.d.cts +31 -0
- package/dist/semantic-conventions-yG0X2AsN.d.ts +31 -0
- package/dist/semantic-conventions.d.cts +1 -1
- package/dist/semantic-conventions.d.ts +1 -1
- package/dist/semantic-helpers.cjs +1 -1
- package/dist/semantic-helpers.d.cts +10 -11
- package/dist/semantic-helpers.d.ts +10 -11
- package/dist/semantic-helpers.js +1 -1
- package/dist/slo.d.cts +12 -13
- package/dist/slo.d.ts +12 -13
- package/dist/tail-sampling-processor.cjs +1 -1
- package/dist/tail-sampling-processor.d.cts +2 -3
- package/dist/tail-sampling-processor.d.ts +2 -3
- package/dist/tail-sampling-processor.js +1 -1
- package/dist/test-span-collector.d.cts +4 -5
- package/dist/test-span-collector.d.ts +4 -5
- package/dist/testing.d.cts +18 -18
- package/dist/testing.d.ts +18 -18
- package/dist/trace-helpers.d.cts +15 -16
- package/dist/trace-helpers.d.ts +15 -16
- package/dist/tracer-provider.cjs +21 -1
- package/dist/tracer-provider.d.cts +16 -6
- package/dist/tracer-provider.d.ts +16 -6
- package/dist/tracer-provider.js +22 -3
- package/dist/validate.cjs +8 -7
- package/dist/validate.d.cts +12 -12
- package/dist/validate.d.ts +12 -12
- package/dist/validate.js +8 -7
- package/dist/validation-attributes.d.cts +14 -15
- package/dist/validation-attributes.d.ts +14 -15
- package/dist/webhook.cjs +1 -1
- package/dist/webhook.d.cts +11 -12
- package/dist/webhook.d.ts +11 -12
- package/dist/webhook.js +1 -1
- package/dist/workflow-distributed.cjs +1 -1
- package/dist/workflow-distributed.d.cts +26 -27
- package/dist/workflow-distributed.d.ts +26 -27
- package/dist/workflow-distributed.js +1 -1
- package/dist/workflow.cjs +1 -1
- package/dist/workflow.d.cts +11 -12
- package/dist/workflow.d.ts +11 -12
- package/dist/workflow.js +1 -1
- package/dist/yaml-config.cjs +1 -1
- package/dist/yaml-config.d.cts +9 -10
- package/dist/yaml-config.d.ts +9 -10
- package/dist/yaml-config.js +1 -1
- package/package.json +15 -21
- package/dist/semantic-conventions-FhSxv-bK.d.cts +0 -31
- package/dist/semantic-conventions-FhSxv-bK.d.ts +0 -31
package/dist/correlation-id.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ type CorrelationStore = {
|
|
|
6
6
|
/**
|
|
7
7
|
* Baggage key for correlation ID propagation
|
|
8
8
|
*/
|
|
9
|
-
declare const CORRELATION_ID_BAGGAGE_KEY = "autotel.correlation_id";
|
|
9
|
+
export declare const CORRELATION_ID_BAGGAGE_KEY = "autotel.correlation_id";
|
|
10
10
|
/**
|
|
11
11
|
* Generate a new correlation ID
|
|
12
12
|
*
|
|
@@ -20,7 +20,7 @@ declare const CORRELATION_ID_BAGGAGE_KEY = "autotel.correlation_id";
|
|
|
20
20
|
* // Returns: 'a1b2c3d4e5f67890'
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
declare function generateCorrelationId(): string;
|
|
23
|
+
export declare function generateCorrelationId(): string;
|
|
24
24
|
/**
|
|
25
25
|
* Get the current correlation ID from context
|
|
26
26
|
*
|
|
@@ -40,7 +40,7 @@ declare function generateCorrelationId(): string;
|
|
|
40
40
|
* }
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
|
-
declare function getCorrelationId(): string | undefined;
|
|
43
|
+
export declare function getCorrelationId(): string | undefined;
|
|
44
44
|
/**
|
|
45
45
|
* Get or create a correlation ID
|
|
46
46
|
*
|
|
@@ -55,7 +55,7 @@ declare function getCorrelationId(): string | undefined;
|
|
|
55
55
|
* // Always returns a valid correlation ID
|
|
56
56
|
* ```
|
|
57
57
|
*/
|
|
58
|
-
declare function getOrCreateCorrelationId(): string;
|
|
58
|
+
export declare function getOrCreateCorrelationId(): string;
|
|
59
59
|
/**
|
|
60
60
|
* Run a function with a specific correlation ID in context
|
|
61
61
|
*
|
|
@@ -74,7 +74,7 @@ declare function getOrCreateCorrelationId(): string;
|
|
|
74
74
|
* });
|
|
75
75
|
* ```
|
|
76
76
|
*/
|
|
77
|
-
declare function runWithCorrelationId<T>(correlationId: string, fn: () => T): T;
|
|
77
|
+
export declare function runWithCorrelationId<T>(correlationId: string, fn: () => T): T;
|
|
78
78
|
/**
|
|
79
79
|
* Set correlation ID in the current context (mutates context)
|
|
80
80
|
*
|
|
@@ -89,7 +89,7 @@ declare function runWithCorrelationId<T>(correlationId: string, fn: () => T): T;
|
|
|
89
89
|
* // Now getCorrelationId() returns 'abc123'
|
|
90
90
|
* ```
|
|
91
91
|
*/
|
|
92
|
-
declare function setCorrelationId(correlationId: string): void;
|
|
92
|
+
export declare function setCorrelationId(correlationId: string): void;
|
|
93
93
|
/**
|
|
94
94
|
* Set correlation ID in baggage for propagation
|
|
95
95
|
*
|
|
@@ -110,10 +110,9 @@ declare function setCorrelationId(correlationId: string): void;
|
|
|
110
110
|
* });
|
|
111
111
|
* ```
|
|
112
112
|
*/
|
|
113
|
-
declare function setCorrelationIdInBaggage(correlationId: string): import('@opentelemetry/api').Context;
|
|
113
|
+
export declare function setCorrelationIdInBaggage(correlationId: string): import('@opentelemetry/api').Context;
|
|
114
114
|
/**
|
|
115
115
|
* Get the correlation storage instance (for internal use in init/shutdown)
|
|
116
116
|
*/
|
|
117
|
-
declare function getCorrelationStorage(): AsyncLocalStorage<CorrelationStore>;
|
|
118
|
-
//#endregion
|
|
119
|
-
export { CORRELATION_ID_BAGGAGE_KEY, generateCorrelationId, getCorrelationId, getCorrelationStorage, getOrCreateCorrelationId, runWithCorrelationId, setCorrelationId, setCorrelationIdInBaggage };
|
|
117
|
+
export declare function getCorrelationStorage(): AsyncLocalStorage<CorrelationStore>;
|
|
118
|
+
//#endregion
|
package/dist/correlation-id.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as generateCorrelationId, Q as CORRELATION_ID_BAGGAGE_KEY, at as setCorrelationIdInBaggage, et as getCorrelationId, it as setCorrelationId, nt as getOrCreateCorrelationId, rt as runWithCorrelationId, tt as getCorrelationStorage } from "./init-rVPOUqng.js";
|
|
2
2
|
|
|
3
3
|
export { CORRELATION_ID_BAGGAGE_KEY, generateCorrelationId, getCorrelationId, getCorrelationStorage, getOrCreateCorrelationId, runWithCorrelationId, setCorrelationId, setCorrelationIdInBaggage };
|
package/dist/db.d.cts
CHANGED
|
@@ -33,33 +33,33 @@
|
|
|
33
33
|
* )
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
declare function tracebQuery<T>(dbSystem: string, operation: string, fn: () => Promise<T>, attributes?: Record<string, string | number>): Promise<T>;
|
|
36
|
+
export declare function tracebQuery<T>(dbSystem: string, operation: string, fn: () => Promise<T>, attributes?: Record<string, string | number>): Promise<T>;
|
|
37
37
|
/**
|
|
38
38
|
* Common database operation metrics
|
|
39
39
|
*/
|
|
40
|
-
declare const DB_OPERATIONS: {
|
|
41
|
-
readonly SELECT:
|
|
42
|
-
readonly INSERT:
|
|
43
|
-
readonly UPDATE:
|
|
44
|
-
readonly DELETE:
|
|
45
|
-
readonly COUNT:
|
|
46
|
-
readonly AGGREGATE:
|
|
40
|
+
export declare const DB_OPERATIONS: {
|
|
41
|
+
readonly SELECT: 'SELECT';
|
|
42
|
+
readonly INSERT: 'INSERT';
|
|
43
|
+
readonly UPDATE: 'UPDATE';
|
|
44
|
+
readonly DELETE: 'DELETE';
|
|
45
|
+
readonly COUNT: 'COUNT';
|
|
46
|
+
readonly AGGREGATE: 'AGGREGATE';
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
49
|
* Common database systems
|
|
50
50
|
*/
|
|
51
|
-
declare const DB_SYSTEMS: {
|
|
52
|
-
readonly POSTGRESQL:
|
|
53
|
-
readonly MYSQL:
|
|
54
|
-
readonly MONGODB:
|
|
55
|
-
readonly REDIS:
|
|
56
|
-
readonly SQLITE:
|
|
57
|
-
readonly MSSQL:
|
|
51
|
+
export declare const DB_SYSTEMS: {
|
|
52
|
+
readonly POSTGRESQL: 'postgresql';
|
|
53
|
+
readonly MYSQL: 'mysql';
|
|
54
|
+
readonly MONGODB: 'mongodb';
|
|
55
|
+
readonly REDIS: 'redis';
|
|
56
|
+
readonly SQLITE: 'sqlite';
|
|
57
|
+
readonly MSSQL: 'mssql';
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
60
|
* Options for instrumentDatabase
|
|
61
61
|
*/
|
|
62
|
-
interface InstrumentDatabaseOptions {
|
|
62
|
+
export interface InstrumentDatabaseOptions {
|
|
63
63
|
/** Database system (e.g., 'postgresql', 'mysql') */
|
|
64
64
|
dbSystem: string;
|
|
65
65
|
/** Database name (optional) */
|
|
@@ -119,6 +119,5 @@ interface InstrumentDatabaseOptions {
|
|
|
119
119
|
* })
|
|
120
120
|
* ```
|
|
121
121
|
*/
|
|
122
|
-
declare function instrumentDatabase<T extends object>(client: T, options: InstrumentDatabaseOptions): T;
|
|
123
|
-
//#endregion
|
|
124
|
-
export { DB_OPERATIONS, DB_SYSTEMS, InstrumentDatabaseOptions, instrumentDatabase, tracebQuery };
|
|
122
|
+
export declare function instrumentDatabase<T extends object>(client: T, options: InstrumentDatabaseOptions): T;
|
|
123
|
+
//#endregion
|
package/dist/db.d.ts
CHANGED
|
@@ -33,33 +33,33 @@
|
|
|
33
33
|
* )
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
declare function tracebQuery<T>(dbSystem: string, operation: string, fn: () => Promise<T>, attributes?: Record<string, string | number>): Promise<T>;
|
|
36
|
+
export declare function tracebQuery<T>(dbSystem: string, operation: string, fn: () => Promise<T>, attributes?: Record<string, string | number>): Promise<T>;
|
|
37
37
|
/**
|
|
38
38
|
* Common database operation metrics
|
|
39
39
|
*/
|
|
40
|
-
declare const DB_OPERATIONS: {
|
|
41
|
-
readonly SELECT:
|
|
42
|
-
readonly INSERT:
|
|
43
|
-
readonly UPDATE:
|
|
44
|
-
readonly DELETE:
|
|
45
|
-
readonly COUNT:
|
|
46
|
-
readonly AGGREGATE:
|
|
40
|
+
export declare const DB_OPERATIONS: {
|
|
41
|
+
readonly SELECT: 'SELECT';
|
|
42
|
+
readonly INSERT: 'INSERT';
|
|
43
|
+
readonly UPDATE: 'UPDATE';
|
|
44
|
+
readonly DELETE: 'DELETE';
|
|
45
|
+
readonly COUNT: 'COUNT';
|
|
46
|
+
readonly AGGREGATE: 'AGGREGATE';
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
49
|
* Common database systems
|
|
50
50
|
*/
|
|
51
|
-
declare const DB_SYSTEMS: {
|
|
52
|
-
readonly POSTGRESQL:
|
|
53
|
-
readonly MYSQL:
|
|
54
|
-
readonly MONGODB:
|
|
55
|
-
readonly REDIS:
|
|
56
|
-
readonly SQLITE:
|
|
57
|
-
readonly MSSQL:
|
|
51
|
+
export declare const DB_SYSTEMS: {
|
|
52
|
+
readonly POSTGRESQL: 'postgresql';
|
|
53
|
+
readonly MYSQL: 'mysql';
|
|
54
|
+
readonly MONGODB: 'mongodb';
|
|
55
|
+
readonly REDIS: 'redis';
|
|
56
|
+
readonly SQLITE: 'sqlite';
|
|
57
|
+
readonly MSSQL: 'mssql';
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
60
|
* Options for instrumentDatabase
|
|
61
61
|
*/
|
|
62
|
-
interface InstrumentDatabaseOptions {
|
|
62
|
+
export interface InstrumentDatabaseOptions {
|
|
63
63
|
/** Database system (e.g., 'postgresql', 'mysql') */
|
|
64
64
|
dbSystem: string;
|
|
65
65
|
/** Database name (optional) */
|
|
@@ -119,6 +119,5 @@ interface InstrumentDatabaseOptions {
|
|
|
119
119
|
* })
|
|
120
120
|
* ```
|
|
121
121
|
*/
|
|
122
|
-
declare function instrumentDatabase<T extends object>(client: T, options: InstrumentDatabaseOptions): T;
|
|
123
|
-
//#endregion
|
|
124
|
-
export { DB_OPERATIONS, DB_SYSTEMS, InstrumentDatabaseOptions, instrumentDatabase, tracebQuery };
|
|
122
|
+
export declare function instrumentDatabase<T extends object>(client: T, options: InstrumentDatabaseOptions): T;
|
|
123
|
+
//#endregion
|
package/dist/decorators.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_init = require('./init-
|
|
2
|
+
const require_init = require('./init-zb68UvOW.cjs');
|
|
3
3
|
const require_values = require('./values-AxGpgYBA.cjs');
|
|
4
4
|
const require_config = require('./config.cjs');
|
|
5
5
|
let _opentelemetry_api = require("@opentelemetry/api");
|
package/dist/decorators.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as TraceContext } from "./trace-context-f7Xq0Q2q.cjs";
|
|
2
|
-
import { h as TracingOptions } from "./functional-
|
|
2
|
+
import { h as TracingOptions } from "./functional-j8Joyrwd.cjs";
|
|
3
3
|
//#region src/decorators.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Options for @Trace method decorator
|
|
6
6
|
*/
|
|
7
|
-
interface TraceDecoratorOptions extends Omit<TracingOptions, 'name'> {
|
|
7
|
+
export interface TraceDecoratorOptions extends Omit<TracingOptions, 'name'> {
|
|
8
8
|
/**
|
|
9
9
|
* Custom span name. If not provided, uses the method name.
|
|
10
10
|
*/
|
|
@@ -14,11 +14,11 @@ interface TraceDecoratorOptions extends Omit<TracingOptions, 'name'> {
|
|
|
14
14
|
* The receiver of a decorated method. `@Trace` lends the method its span's
|
|
15
15
|
* context for the duration of the call, and puts back whatever was there.
|
|
16
16
|
*/
|
|
17
|
-
interface WithTraceContext {
|
|
17
|
+
export interface WithTraceContext {
|
|
18
18
|
ctx?: TraceContext;
|
|
19
19
|
}
|
|
20
20
|
/** The decorator a `@Trace(...)` call produces. */
|
|
21
|
-
type TraceDecorator = <TArgs extends unknown[], TResult>(originalMethod: (...args: TArgs) => Promise<TResult>, context: ClassMethodDecoratorContext) => (...args: TArgs) => Promise<TResult>;
|
|
21
|
+
export type TraceDecorator = <TArgs extends unknown[], TResult>(originalMethod: (...args: TArgs) => Promise<TResult>, context: ClassMethodDecoratorContext) => (...args: TArgs) => Promise<TResult>;
|
|
22
22
|
/**
|
|
23
23
|
* @Trace - Method decorator for fine-grained tracing
|
|
24
24
|
*
|
|
@@ -61,7 +61,7 @@ type TraceDecorator = <TArgs extends unknown[], TResult>(originalMethod: (...arg
|
|
|
61
61
|
* }
|
|
62
62
|
* ```
|
|
63
63
|
*/
|
|
64
|
-
declare function Trace(options?: TraceDecoratorOptions): TraceDecorator;
|
|
65
|
-
declare function Trace(name?: string, options?: TraceDecoratorOptions): TraceDecorator;
|
|
64
|
+
export declare function Trace(options?: TraceDecoratorOptions): TraceDecorator;
|
|
65
|
+
export declare function Trace(name?: string, options?: TraceDecoratorOptions): TraceDecorator;
|
|
66
66
|
//#endregion
|
|
67
|
-
export {
|
|
67
|
+
export type { TraceContext, TracingOptions };
|
package/dist/decorators.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { n as TraceContext } from "./trace-context-CqCblIQE.js";
|
|
2
|
-
import { h as TracingOptions } from "./functional-
|
|
2
|
+
import { h as TracingOptions } from "./functional-CbcInXMJ.js";
|
|
3
3
|
//#region src/decorators.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Options for @Trace method decorator
|
|
6
6
|
*/
|
|
7
|
-
interface TraceDecoratorOptions extends Omit<TracingOptions, 'name'> {
|
|
7
|
+
export interface TraceDecoratorOptions extends Omit<TracingOptions, 'name'> {
|
|
8
8
|
/**
|
|
9
9
|
* Custom span name. If not provided, uses the method name.
|
|
10
10
|
*/
|
|
@@ -14,11 +14,11 @@ interface TraceDecoratorOptions extends Omit<TracingOptions, 'name'> {
|
|
|
14
14
|
* The receiver of a decorated method. `@Trace` lends the method its span's
|
|
15
15
|
* context for the duration of the call, and puts back whatever was there.
|
|
16
16
|
*/
|
|
17
|
-
interface WithTraceContext {
|
|
17
|
+
export interface WithTraceContext {
|
|
18
18
|
ctx?: TraceContext;
|
|
19
19
|
}
|
|
20
20
|
/** The decorator a `@Trace(...)` call produces. */
|
|
21
|
-
type TraceDecorator = <TArgs extends unknown[], TResult>(originalMethod: (...args: TArgs) => Promise<TResult>, context: ClassMethodDecoratorContext) => (...args: TArgs) => Promise<TResult>;
|
|
21
|
+
export type TraceDecorator = <TArgs extends unknown[], TResult>(originalMethod: (...args: TArgs) => Promise<TResult>, context: ClassMethodDecoratorContext) => (...args: TArgs) => Promise<TResult>;
|
|
22
22
|
/**
|
|
23
23
|
* @Trace - Method decorator for fine-grained tracing
|
|
24
24
|
*
|
|
@@ -61,7 +61,7 @@ type TraceDecorator = <TArgs extends unknown[], TResult>(originalMethod: (...arg
|
|
|
61
61
|
* }
|
|
62
62
|
* ```
|
|
63
63
|
*/
|
|
64
|
-
declare function Trace(options?: TraceDecoratorOptions): TraceDecorator;
|
|
65
|
-
declare function Trace(name?: string, options?: TraceDecoratorOptions): TraceDecorator;
|
|
64
|
+
export declare function Trace(options?: TraceDecoratorOptions): TraceDecorator;
|
|
65
|
+
export declare function Trace(name?: string, options?: TraceDecoratorOptions): TraceDecorator;
|
|
66
66
|
//#endregion
|
|
67
|
-
export {
|
|
67
|
+
export type { TraceContext, TracingOptions };
|
package/dist/decorators.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { G as createTraceContext } from "./init-rVPOUqng.js";
|
|
2
2
|
import { y as splitNameOrOptions } from "./values-xBtdXtjA.js";
|
|
3
3
|
import { getConfig } from "./config.js";
|
|
4
4
|
import { SpanStatusCode } from "@opentelemetry/api";
|
package/dist/diagnostics.cjs
CHANGED
|
@@ -1,71 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_values = require('./values-AxGpgYBA.cjs');
|
|
3
3
|
const require_node_require = require('./node-require-BPsB09eC.cjs');
|
|
4
|
+
const require_channel = require('./channel-D0eaVqn3.cjs');
|
|
4
5
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
5
6
|
let _opentelemetry_api_logs = require("@opentelemetry/api-logs");
|
|
6
7
|
let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conventions");
|
|
7
8
|
|
|
8
|
-
//#region src/diagnostics/channel.ts
|
|
9
|
-
/**
|
|
10
|
-
* Edge-safe wrappers over Node's `diagnostics_channel`.
|
|
11
|
-
*
|
|
12
|
-
* The module is loaded lazily through {@link safeRequire} — never a static
|
|
13
|
-
* `node:` import — so merely importing this file is side-effect-free and bundles
|
|
14
|
-
* cleanly for browser/edge targets, where every subscribe call degrades to a
|
|
15
|
-
* no-op (returning an unsubscribe that does nothing). This is the shared
|
|
16
|
-
* primitive behind autotel's diagnostics-channel integrations (console capture,
|
|
17
|
-
* HTTP spans) and any app- or library-specific channel you want to bridge into
|
|
18
|
-
* a span/event.
|
|
19
|
-
*
|
|
20
|
-
* `diagnostics_channel.subscribe` (Node 18.7+) and `tracingChannel` (Node 19+)
|
|
21
|
-
* are used; autotel targets Node 22+, but on any runtime that lacks them the
|
|
22
|
-
* loader returns `undefined` and the helpers no-op.
|
|
23
|
-
*/
|
|
24
|
-
let cached;
|
|
25
|
-
function loadDiagnosticsChannel() {
|
|
26
|
-
if (cached !== void 0) return cached ?? void 0;
|
|
27
|
-
cached = require_node_require.safeRequire("node:diagnostics_channel") ?? null;
|
|
28
|
-
return cached ?? void 0;
|
|
29
|
-
}
|
|
30
|
-
/** Whether Node's `diagnostics_channel` is available in this runtime. */
|
|
31
|
-
function diagnosticsChannelAvailable() {
|
|
32
|
-
return loadDiagnosticsChannel() !== void 0;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Subscribe to a named diagnostics channel. Returns an idempotent unsubscribe
|
|
36
|
-
* function; a no-op (that still returns a disposer) on unsupported runtimes.
|
|
37
|
-
*/
|
|
38
|
-
function subscribeChannel(name, handler) {
|
|
39
|
-
const dc = loadDiagnosticsChannel();
|
|
40
|
-
if (!dc?.subscribe) return () => {};
|
|
41
|
-
const listener = handler;
|
|
42
|
-
dc.subscribe(name, listener);
|
|
43
|
-
let active = true;
|
|
44
|
-
return () => {
|
|
45
|
-
if (!active) return;
|
|
46
|
-
active = false;
|
|
47
|
-
dc.unsubscribe?.(name, listener);
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Subscribe to a `tracingChannel` (the `tracing:${name}:{start,end,…}` set).
|
|
52
|
-
* Returns an idempotent unsubscribe; a no-op on runtimes without
|
|
53
|
-
* `tracingChannel` support.
|
|
54
|
-
*/
|
|
55
|
-
function subscribeTracingChannel(name, handlers) {
|
|
56
|
-
const channel = loadDiagnosticsChannel()?.tracingChannel?.(name);
|
|
57
|
-
if (!channel) return () => {};
|
|
58
|
-
const subset = handlers;
|
|
59
|
-
channel.subscribe(subset);
|
|
60
|
-
let active = true;
|
|
61
|
-
return () => {
|
|
62
|
-
if (!active) return;
|
|
63
|
-
active = false;
|
|
64
|
-
channel.unsubscribe(subset);
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
//#endregion
|
|
69
9
|
//#region src/diagnostics/console.ts
|
|
70
10
|
/**
|
|
71
11
|
* Capture `console.*` calls as wide events — without monkey-patching `console`.
|
|
@@ -135,7 +75,7 @@ function captureConsole(options = {}) {
|
|
|
135
75
|
const toSpan = target === "span-event" || target === "both";
|
|
136
76
|
const logger = _opentelemetry_api_logs.logs.getLogger(options.loggerName ?? "autotel.console");
|
|
137
77
|
let recording = false;
|
|
138
|
-
const disposers = levels.map((level) => subscribeChannel(`console.${level}`, (message) => {
|
|
78
|
+
const disposers = levels.map((level) => require_channel.subscribeChannel(`console.${level}`, (message) => {
|
|
139
79
|
if (recording) return;
|
|
140
80
|
const body = formatArgs(messageArgs(message));
|
|
141
81
|
recording = true;
|
|
@@ -191,7 +131,7 @@ function splitHostPort(host) {
|
|
|
191
131
|
function instrumentHttp(options = {}) {
|
|
192
132
|
const tracer = options.tracer ?? _opentelemetry_api.trace.getTracer("autotel.http-diagnostics");
|
|
193
133
|
const disposers = [];
|
|
194
|
-
if (options.server !== false) disposers.push(subscribeChannel("http.server.request.start", (message) => {
|
|
134
|
+
if (options.server !== false) disposers.push(require_channel.subscribeChannel("http.server.request.start", (message) => {
|
|
195
135
|
const request = message?.request;
|
|
196
136
|
if (!request) return;
|
|
197
137
|
const method = request.method ?? "HTTP";
|
|
@@ -212,7 +152,7 @@ function instrumentHttp(options = {}) {
|
|
|
212
152
|
attributes
|
|
213
153
|
}, parent);
|
|
214
154
|
SERVER_SPANS.set(request, span);
|
|
215
|
-
}), subscribeChannel("http.server.response.finish", (message) => {
|
|
155
|
+
}), require_channel.subscribeChannel("http.server.response.finish", (message) => {
|
|
216
156
|
const { request, response } = message ?? {};
|
|
217
157
|
if (!request) return;
|
|
218
158
|
const span = SERVER_SPANS.get(request);
|
|
@@ -220,7 +160,7 @@ function instrumentHttp(options = {}) {
|
|
|
220
160
|
SERVER_SPANS.delete(request);
|
|
221
161
|
finishHttpSpan(span, response?.statusCode, 500);
|
|
222
162
|
}));
|
|
223
|
-
if (options.client !== false) disposers.push(subscribeChannel("http.client.request.start", (message) => {
|
|
163
|
+
if (options.client !== false) disposers.push(require_channel.subscribeChannel("http.client.request.start", (message) => {
|
|
224
164
|
const request = message?.request;
|
|
225
165
|
if (!request) return;
|
|
226
166
|
const method = request.method ?? "HTTP";
|
|
@@ -245,14 +185,14 @@ function instrumentHttp(options = {}) {
|
|
|
245
185
|
request.setHeader(key, value);
|
|
246
186
|
} catch {}
|
|
247
187
|
}
|
|
248
|
-
}), subscribeChannel("http.client.response.finish", (message) => {
|
|
188
|
+
}), require_channel.subscribeChannel("http.client.response.finish", (message) => {
|
|
249
189
|
const { request, response } = message ?? {};
|
|
250
190
|
if (!request) return;
|
|
251
191
|
const span = CLIENT_SPANS.get(request);
|
|
252
192
|
if (!span) return;
|
|
253
193
|
CLIENT_SPANS.delete(request);
|
|
254
194
|
finishHttpSpan(span, response?.statusCode, 400);
|
|
255
|
-
}), subscribeChannel("http.client.request.error", (message) => {
|
|
195
|
+
}), require_channel.subscribeChannel("http.client.request.error", (message) => {
|
|
256
196
|
const { request, error } = message ?? {};
|
|
257
197
|
if (!request) return;
|
|
258
198
|
const span = CLIENT_SPANS.get(request);
|
|
@@ -283,7 +223,7 @@ function finishHttpSpan(span, statusCode, errorAt) {
|
|
|
283
223
|
|
|
284
224
|
//#endregion
|
|
285
225
|
exports.captureConsole = captureConsole;
|
|
286
|
-
exports.diagnosticsChannelAvailable = diagnosticsChannelAvailable;
|
|
226
|
+
exports.diagnosticsChannelAvailable = require_channel.diagnosticsChannelAvailable;
|
|
287
227
|
exports.instrumentHttp = instrumentHttp;
|
|
288
|
-
exports.subscribeChannel = subscribeChannel;
|
|
289
|
-
exports.subscribeTracingChannel = subscribeTracingChannel;
|
|
228
|
+
exports.subscribeChannel = require_channel.subscribeChannel;
|
|
229
|
+
exports.subscribeTracingChannel = require_channel.subscribeTracingChannel;
|
package/dist/diagnostics.d.cts
CHANGED
|
@@ -16,7 +16,7 @@ import { Attributes, Tracer } from "@opentelemetry/api";
|
|
|
16
16
|
* loader returns `undefined` and the helpers no-op.
|
|
17
17
|
*/
|
|
18
18
|
/** Whether Node's `diagnostics_channel` is available in this runtime. */
|
|
19
|
-
declare function diagnosticsChannelAvailable(): boolean;
|
|
19
|
+
export declare function diagnosticsChannelAvailable(): boolean;
|
|
20
20
|
/**
|
|
21
21
|
* Handler for a plain named channel. `TMessage` is whatever the publisher on
|
|
22
22
|
* that channel sends - a subscriber that knows the channel says so; one that
|
|
@@ -27,7 +27,7 @@ type ChannelMessageHandler<TMessage = unknown> = (message: TMessage, name: strin
|
|
|
27
27
|
* Subscribe to a named diagnostics channel. Returns an idempotent unsubscribe
|
|
28
28
|
* function; a no-op (that still returns a disposer) on unsupported runtimes.
|
|
29
29
|
*/
|
|
30
|
-
declare function subscribeChannel<TMessage = unknown>(name: string, handler: ChannelMessageHandler<TMessage>): () => void;
|
|
30
|
+
export declare function subscribeChannel<TMessage = unknown>(name: string, handler: ChannelMessageHandler<TMessage>): () => void;
|
|
31
31
|
/** Subscriber set for a {@link https://nodejs.org/api/diagnostics_channel.html#class-tracingchannel TracingChannel}. */
|
|
32
32
|
interface TracingChannelHandlers<TMessage = unknown> {
|
|
33
33
|
start?(message: TMessage): void;
|
|
@@ -41,7 +41,7 @@ interface TracingChannelHandlers<TMessage = unknown> {
|
|
|
41
41
|
* Returns an idempotent unsubscribe; a no-op on runtimes without
|
|
42
42
|
* `tracingChannel` support.
|
|
43
43
|
*/
|
|
44
|
-
declare function subscribeTracingChannel<TMessage = unknown>(name: string, handlers: TracingChannelHandlers<TMessage>): () => void;
|
|
44
|
+
export declare function subscribeTracingChannel<TMessage = unknown>(name: string, handlers: TracingChannelHandlers<TMessage>): () => void;
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/diagnostics/console.d.ts
|
|
47
47
|
/** Console methods that publish a diagnostics channel. */
|
|
@@ -65,7 +65,7 @@ interface CaptureConsoleOptions {
|
|
|
65
65
|
* Start capturing `console.*` calls as wide events. Returns a disposer that
|
|
66
66
|
* stops capture. Safe to call on runtimes without the console channels (no-op).
|
|
67
67
|
*/
|
|
68
|
-
declare function captureConsole(options?: CaptureConsoleOptions): () => void;
|
|
68
|
+
export declare function captureConsole(options?: CaptureConsoleOptions): () => void;
|
|
69
69
|
//#endregion
|
|
70
70
|
//#region src/diagnostics/http.d.ts
|
|
71
71
|
interface InstrumentHttpOptions {
|
|
@@ -80,6 +80,6 @@ interface InstrumentHttpOptions {
|
|
|
80
80
|
* Start emitting HTTP server/client spans from Node's HTTP diagnostics
|
|
81
81
|
* channels. Returns a disposer; a no-op on runtimes without the channels.
|
|
82
82
|
*/
|
|
83
|
-
declare function instrumentHttp(options?: InstrumentHttpOptions): () => void;
|
|
83
|
+
export declare function instrumentHttp(options?: InstrumentHttpOptions): () => void;
|
|
84
84
|
//#endregion
|
|
85
|
-
export {
|
|
85
|
+
export type { CaptureConsoleOptions, ChannelMessageHandler, ConsoleLevel, InstrumentHttpOptions, TracingChannelHandlers };
|
package/dist/diagnostics.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { Attributes, Tracer } from "@opentelemetry/api";
|
|
|
16
16
|
* loader returns `undefined` and the helpers no-op.
|
|
17
17
|
*/
|
|
18
18
|
/** Whether Node's `diagnostics_channel` is available in this runtime. */
|
|
19
|
-
declare function diagnosticsChannelAvailable(): boolean;
|
|
19
|
+
export declare function diagnosticsChannelAvailable(): boolean;
|
|
20
20
|
/**
|
|
21
21
|
* Handler for a plain named channel. `TMessage` is whatever the publisher on
|
|
22
22
|
* that channel sends - a subscriber that knows the channel says so; one that
|
|
@@ -27,7 +27,7 @@ type ChannelMessageHandler<TMessage = unknown> = (message: TMessage, name: strin
|
|
|
27
27
|
* Subscribe to a named diagnostics channel. Returns an idempotent unsubscribe
|
|
28
28
|
* function; a no-op (that still returns a disposer) on unsupported runtimes.
|
|
29
29
|
*/
|
|
30
|
-
declare function subscribeChannel<TMessage = unknown>(name: string, handler: ChannelMessageHandler<TMessage>): () => void;
|
|
30
|
+
export declare function subscribeChannel<TMessage = unknown>(name: string, handler: ChannelMessageHandler<TMessage>): () => void;
|
|
31
31
|
/** Subscriber set for a {@link https://nodejs.org/api/diagnostics_channel.html#class-tracingchannel TracingChannel}. */
|
|
32
32
|
interface TracingChannelHandlers<TMessage = unknown> {
|
|
33
33
|
start?(message: TMessage): void;
|
|
@@ -41,7 +41,7 @@ interface TracingChannelHandlers<TMessage = unknown> {
|
|
|
41
41
|
* Returns an idempotent unsubscribe; a no-op on runtimes without
|
|
42
42
|
* `tracingChannel` support.
|
|
43
43
|
*/
|
|
44
|
-
declare function subscribeTracingChannel<TMessage = unknown>(name: string, handlers: TracingChannelHandlers<TMessage>): () => void;
|
|
44
|
+
export declare function subscribeTracingChannel<TMessage = unknown>(name: string, handlers: TracingChannelHandlers<TMessage>): () => void;
|
|
45
45
|
//#endregion
|
|
46
46
|
//#region src/diagnostics/console.d.ts
|
|
47
47
|
/** Console methods that publish a diagnostics channel. */
|
|
@@ -65,7 +65,7 @@ interface CaptureConsoleOptions {
|
|
|
65
65
|
* Start capturing `console.*` calls as wide events. Returns a disposer that
|
|
66
66
|
* stops capture. Safe to call on runtimes without the console channels (no-op).
|
|
67
67
|
*/
|
|
68
|
-
declare function captureConsole(options?: CaptureConsoleOptions): () => void;
|
|
68
|
+
export declare function captureConsole(options?: CaptureConsoleOptions): () => void;
|
|
69
69
|
//#endregion
|
|
70
70
|
//#region src/diagnostics/http.d.ts
|
|
71
71
|
interface InstrumentHttpOptions {
|
|
@@ -80,6 +80,6 @@ interface InstrumentHttpOptions {
|
|
|
80
80
|
* Start emitting HTTP server/client spans from Node's HTTP diagnostics
|
|
81
81
|
* channels. Returns a disposer; a no-op on runtimes without the channels.
|
|
82
82
|
*/
|
|
83
|
-
declare function instrumentHttp(options?: InstrumentHttpOptions): () => void;
|
|
83
|
+
export declare function instrumentHttp(options?: InstrumentHttpOptions): () => void;
|
|
84
84
|
//#endregion
|
|
85
|
-
export {
|
|
85
|
+
export type { CaptureConsoleOptions, ChannelMessageHandler, ConsoleLevel, InstrumentHttpOptions, TracingChannelHandlers };
|
package/dist/diagnostics.js
CHANGED
|
@@ -1,70 +1,10 @@
|
|
|
1
1
|
import { l as asString } from "./values-xBtdXtjA.js";
|
|
2
2
|
import { n as safeRequire } from "./node-require-CkK_xzL-.js";
|
|
3
|
+
import { n as subscribeChannel, r as subscribeTracingChannel, t as diagnosticsChannelAvailable } from "./channel-BobQKsZd.js";
|
|
3
4
|
import { SpanKind, SpanStatusCode, context, defaultTextMapGetter, defaultTextMapSetter, propagation, trace } from "@opentelemetry/api";
|
|
4
5
|
import { SeverityNumber, logs } from "@opentelemetry/api-logs";
|
|
5
6
|
import { ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_NETWORK_PROTOCOL_VERSION, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_URL_FULL, ATTR_URL_PATH, ATTR_URL_SCHEME, ATTR_USER_AGENT_ORIGINAL } from "@opentelemetry/semantic-conventions";
|
|
6
7
|
|
|
7
|
-
//#region src/diagnostics/channel.ts
|
|
8
|
-
/**
|
|
9
|
-
* Edge-safe wrappers over Node's `diagnostics_channel`.
|
|
10
|
-
*
|
|
11
|
-
* The module is loaded lazily through {@link safeRequire} — never a static
|
|
12
|
-
* `node:` import — so merely importing this file is side-effect-free and bundles
|
|
13
|
-
* cleanly for browser/edge targets, where every subscribe call degrades to a
|
|
14
|
-
* no-op (returning an unsubscribe that does nothing). This is the shared
|
|
15
|
-
* primitive behind autotel's diagnostics-channel integrations (console capture,
|
|
16
|
-
* HTTP spans) and any app- or library-specific channel you want to bridge into
|
|
17
|
-
* a span/event.
|
|
18
|
-
*
|
|
19
|
-
* `diagnostics_channel.subscribe` (Node 18.7+) and `tracingChannel` (Node 19+)
|
|
20
|
-
* are used; autotel targets Node 22+, but on any runtime that lacks them the
|
|
21
|
-
* loader returns `undefined` and the helpers no-op.
|
|
22
|
-
*/
|
|
23
|
-
let cached;
|
|
24
|
-
function loadDiagnosticsChannel() {
|
|
25
|
-
if (cached !== void 0) return cached ?? void 0;
|
|
26
|
-
cached = safeRequire("node:diagnostics_channel") ?? null;
|
|
27
|
-
return cached ?? void 0;
|
|
28
|
-
}
|
|
29
|
-
/** Whether Node's `diagnostics_channel` is available in this runtime. */
|
|
30
|
-
function diagnosticsChannelAvailable() {
|
|
31
|
-
return loadDiagnosticsChannel() !== void 0;
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Subscribe to a named diagnostics channel. Returns an idempotent unsubscribe
|
|
35
|
-
* function; a no-op (that still returns a disposer) on unsupported runtimes.
|
|
36
|
-
*/
|
|
37
|
-
function subscribeChannel(name, handler) {
|
|
38
|
-
const dc = loadDiagnosticsChannel();
|
|
39
|
-
if (!dc?.subscribe) return () => {};
|
|
40
|
-
const listener = handler;
|
|
41
|
-
dc.subscribe(name, listener);
|
|
42
|
-
let active = true;
|
|
43
|
-
return () => {
|
|
44
|
-
if (!active) return;
|
|
45
|
-
active = false;
|
|
46
|
-
dc.unsubscribe?.(name, listener);
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Subscribe to a `tracingChannel` (the `tracing:${name}:{start,end,…}` set).
|
|
51
|
-
* Returns an idempotent unsubscribe; a no-op on runtimes without
|
|
52
|
-
* `tracingChannel` support.
|
|
53
|
-
*/
|
|
54
|
-
function subscribeTracingChannel(name, handlers) {
|
|
55
|
-
const channel = loadDiagnosticsChannel()?.tracingChannel?.(name);
|
|
56
|
-
if (!channel) return () => {};
|
|
57
|
-
const subset = handlers;
|
|
58
|
-
channel.subscribe(subset);
|
|
59
|
-
let active = true;
|
|
60
|
-
return () => {
|
|
61
|
-
if (!active) return;
|
|
62
|
-
active = false;
|
|
63
|
-
channel.unsubscribe(subset);
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
//#endregion
|
|
68
8
|
//#region src/diagnostics/console.ts
|
|
69
9
|
/**
|
|
70
10
|
* Capture `console.*` calls as wide events — without monkey-patching `console`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/drain-pipeline.d.ts
|
|
2
|
-
interface DrainPipelineOptions<T = unknown> {
|
|
2
|
+
export interface DrainPipelineOptions<T = unknown> {
|
|
3
3
|
batch?: {
|
|
4
4
|
/** Maximum events per batch. @default 50 */
|
|
5
5
|
size?: number;
|
|
@@ -30,7 +30,7 @@ interface DrainPipelineOptions<T = unknown> {
|
|
|
30
30
|
/** Called when events are dropped from overflow or exhausted retries. */
|
|
31
31
|
onDropped?: (events: T[], error?: Error) => void;
|
|
32
32
|
}
|
|
33
|
-
interface PipelineDrainFn<T> {
|
|
33
|
+
export interface PipelineDrainFn<T> {
|
|
34
34
|
(ctx: T): void;
|
|
35
35
|
/** Flush all buffered events. */
|
|
36
36
|
flush: () => Promise<void>;
|
|
@@ -38,6 +38,5 @@ interface PipelineDrainFn<T> {
|
|
|
38
38
|
shutdown: () => Promise<void>;
|
|
39
39
|
readonly pending: number;
|
|
40
40
|
}
|
|
41
|
-
declare function createDrainPipeline<T = unknown>(options?: DrainPipelineOptions<T>): (drain: (batch: T[]) => void | Promise<void>) => PipelineDrainFn<T>;
|
|
42
|
-
//#endregion
|
|
43
|
-
export { DrainPipelineOptions, PipelineDrainFn, createDrainPipeline };
|
|
41
|
+
export declare function createDrainPipeline<T = unknown>(options?: DrainPipelineOptions<T>): (drain: (batch: T[]) => void | Promise<void>) => PipelineDrainFn<T>;
|
|
42
|
+
//#endregion
|
package/dist/drain-pipeline.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/drain-pipeline.d.ts
|
|
2
|
-
interface DrainPipelineOptions<T = unknown> {
|
|
2
|
+
export interface DrainPipelineOptions<T = unknown> {
|
|
3
3
|
batch?: {
|
|
4
4
|
/** Maximum events per batch. @default 50 */
|
|
5
5
|
size?: number;
|
|
@@ -30,7 +30,7 @@ interface DrainPipelineOptions<T = unknown> {
|
|
|
30
30
|
/** Called when events are dropped from overflow or exhausted retries. */
|
|
31
31
|
onDropped?: (events: T[], error?: Error) => void;
|
|
32
32
|
}
|
|
33
|
-
interface PipelineDrainFn<T> {
|
|
33
|
+
export interface PipelineDrainFn<T> {
|
|
34
34
|
(ctx: T): void;
|
|
35
35
|
/** Flush all buffered events. */
|
|
36
36
|
flush: () => Promise<void>;
|
|
@@ -38,6 +38,5 @@ interface PipelineDrainFn<T> {
|
|
|
38
38
|
shutdown: () => Promise<void>;
|
|
39
39
|
readonly pending: number;
|
|
40
40
|
}
|
|
41
|
-
declare function createDrainPipeline<T = unknown>(options?: DrainPipelineOptions<T>): (drain: (batch: T[]) => void | Promise<void>) => PipelineDrainFn<T>;
|
|
42
|
-
//#endregion
|
|
43
|
-
export { DrainPipelineOptions, PipelineDrainFn, createDrainPipeline };
|
|
41
|
+
export declare function createDrainPipeline<T = unknown>(options?: DrainPipelineOptions<T>): (drain: (batch: T[]) => void | Promise<void>) => PipelineDrainFn<T>;
|
|
42
|
+
//#endregion
|