@iii-dev/helpers 0.19.4-alpha.2 → 0.19.4-alpha.3
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/index-CEjPaG4S.d.cts +177 -0
- package/dist/index-KWqP5kbF.d.mts +177 -0
- package/dist/observability/index.cjs +490 -0
- package/dist/observability/index.cjs.map +1 -0
- package/dist/observability/index.d.cts +244 -0
- package/dist/observability/index.d.mts +244 -0
- package/dist/observability/index.mjs +455 -0
- package/dist/observability/index.mjs.map +1 -0
- package/dist/observability/internal.cjs +5 -0
- package/dist/observability/internal.d.cts +2 -0
- package/dist/observability/internal.d.mts +2 -0
- package/dist/observability/internal.mjs +3 -0
- package/dist/telemetry-system-CLZLK3nL.mjs +1126 -0
- package/dist/telemetry-system-CLZLK3nL.mjs.map +1 -0
- package/dist/telemetry-system-CY8_emop.cjs +1305 -0
- package/dist/telemetry-system-CY8_emop.cjs.map +1 -0
- package/package.json +36 -1
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { AttributeValue, Attributes, Context, Meter as Meter$1, Span as Span$1, SpanKind, Tracer as Tracer$1 } from "@opentelemetry/api";
|
|
2
|
+
import { Logger, SeverityNumber } from "@opentelemetry/api-logs";
|
|
3
|
+
import { Instrumentation } from "@opentelemetry/instrumentation";
|
|
4
|
+
import { ReadableSpan, Span, SpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
5
|
+
|
|
6
|
+
//#region src/observability/telemetry-system/types.d.ts
|
|
7
|
+
/** Configuration for WebSocket reconnection behavior */
|
|
8
|
+
interface ReconnectionConfig {
|
|
9
|
+
/** Starting delay in milliseconds (default: 1000ms) */
|
|
10
|
+
initialDelayMs: number;
|
|
11
|
+
/** Maximum delay cap in milliseconds (default: 30000ms) */
|
|
12
|
+
maxDelayMs: number;
|
|
13
|
+
/** Exponential backoff multiplier (default: 2) */
|
|
14
|
+
backoffMultiplier: number;
|
|
15
|
+
/** Random jitter factor 0-1 (default: 0.3) */
|
|
16
|
+
jitterFactor: number;
|
|
17
|
+
/** Maximum retry attempts, -1 for infinite (default: -1) */
|
|
18
|
+
maxRetries: number;
|
|
19
|
+
}
|
|
20
|
+
/** Configuration for OpenTelemetry initialization. */
|
|
21
|
+
interface OtelConfig {
|
|
22
|
+
/** Whether OpenTelemetry export is enabled. Defaults to true. Set to false or OTEL_ENABLED=false/0/no/off to disable. */
|
|
23
|
+
enabled?: boolean;
|
|
24
|
+
/** The service name to report. Defaults to OTEL_SERVICE_NAME or "iii-node". */
|
|
25
|
+
serviceName?: string;
|
|
26
|
+
/** The service version to report. Defaults to SERVICE_VERSION env var or "unknown". */
|
|
27
|
+
serviceVersion?: string;
|
|
28
|
+
/** The service namespace to report. Defaults to SERVICE_NAMESPACE env var. */
|
|
29
|
+
serviceNamespace?: string;
|
|
30
|
+
/** The service instance ID to report. Defaults to SERVICE_INSTANCE_ID env var or auto-generated UUID. */
|
|
31
|
+
serviceInstanceId?: string;
|
|
32
|
+
/** III Engine WebSocket URL. Defaults to III_URL or "ws://localhost:49134". */
|
|
33
|
+
engineWsUrl?: string;
|
|
34
|
+
/** OpenTelemetry instrumentations to register (e.g., PrismaInstrumentation). */
|
|
35
|
+
instrumentations?: Instrumentation[];
|
|
36
|
+
/** Whether OpenTelemetry metrics export is enabled. Defaults to true. Set to false or OTEL_METRICS_ENABLED=false/0/no/off to disable. */
|
|
37
|
+
metricsEnabled?: boolean;
|
|
38
|
+
/** Metrics export interval in milliseconds. Defaults to 60000 (60 seconds). */
|
|
39
|
+
metricsExportIntervalMs?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Span processor flush delay in milliseconds. Defaults to 100ms. This is how
|
|
42
|
+
* long an ended span waits in the batch buffer before it is flushed to the
|
|
43
|
+
* engine — the OpenTelemetry default of 5000ms is what makes traces appear
|
|
44
|
+
* seconds after the action. Env override: OTEL_SPANS_FLUSH_INTERVAL_MS.
|
|
45
|
+
*/
|
|
46
|
+
spansFlushIntervalMs?: number;
|
|
47
|
+
/** Log processor flush delay in milliseconds. Defaults to 100ms. Env override: OTEL_LOGS_FLUSH_INTERVAL_MS. */
|
|
48
|
+
logsFlushIntervalMs?: number;
|
|
49
|
+
/** Maximum number of log records exported per batch. Defaults to 1. */
|
|
50
|
+
logsBatchSize?: number;
|
|
51
|
+
/** Whether to auto-instrument globalThis.fetch calls. Defaults to true. Works on Node.js, Bun, and Deno. Set to false to disable. */
|
|
52
|
+
fetchInstrumentationEnabled?: boolean;
|
|
53
|
+
/** Optional reconnection configuration for the WebSocket connection. */
|
|
54
|
+
reconnectionConfig?: Partial<ReconnectionConfig>;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/observability/telemetry-system/context.d.ts
|
|
58
|
+
/**
|
|
59
|
+
* Extract the current trace ID from the active span context.
|
|
60
|
+
*/
|
|
61
|
+
declare function currentTraceId(): string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Extract the current span ID from the active span context.
|
|
64
|
+
*/
|
|
65
|
+
declare function currentSpanId(): string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Inject the current trace context into a W3C traceparent header string.
|
|
68
|
+
*/
|
|
69
|
+
declare function injectTraceparent(): string | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Extract a trace context from a W3C traceparent header string.
|
|
72
|
+
*/
|
|
73
|
+
declare function extractTraceparent(traceparent: string): Context;
|
|
74
|
+
/**
|
|
75
|
+
* Inject the current baggage into a W3C baggage header string.
|
|
76
|
+
*/
|
|
77
|
+
declare function injectBaggage(): string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Extract baggage from a W3C baggage header string.
|
|
80
|
+
*/
|
|
81
|
+
declare function extractBaggage(baggage: string): Context;
|
|
82
|
+
/**
|
|
83
|
+
* Extract both trace context and baggage from their respective headers.
|
|
84
|
+
*/
|
|
85
|
+
declare function extractContext(traceparent?: string, baggage?: string): Context;
|
|
86
|
+
/**
|
|
87
|
+
* Get a baggage entry from the current context.
|
|
88
|
+
*/
|
|
89
|
+
declare function getBaggageEntry(key: string): string | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Set a baggage entry in the current context.
|
|
92
|
+
*/
|
|
93
|
+
declare function setBaggageEntry(key: string, value: string): Context;
|
|
94
|
+
/**
|
|
95
|
+
* Remove a baggage entry from the current context.
|
|
96
|
+
*/
|
|
97
|
+
declare function removeBaggageEntry(key: string): Context;
|
|
98
|
+
/**
|
|
99
|
+
* Get all baggage entries from the current context.
|
|
100
|
+
*/
|
|
101
|
+
declare function getAllBaggage(): Record<string, string>;
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/observability/telemetry-system/baggage-span-processor.d.ts
|
|
104
|
+
/** DEFAULT_ALLOWLIST drift across languages would break worker chains;
|
|
105
|
+
* lockstep tests in each SDK pin this constant at CI time. */
|
|
106
|
+
declare const DEFAULT_ALLOWLIST: readonly string[];
|
|
107
|
+
declare class BaggageSpanProcessor implements SpanProcessor {
|
|
108
|
+
private readonly allowlist;
|
|
109
|
+
constructor(allowlist?: readonly string[]);
|
|
110
|
+
onStart(span: Span, parentContext: Context): void;
|
|
111
|
+
onEnd(_span: ReadableSpan): void;
|
|
112
|
+
shutdown(): Promise<void>;
|
|
113
|
+
forceFlush(): Promise<void>;
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/observability/telemetry-system/span-ops.d.ts
|
|
117
|
+
/** Returns `false` when there is no active span or the sampler dropped it. */
|
|
118
|
+
declare function currentSpanIsRecording(): boolean;
|
|
119
|
+
/** No-op when the current span is not recording. */
|
|
120
|
+
declare function setCurrentSpanAttribute(key: string, value: AttributeValue): void;
|
|
121
|
+
/** No-op when there is no active span. */
|
|
122
|
+
declare function setCurrentSpanError(message: string): void;
|
|
123
|
+
/** No-op when the current span is not recording. */
|
|
124
|
+
declare function recordSpanEvent(name: string, attrs?: Attributes): void;
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/observability/telemetry-system/payload.d.ts
|
|
127
|
+
/** Payload redaction + truncation for invocation event capture. */
|
|
128
|
+
declare const REDACTED_PLACEHOLDER = "[REDACTED]";
|
|
129
|
+
declare function resolveMaxBytesFromEnv(): number | null;
|
|
130
|
+
/** Recursively redact values of sensitive keys. Returns a new value. */
|
|
131
|
+
declare function redact(value: unknown): unknown;
|
|
132
|
+
/** Redact then serialize to JSON, optionally capped at `maxBytes`. */
|
|
133
|
+
declare function redactAndTruncate(value: unknown, maxBytes?: number | null): {
|
|
134
|
+
json: string;
|
|
135
|
+
truncated: boolean;
|
|
136
|
+
};
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/observability/telemetry-system/index.d.ts
|
|
139
|
+
/**
|
|
140
|
+
* Initialize OpenTelemetry with the given configuration.
|
|
141
|
+
* This should be called once at application startup.
|
|
142
|
+
*/
|
|
143
|
+
declare function initOtel(config?: OtelConfig): void;
|
|
144
|
+
/**
|
|
145
|
+
* Shutdown OpenTelemetry, flushing any pending data.
|
|
146
|
+
*/
|
|
147
|
+
declare function shutdownOtel(): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* Force-flush all OTel providers without tearing them down.
|
|
150
|
+
*
|
|
151
|
+
* Counterpart to {@link shutdownOtel}. Use before short-lived process exits
|
|
152
|
+
* where you want pending spans/metrics/logs delivered but plan to keep using
|
|
153
|
+
* OTel afterwards.
|
|
154
|
+
*/
|
|
155
|
+
declare function flushOtel(): Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Get the OpenTelemetry tracer instance.
|
|
158
|
+
*/
|
|
159
|
+
declare function getTracer(): Tracer$1 | null;
|
|
160
|
+
/**
|
|
161
|
+
* Get the OpenTelemetry meter instance.
|
|
162
|
+
*/
|
|
163
|
+
declare function getMeter(): Meter$1 | null;
|
|
164
|
+
/**
|
|
165
|
+
* Get the OpenTelemetry logger instance.
|
|
166
|
+
*/
|
|
167
|
+
declare function getLogger(): Logger | null;
|
|
168
|
+
/**
|
|
169
|
+
* Start a new span with the given name and run the callback within it.
|
|
170
|
+
*/
|
|
171
|
+
declare function withSpan<T>(name: string, options: {
|
|
172
|
+
kind?: SpanKind;
|
|
173
|
+
traceparent?: string;
|
|
174
|
+
}, fn: (span: Span$1) => Promise<T>): Promise<T>;
|
|
175
|
+
//#endregion
|
|
176
|
+
export { injectTraceparent as A, currentTraceId as C, getAllBaggage as D, extractTraceparent as E, setBaggageEntry as M, OtelConfig as N, getBaggageEntry as O, ReconnectionConfig as P, currentSpanId as S, extractContext as T, recordSpanEvent as _, flushOtel as a, BaggageSpanProcessor as b, getTracer as c, withSpan as d, REDACTED_PLACEHOLDER as f, currentSpanIsRecording as g, resolveMaxBytesFromEnv as h, Span$1 as i, removeBaggageEntry as j, injectBaggage as k, initOtel as l, redactAndTruncate as m, Meter$1 as n, getLogger as o, redact as p, SeverityNumber as r, getMeter as s, Logger as t, shutdownOtel as u, setCurrentSpanAttribute as v, extractBaggage as w, DEFAULT_ALLOWLIST as x, setCurrentSpanError as y };
|
|
177
|
+
//# sourceMappingURL=index-CEjPaG4S.d.cts.map
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { Logger, SeverityNumber as SeverityNumber$1 } from "@opentelemetry/api-logs";
|
|
2
|
+
import { AttributeValue, Attributes, Context, Meter as Meter$1, Span as Span$1, SpanKind as SpanKind$1, Tracer as Tracer$1 } from "@opentelemetry/api";
|
|
3
|
+
import { ReadableSpan, Span, SpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
4
|
+
import { Instrumentation } from "@opentelemetry/instrumentation";
|
|
5
|
+
|
|
6
|
+
//#region src/observability/telemetry-system/types.d.ts
|
|
7
|
+
/** Configuration for WebSocket reconnection behavior */
|
|
8
|
+
interface ReconnectionConfig {
|
|
9
|
+
/** Starting delay in milliseconds (default: 1000ms) */
|
|
10
|
+
initialDelayMs: number;
|
|
11
|
+
/** Maximum delay cap in milliseconds (default: 30000ms) */
|
|
12
|
+
maxDelayMs: number;
|
|
13
|
+
/** Exponential backoff multiplier (default: 2) */
|
|
14
|
+
backoffMultiplier: number;
|
|
15
|
+
/** Random jitter factor 0-1 (default: 0.3) */
|
|
16
|
+
jitterFactor: number;
|
|
17
|
+
/** Maximum retry attempts, -1 for infinite (default: -1) */
|
|
18
|
+
maxRetries: number;
|
|
19
|
+
}
|
|
20
|
+
/** Configuration for OpenTelemetry initialization. */
|
|
21
|
+
interface OtelConfig {
|
|
22
|
+
/** Whether OpenTelemetry export is enabled. Defaults to true. Set to false or OTEL_ENABLED=false/0/no/off to disable. */
|
|
23
|
+
enabled?: boolean;
|
|
24
|
+
/** The service name to report. Defaults to OTEL_SERVICE_NAME or "iii-node". */
|
|
25
|
+
serviceName?: string;
|
|
26
|
+
/** The service version to report. Defaults to SERVICE_VERSION env var or "unknown". */
|
|
27
|
+
serviceVersion?: string;
|
|
28
|
+
/** The service namespace to report. Defaults to SERVICE_NAMESPACE env var. */
|
|
29
|
+
serviceNamespace?: string;
|
|
30
|
+
/** The service instance ID to report. Defaults to SERVICE_INSTANCE_ID env var or auto-generated UUID. */
|
|
31
|
+
serviceInstanceId?: string;
|
|
32
|
+
/** III Engine WebSocket URL. Defaults to III_URL or "ws://localhost:49134". */
|
|
33
|
+
engineWsUrl?: string;
|
|
34
|
+
/** OpenTelemetry instrumentations to register (e.g., PrismaInstrumentation). */
|
|
35
|
+
instrumentations?: Instrumentation[];
|
|
36
|
+
/** Whether OpenTelemetry metrics export is enabled. Defaults to true. Set to false or OTEL_METRICS_ENABLED=false/0/no/off to disable. */
|
|
37
|
+
metricsEnabled?: boolean;
|
|
38
|
+
/** Metrics export interval in milliseconds. Defaults to 60000 (60 seconds). */
|
|
39
|
+
metricsExportIntervalMs?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Span processor flush delay in milliseconds. Defaults to 100ms. This is how
|
|
42
|
+
* long an ended span waits in the batch buffer before it is flushed to the
|
|
43
|
+
* engine — the OpenTelemetry default of 5000ms is what makes traces appear
|
|
44
|
+
* seconds after the action. Env override: OTEL_SPANS_FLUSH_INTERVAL_MS.
|
|
45
|
+
*/
|
|
46
|
+
spansFlushIntervalMs?: number;
|
|
47
|
+
/** Log processor flush delay in milliseconds. Defaults to 100ms. Env override: OTEL_LOGS_FLUSH_INTERVAL_MS. */
|
|
48
|
+
logsFlushIntervalMs?: number;
|
|
49
|
+
/** Maximum number of log records exported per batch. Defaults to 1. */
|
|
50
|
+
logsBatchSize?: number;
|
|
51
|
+
/** Whether to auto-instrument globalThis.fetch calls. Defaults to true. Works on Node.js, Bun, and Deno. Set to false to disable. */
|
|
52
|
+
fetchInstrumentationEnabled?: boolean;
|
|
53
|
+
/** Optional reconnection configuration for the WebSocket connection. */
|
|
54
|
+
reconnectionConfig?: Partial<ReconnectionConfig>;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
//#region src/observability/telemetry-system/context.d.ts
|
|
58
|
+
/**
|
|
59
|
+
* Extract the current trace ID from the active span context.
|
|
60
|
+
*/
|
|
61
|
+
declare function currentTraceId(): string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Extract the current span ID from the active span context.
|
|
64
|
+
*/
|
|
65
|
+
declare function currentSpanId(): string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Inject the current trace context into a W3C traceparent header string.
|
|
68
|
+
*/
|
|
69
|
+
declare function injectTraceparent(): string | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Extract a trace context from a W3C traceparent header string.
|
|
72
|
+
*/
|
|
73
|
+
declare function extractTraceparent(traceparent: string): Context;
|
|
74
|
+
/**
|
|
75
|
+
* Inject the current baggage into a W3C baggage header string.
|
|
76
|
+
*/
|
|
77
|
+
declare function injectBaggage(): string | undefined;
|
|
78
|
+
/**
|
|
79
|
+
* Extract baggage from a W3C baggage header string.
|
|
80
|
+
*/
|
|
81
|
+
declare function extractBaggage(baggage: string): Context;
|
|
82
|
+
/**
|
|
83
|
+
* Extract both trace context and baggage from their respective headers.
|
|
84
|
+
*/
|
|
85
|
+
declare function extractContext(traceparent?: string, baggage?: string): Context;
|
|
86
|
+
/**
|
|
87
|
+
* Get a baggage entry from the current context.
|
|
88
|
+
*/
|
|
89
|
+
declare function getBaggageEntry(key: string): string | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Set a baggage entry in the current context.
|
|
92
|
+
*/
|
|
93
|
+
declare function setBaggageEntry(key: string, value: string): Context;
|
|
94
|
+
/**
|
|
95
|
+
* Remove a baggage entry from the current context.
|
|
96
|
+
*/
|
|
97
|
+
declare function removeBaggageEntry(key: string): Context;
|
|
98
|
+
/**
|
|
99
|
+
* Get all baggage entries from the current context.
|
|
100
|
+
*/
|
|
101
|
+
declare function getAllBaggage(): Record<string, string>;
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/observability/telemetry-system/baggage-span-processor.d.ts
|
|
104
|
+
/** DEFAULT_ALLOWLIST drift across languages would break worker chains;
|
|
105
|
+
* lockstep tests in each SDK pin this constant at CI time. */
|
|
106
|
+
declare const DEFAULT_ALLOWLIST: readonly string[];
|
|
107
|
+
declare class BaggageSpanProcessor implements SpanProcessor {
|
|
108
|
+
private readonly allowlist;
|
|
109
|
+
constructor(allowlist?: readonly string[]);
|
|
110
|
+
onStart(span: Span, parentContext: Context): void;
|
|
111
|
+
onEnd(_span: ReadableSpan): void;
|
|
112
|
+
shutdown(): Promise<void>;
|
|
113
|
+
forceFlush(): Promise<void>;
|
|
114
|
+
}
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region src/observability/telemetry-system/span-ops.d.ts
|
|
117
|
+
/** Returns `false` when there is no active span or the sampler dropped it. */
|
|
118
|
+
declare function currentSpanIsRecording(): boolean;
|
|
119
|
+
/** No-op when the current span is not recording. */
|
|
120
|
+
declare function setCurrentSpanAttribute(key: string, value: AttributeValue): void;
|
|
121
|
+
/** No-op when there is no active span. */
|
|
122
|
+
declare function setCurrentSpanError(message: string): void;
|
|
123
|
+
/** No-op when the current span is not recording. */
|
|
124
|
+
declare function recordSpanEvent(name: string, attrs?: Attributes): void;
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/observability/telemetry-system/payload.d.ts
|
|
127
|
+
/** Payload redaction + truncation for invocation event capture. */
|
|
128
|
+
declare const REDACTED_PLACEHOLDER = "[REDACTED]";
|
|
129
|
+
declare function resolveMaxBytesFromEnv(): number | null;
|
|
130
|
+
/** Recursively redact values of sensitive keys. Returns a new value. */
|
|
131
|
+
declare function redact(value: unknown): unknown;
|
|
132
|
+
/** Redact then serialize to JSON, optionally capped at `maxBytes`. */
|
|
133
|
+
declare function redactAndTruncate(value: unknown, maxBytes?: number | null): {
|
|
134
|
+
json: string;
|
|
135
|
+
truncated: boolean;
|
|
136
|
+
};
|
|
137
|
+
//#endregion
|
|
138
|
+
//#region src/observability/telemetry-system/index.d.ts
|
|
139
|
+
/**
|
|
140
|
+
* Initialize OpenTelemetry with the given configuration.
|
|
141
|
+
* This should be called once at application startup.
|
|
142
|
+
*/
|
|
143
|
+
declare function initOtel(config?: OtelConfig): void;
|
|
144
|
+
/**
|
|
145
|
+
* Shutdown OpenTelemetry, flushing any pending data.
|
|
146
|
+
*/
|
|
147
|
+
declare function shutdownOtel(): Promise<void>;
|
|
148
|
+
/**
|
|
149
|
+
* Force-flush all OTel providers without tearing them down.
|
|
150
|
+
*
|
|
151
|
+
* Counterpart to {@link shutdownOtel}. Use before short-lived process exits
|
|
152
|
+
* where you want pending spans/metrics/logs delivered but plan to keep using
|
|
153
|
+
* OTel afterwards.
|
|
154
|
+
*/
|
|
155
|
+
declare function flushOtel(): Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Get the OpenTelemetry tracer instance.
|
|
158
|
+
*/
|
|
159
|
+
declare function getTracer(): Tracer$1 | null;
|
|
160
|
+
/**
|
|
161
|
+
* Get the OpenTelemetry meter instance.
|
|
162
|
+
*/
|
|
163
|
+
declare function getMeter(): Meter$1 | null;
|
|
164
|
+
/**
|
|
165
|
+
* Get the OpenTelemetry logger instance.
|
|
166
|
+
*/
|
|
167
|
+
declare function getLogger(): Logger | null;
|
|
168
|
+
/**
|
|
169
|
+
* Start a new span with the given name and run the callback within it.
|
|
170
|
+
*/
|
|
171
|
+
declare function withSpan<T>(name: string, options: {
|
|
172
|
+
kind?: SpanKind$1;
|
|
173
|
+
traceparent?: string;
|
|
174
|
+
}, fn: (span: Span$1) => Promise<T>): Promise<T>;
|
|
175
|
+
//#endregion
|
|
176
|
+
export { injectTraceparent as A, currentTraceId as C, getAllBaggage as D, extractTraceparent as E, setBaggageEntry as M, OtelConfig as N, getBaggageEntry as O, ReconnectionConfig as P, currentSpanId as S, extractContext as T, recordSpanEvent as _, flushOtel as a, BaggageSpanProcessor as b, getTracer as c, withSpan as d, REDACTED_PLACEHOLDER as f, currentSpanIsRecording as g, resolveMaxBytesFromEnv as h, Span$1 as i, removeBaggageEntry as j, injectBaggage as k, initOtel as l, redactAndTruncate as m, Meter$1 as n, getLogger as o, redact as p, SeverityNumber$1 as r, getMeter as s, Logger as t, shutdownOtel as u, setCurrentSpanAttribute as v, extractBaggage as w, DEFAULT_ALLOWLIST as x, setCurrentSpanError as y };
|
|
177
|
+
//# sourceMappingURL=index-KWqP5kbF.d.mts.map
|