@zudojs/observability 1.2.2 → 1.3.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 +5 -2
- package/dist/errors/index.d.ts +0 -1
- package/dist/errors/index.js +0 -1
- package/dist/errors/observabilityError.core.d.ts +0 -1
- package/dist/errors/observabilityError.core.js +0 -1
- package/dist/exporter/exporter.console.d.ts +0 -1
- package/dist/exporter/exporter.console.js +4 -1
- package/dist/exporter/index.d.ts +0 -1
- package/dist/exporter/index.js +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/internal/ids.core.d.ts +0 -1
- package/dist/internal/ids.core.js +0 -1
- package/dist/internal/index.d.ts +0 -1
- package/dist/internal/index.js +0 -1
- package/dist/logLevel/index.d.ts +0 -1
- package/dist/logLevel/index.js +0 -1
- package/dist/logLevel/logLevel.bridge.d.ts +0 -1
- package/dist/logLevel/logLevel.bridge.js +0 -1
- package/dist/logLevel/logLevel.type.d.ts +0 -1
- package/dist/logLevel/logLevel.type.js +0 -1
- package/dist/logRecord/index.d.ts +0 -1
- package/dist/logRecord/index.js +0 -1
- package/dist/logRecord/logRecord.core.d.ts +2 -1
- package/dist/logRecord/logRecord.core.js +2 -1
- package/dist/logger/index.d.ts +0 -1
- package/dist/logger/index.js +0 -1
- package/dist/logger/logger.core.d.ts +2 -2
- package/dist/logger/logger.core.js +4 -2
- package/dist/metrics/counter/counter.core.d.ts +0 -1
- package/dist/metrics/counter/counter.core.js +0 -1
- package/dist/metrics/counter/index.d.ts +0 -1
- package/dist/metrics/counter/index.js +0 -1
- package/dist/metrics/gauge/gauge.core.d.ts +0 -1
- package/dist/metrics/gauge/gauge.core.js +0 -1
- package/dist/metrics/gauge/index.d.ts +0 -1
- package/dist/metrics/gauge/index.js +0 -1
- package/dist/metrics/histogram/histogram.core.d.ts +0 -1
- package/dist/metrics/histogram/histogram.core.js +0 -1
- package/dist/metrics/histogram/index.d.ts +0 -1
- package/dist/metrics/histogram/index.js +0 -1
- package/dist/metrics/index.d.ts +0 -1
- package/dist/metrics/index.js +0 -1
- package/dist/metrics/metrics.reader.d.ts +0 -1
- package/dist/metrics/metrics.reader.js +0 -1
- package/dist/metrics/metrics.registry.d.ts +0 -1
- package/dist/metrics/metrics.registry.js +0 -1
- package/dist/noop/index.d.ts +0 -1
- package/dist/noop/index.js +0 -1
- package/dist/noop/noopObservability.core.d.ts +0 -1
- package/dist/noop/noopObservability.core.js +0 -1
- package/dist/observability/index.d.ts +0 -1
- package/dist/observability/index.js +0 -1
- package/dist/observability/observability.core.d.ts +0 -1
- package/dist/observability/observability.core.js +0 -1
- package/dist/processor/index.d.ts +0 -1
- package/dist/processor/index.js +0 -1
- package/dist/processor/processor.batch.d.ts +0 -1
- package/dist/processor/processor.batch.js +0 -1
- package/dist/processor/processor.log.d.ts +0 -1
- package/dist/processor/processor.log.js +0 -1
- package/dist/propagation/index.d.ts +0 -1
- package/dist/propagation/index.js +0 -1
- package/dist/propagation/propagation.core.d.ts +0 -1
- package/dist/propagation/propagation.core.js +0 -1
- package/dist/propagation/propagation.traceparent.d.ts +0 -1
- package/dist/propagation/propagation.traceparent.js +0 -1
- package/dist/redaction/index.d.ts +0 -1
- package/dist/redaction/index.js +0 -1
- package/dist/redaction/redaction.core.d.ts +0 -1
- package/dist/redaction/redaction.core.js +0 -1
- package/dist/redaction/redaction.defaults.d.ts +0 -1
- package/dist/redaction/redaction.defaults.js +0 -1
- package/dist/sampling/index.d.ts +0 -1
- package/dist/sampling/index.js +0 -1
- package/dist/sampling/sampler.type.d.ts +0 -1
- package/dist/sampling/sampler.type.js +0 -1
- package/dist/tracing/index.d.ts +0 -1
- package/dist/tracing/index.js +0 -1
- package/dist/tracing/span/index.d.ts +0 -1
- package/dist/tracing/span/index.js +0 -1
- package/dist/tracing/span/span.core.d.ts +0 -1
- package/dist/tracing/span/span.core.js +0 -1
- package/dist/tracing/span/spanContext.type.d.ts +0 -1
- package/dist/tracing/span/spanContext.type.js +0 -1
- package/dist/tracing/tracer/index.d.ts +0 -1
- package/dist/tracing/tracer/index.js +0 -1
- package/dist/tracing/tracer/tracer.active.d.ts +0 -1
- package/dist/tracing/tracer/tracer.active.js +0 -1
- package/dist/tracing/tracer/tracer.core.d.ts +0 -1
- package/dist/tracing/tracer/tracer.core.js +0 -1
- package/dist/tracing/tracer/tracer.parent.d.ts +0 -1
- package/dist/tracing/tracer/tracer.parent.js +0 -1
- package/dist/types/config.types.d.ts +0 -1
- package/dist/types/config.types.js +0 -1
- package/dist/types/logging.types.d.ts +6 -2
- package/dist/types/logging.types.js +0 -1
- package/dist/types/metrics.types.d.ts +0 -1
- package/dist/types/metrics.types.js +0 -1
- package/dist/types/tracing.types.d.ts +0 -1
- package/dist/types/tracing.types.js +0 -1
- package/dist/types.d.ts +0 -1
- package/dist/types.js +0 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -71,7 +71,10 @@ await obs.logger.flush();
|
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
Every record carries `traceId` and `spanId` when a propagation context is
|
|
74
|
-
active
|
|
74
|
+
active — and the context's `requestId` and `correlationId` when it has them
|
|
75
|
+
(`createPropagationContext({ requestId, correlationId })`) — so logs, traces
|
|
76
|
+
and requests line up without threading IDs by hand. `correlate: false`
|
|
77
|
+
turns all four off.
|
|
75
78
|
|
|
76
79
|
`LogLevel` here counts upward in severity (`TRACE = 0 … FATAL = 5`), the
|
|
77
80
|
opposite of `@zudojs/logger`'s `LoggerLevel` (`FATAL = 0 … TRACE = 5`).
|
|
@@ -255,7 +258,7 @@ child, which is what keeps a sampled trace whole across services.
|
|
|
255
258
|
import { createPropagationContext } from "@zudojs/observability";
|
|
256
259
|
|
|
257
260
|
await obs.propagation.run(createPropagationContext({ requestId }), async () => {
|
|
258
|
-
obs.logger.info("handling"); // carries traceId, spanId
|
|
261
|
+
obs.logger.info("handling"); // carries traceId, spanId, requestId
|
|
259
262
|
await handle();
|
|
260
263
|
});
|
|
261
264
|
|
package/dist/errors/index.d.ts
CHANGED
package/dist/errors/index.js
CHANGED
|
@@ -28,4 +28,3 @@ export declare class MetricValueError extends ObservabilityError {
|
|
|
28
28
|
}
|
|
29
29
|
/** Determines whether an unknown value is an observability error. */
|
|
30
30
|
export declare function isObservabilityError(value: unknown): value is ObservabilityError;
|
|
31
|
-
//# sourceMappingURL=observabilityError.core.d.ts.map
|
|
@@ -79,4 +79,3 @@ export declare function createConsoleSpanExporter(options?: ConsoleExporterOptio
|
|
|
79
79
|
export declare function createConsoleLogExporter(options?: ConsoleExporterOptions): ConsoleLogExporter;
|
|
80
80
|
/** Creates a console metric exporter. */
|
|
81
81
|
export declare function createConsoleMetricExporter(options?: ConsoleExporterOptions): ConsoleMetricExporter;
|
|
82
|
-
//# sourceMappingURL=exporter.console.d.ts.map
|
|
@@ -115,6 +115,10 @@ export class ConsoleLogExporter {
|
|
|
115
115
|
message: record.message,
|
|
116
116
|
...(record.traceId ? { traceId: record.traceId } : {}),
|
|
117
117
|
...(record.spanId ? { spanId: record.spanId } : {}),
|
|
118
|
+
...(record.requestId ? { requestId: record.requestId } : {}),
|
|
119
|
+
...(record.correlationId
|
|
120
|
+
? { correlationId: record.correlationId }
|
|
121
|
+
: {}),
|
|
118
122
|
...(record.context ? { context: record.context } : {}),
|
|
119
123
|
...(record.error ? { error: record.error } : {}),
|
|
120
124
|
}, this.pretty);
|
|
@@ -178,4 +182,3 @@ export function createConsoleLogExporter(options) {
|
|
|
178
182
|
export function createConsoleMetricExporter(options) {
|
|
179
183
|
return new ConsoleMetricExporter(options);
|
|
180
184
|
}
|
|
181
|
-
//# sourceMappingURL=exporter.console.js.map
|
package/dist/exporter/index.d.ts
CHANGED
|
@@ -4,4 +4,3 @@
|
|
|
4
4
|
* Console exporters for spans, logs, and metrics, plus no-op exporters.
|
|
5
5
|
*/
|
|
6
6
|
export { ConsoleSpanExporter, ConsoleLogExporter, ConsoleMetricExporter, createConsoleSpanExporter, createConsoleLogExporter, createConsoleMetricExporter, noopLogExporter, noopMetricExporter, safeStringify, type ConsoleExporterOptions, type ConsoleLike, } from "./exporter.console.js";
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/exporter/index.js
CHANGED
|
@@ -4,4 +4,3 @@
|
|
|
4
4
|
* Console exporters for spans, logs, and metrics, plus no-op exporters.
|
|
5
5
|
*/
|
|
6
6
|
export { ConsoleSpanExporter, ConsoleLogExporter, ConsoleMetricExporter, createConsoleSpanExporter, createConsoleLogExporter, createConsoleMetricExporter, noopLogExporter, noopMetricExporter, safeStringify, } from "./exporter.console.js";
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -45,4 +45,3 @@ export { BatchSpanProcessor, createBatchSpanProcessor, SimpleSpanProcessor, crea
|
|
|
45
45
|
export { createRedactor, createStructureRedactor, redactObject, redactValue, isSensitiveField, DEFAULT_SENSITIVE_FIELDS, CIRCULAR_MARKER, MAX_DEPTH_MARKER, } from "./redaction/index.js";
|
|
46
46
|
export { NoopObservability, createNoopObservability, noopLogger, noopCounter, noopGauge, noopHistogram, noopMetricsRegistry, noopSpan, noopTracer, noopPropagationManager, INVALID_PROPAGATION_CONTEXT, } from "./noop/index.js";
|
|
47
47
|
export { DefaultObservability, createObservability, } from "./observability/index.js";
|
|
48
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -60,4 +60,3 @@ export { createRedactor, createStructureRedactor, redactObject, redactValue, isS
|
|
|
60
60
|
export { NoopObservability, createNoopObservability, noopLogger, noopCounter, noopGauge, noopHistogram, noopMetricsRegistry, noopSpan, noopTracer, noopPropagationManager, INVALID_PROPAGATION_CONTEXT, } from "./noop/index.js";
|
|
61
61
|
/* ─── Observability Facade ──────────────────────────────────────────────── */
|
|
62
62
|
export { DefaultObservability, createObservability, } from "./observability/index.js";
|
|
63
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -23,4 +23,3 @@ export declare function isValidId(id: string, byteLength: number): boolean;
|
|
|
23
23
|
export declare function isValidTraceId(traceId: string): boolean;
|
|
24
24
|
/** True when `spanId` is a valid W3C span ID. */
|
|
25
25
|
export declare function isValidSpanId(spanId: string): boolean;
|
|
26
|
-
//# sourceMappingURL=ids.core.d.ts.map
|
package/dist/internal/index.d.ts
CHANGED
package/dist/internal/index.js
CHANGED
package/dist/logLevel/index.d.ts
CHANGED
package/dist/logLevel/index.js
CHANGED
|
@@ -22,4 +22,3 @@ export declare function toLoggerLevel(level: LogLevel): number | undefined;
|
|
|
22
22
|
* Returns `undefined` for a value outside `LoggerLevel` (`0`–`5`).
|
|
23
23
|
*/
|
|
24
24
|
export declare function fromLoggerLevel(level: number): LogLevel | undefined;
|
|
25
|
-
//# sourceMappingURL=logLevel.bridge.d.ts.map
|
|
@@ -19,4 +19,3 @@ export declare function parseLogLevel(value: string): LogLevel | undefined;
|
|
|
19
19
|
export declare function shouldLog(threshold: LogLevel, messageLevel: LogLevel): boolean;
|
|
20
20
|
/** Returns all log level names. */
|
|
21
21
|
export declare function getLogLevelNames(): readonly LogLevelName[];
|
|
22
|
-
//# sourceMappingURL=logLevel.type.d.ts.map
|
package/dist/logRecord/index.js
CHANGED
|
@@ -23,8 +23,9 @@ export declare function createLogRecord(options: {
|
|
|
23
23
|
readonly error?: unknown;
|
|
24
24
|
readonly traceId?: string;
|
|
25
25
|
readonly spanId?: string;
|
|
26
|
+
readonly requestId?: string;
|
|
27
|
+
readonly correlationId?: string;
|
|
26
28
|
readonly timestamp?: Date;
|
|
27
29
|
}): LogRecord;
|
|
28
30
|
/** Creates a log record for an error. */
|
|
29
31
|
export declare function createErrorLogRecord(error: unknown, level: LogLevel, loggerName: string, context?: Record<string, unknown>): LogRecord;
|
|
30
|
-
//# sourceMappingURL=logRecord.core.d.ts.map
|
|
@@ -55,6 +55,8 @@ export function createLogRecord(options) {
|
|
|
55
55
|
error: options.error === undefined ? undefined : serializeError(options.error),
|
|
56
56
|
traceId: options.traceId,
|
|
57
57
|
spanId: options.spanId,
|
|
58
|
+
requestId: options.requestId,
|
|
59
|
+
correlationId: options.correlationId,
|
|
58
60
|
};
|
|
59
61
|
}
|
|
60
62
|
/** Creates a log record for an error. */
|
|
@@ -68,4 +70,3 @@ export function createErrorLogRecord(error, level, loggerName, context) {
|
|
|
68
70
|
error,
|
|
69
71
|
});
|
|
70
72
|
}
|
|
71
|
-
//# sourceMappingURL=logRecord.core.js.map
|
package/dist/logger/index.d.ts
CHANGED
package/dist/logger/index.js
CHANGED
|
@@ -10,7 +10,8 @@ import { LogLevel } from "../types.js";
|
|
|
10
10
|
* Core structured logger with level filtering, child loggers,
|
|
11
11
|
* persistent context, and transport support.
|
|
12
12
|
*
|
|
13
|
-
* Every record is stamped with the ambient `traceId`/`spanId`
|
|
13
|
+
* Every record is stamped with the ambient `traceId`/`spanId` — and the
|
|
14
|
+
* context's `requestId`/`correlationId` when it carries them — when a
|
|
14
15
|
* propagation context is active, so logs and traces line up without the
|
|
15
16
|
* caller threading IDs through by hand.
|
|
16
17
|
*/
|
|
@@ -37,4 +38,3 @@ export declare class StructuredLogger implements Logger {
|
|
|
37
38
|
}
|
|
38
39
|
/** Creates a structured logger. */
|
|
39
40
|
export declare function createStructuredLogger(options: LoggerOptions): StructuredLogger;
|
|
40
|
-
//# sourceMappingURL=logger.core.d.ts.map
|
|
@@ -17,7 +17,8 @@ const noopTransport = {
|
|
|
17
17
|
* Core structured logger with level filtering, child loggers,
|
|
18
18
|
* persistent context, and transport support.
|
|
19
19
|
*
|
|
20
|
-
* Every record is stamped with the ambient `traceId`/`spanId`
|
|
20
|
+
* Every record is stamped with the ambient `traceId`/`spanId` — and the
|
|
21
|
+
* context's `requestId`/`correlationId` when it carries them — when a
|
|
21
22
|
* propagation context is active, so logs and traces line up without the
|
|
22
23
|
* caller threading IDs through by hand.
|
|
23
24
|
*/
|
|
@@ -92,6 +93,8 @@ export class StructuredLogger {
|
|
|
92
93
|
error,
|
|
93
94
|
traceId: propagation?.traceId,
|
|
94
95
|
spanId: propagation?.spanId,
|
|
96
|
+
requestId: propagation?.requestId,
|
|
97
|
+
correlationId: propagation?.correlationId,
|
|
95
98
|
});
|
|
96
99
|
// A transport must never take the caller down with it. A failing sink is
|
|
97
100
|
// reported through the transport's own channel, not raised here.
|
|
@@ -109,4 +112,3 @@ export class StructuredLogger {
|
|
|
109
112
|
export function createStructuredLogger(options) {
|
|
110
113
|
return new StructuredLogger(options);
|
|
111
114
|
}
|
|
112
|
-
//# sourceMappingURL=logger.core.js.map
|
|
@@ -38,4 +38,3 @@ export declare class DefaultHistogram implements Histogram {
|
|
|
38
38
|
}
|
|
39
39
|
/** Creates a histogram. */
|
|
40
40
|
export declare function createHistogram(name: string, labels?: Record<string, string>, boundaries?: readonly number[]): DefaultHistogram;
|
|
41
|
-
//# sourceMappingURL=histogram.core.d.ts.map
|
package/dist/metrics/index.d.ts
CHANGED
|
@@ -8,4 +8,3 @@ export { DefaultGauge, createGauge } from "./gauge/index.js";
|
|
|
8
8
|
export { DefaultHistogram, createHistogram, DEFAULT_BUCKET_BOUNDARIES, } from "./histogram/index.js";
|
|
9
9
|
export { DefaultMetricsRegistry, createMetricsRegistry, metricKey, type MetricsRegistryOptions, } from "./metrics.registry.js";
|
|
10
10
|
export { PeriodicMetricReader, createPeriodicMetricReader, type PeriodicMetricReaderOptions, } from "./metrics.reader.js";
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/metrics/index.js
CHANGED
|
@@ -8,4 +8,3 @@ export { DefaultGauge, createGauge } from "./gauge/index.js";
|
|
|
8
8
|
export { DefaultHistogram, createHistogram, DEFAULT_BUCKET_BOUNDARIES, } from "./histogram/index.js";
|
|
9
9
|
export { DefaultMetricsRegistry, createMetricsRegistry, metricKey, } from "./metrics.registry.js";
|
|
10
10
|
export { PeriodicMetricReader, createPeriodicMetricReader, } from "./metrics.reader.js";
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -77,4 +77,3 @@ export declare class DefaultMetricsRegistry implements MetricsRegistry {
|
|
|
77
77
|
}
|
|
78
78
|
/** Creates a metrics registry. */
|
|
79
79
|
export declare function createMetricsRegistry(options?: MetricsRegistryOptions): DefaultMetricsRegistry;
|
|
80
|
-
//# sourceMappingURL=metrics.registry.d.ts.map
|
package/dist/noop/index.d.ts
CHANGED
|
@@ -4,4 +4,3 @@
|
|
|
4
4
|
* No-op implementations that discard all telemetry.
|
|
5
5
|
*/
|
|
6
6
|
export { NoopObservability, createNoopObservability, noopLogger, noopCounter, noopGauge, noopHistogram, noopMetricsRegistry, noopSpan, noopTracer, noopPropagationManager, INVALID_PROPAGATION_CONTEXT, } from "./noopObservability.core.js";
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/noop/index.js
CHANGED
|
@@ -4,4 +4,3 @@
|
|
|
4
4
|
* No-op implementations that discard all telemetry.
|
|
5
5
|
*/
|
|
6
6
|
export { NoopObservability, createNoopObservability, noopLogger, noopCounter, noopGauge, noopHistogram, noopMetricsRegistry, noopSpan, noopTracer, noopPropagationManager, INVALID_PROPAGATION_CONTEXT, } from "./noopObservability.core.js";
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -40,4 +40,3 @@ export declare function createNoopObservability(): NoopObservability;
|
|
|
40
40
|
/** A propagation context with the reserved invalid IDs. */
|
|
41
41
|
export declare const INVALID_PROPAGATION_CONTEXT: PropagationContext;
|
|
42
42
|
export { noopLogger, noopCounter, noopGauge, noopHistogram, noopMetricsRegistry, noopSpan, noopTracer, noopPropagationManager, };
|
|
43
|
-
//# sourceMappingURL=noopObservability.core.d.ts.map
|
|
@@ -137,4 +137,3 @@ export const INVALID_PROPAGATION_CONTEXT = Object.freeze({
|
|
|
137
137
|
traceFlags: TraceFlags.NONE,
|
|
138
138
|
});
|
|
139
139
|
export { noopLogger, noopCounter, noopGauge, noopHistogram, noopMetricsRegistry, noopSpan, noopTracer, noopPropagationManager, };
|
|
140
|
-
//# sourceMappingURL=noopObservability.core.js.map
|
|
@@ -84,4 +84,3 @@ export declare class DefaultObservability implements Observability {
|
|
|
84
84
|
/** Creates an observability instance. */
|
|
85
85
|
export declare function createObservability(config: ObservabilityConfig): DefaultObservability;
|
|
86
86
|
export {};
|
|
87
|
-
//# sourceMappingURL=observability.core.d.ts.map
|
|
@@ -5,4 +5,3 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { BatchSpanProcessor, createBatchSpanProcessor, SimpleSpanProcessor, createSimpleSpanProcessor, noopSpanExporter, type BatchSpanProcessorOptions, } from "./processor.batch.js";
|
|
7
7
|
export { BatchLogProcessor, createBatchLogProcessor, type BatchLogProcessorOptions, } from "./processor.log.js";
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/processor/index.js
CHANGED
|
@@ -5,4 +5,3 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { BatchSpanProcessor, createBatchSpanProcessor, SimpleSpanProcessor, createSimpleSpanProcessor, noopSpanExporter, } from "./processor.batch.js";
|
|
7
7
|
export { BatchLogProcessor, createBatchLogProcessor, } from "./processor.log.js";
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -5,4 +5,3 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { createPropagationContext, derivePropagationContext, getCurrentContext, requireCurrentContext, AsyncPropagationManager, createPropagationManager, } from "./propagation.core.js";
|
|
7
7
|
export { parseTraceparent, formatTraceparent, TRACEPARENT_HEADER, } from "./propagation.traceparent.js";
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,4 +5,3 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { createPropagationContext, derivePropagationContext, getCurrentContext, requireCurrentContext, AsyncPropagationManager, createPropagationManager, } from "./propagation.core.js";
|
|
7
7
|
export { parseTraceparent, formatTraceparent, TRACEPARENT_HEADER, } from "./propagation.traceparent.js";
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -25,4 +25,3 @@ export declare function parseTraceparent(header: string | readonly string[] | un
|
|
|
25
25
|
* malformed context is never propagated downstream.
|
|
26
26
|
*/
|
|
27
27
|
export declare function formatTraceparent(context: Pick<SpanContext, "traceId" | "spanId" | "traceFlags">): string | undefined;
|
|
28
|
-
//# sourceMappingURL=propagation.traceparent.d.ts.map
|
package/dist/redaction/index.js
CHANGED
package/dist/sampling/index.d.ts
CHANGED
|
@@ -4,4 +4,3 @@
|
|
|
4
4
|
* Sampling strategies: AlwaysOn, AlwaysOff, Probability, ParentBased.
|
|
5
5
|
*/
|
|
6
6
|
export { AlwaysOnSampler, AlwaysOffSampler, ProbabilitySampler, ParentBasedSampler, createAlwaysOnSampler, createAlwaysOffSampler, createProbabilitySampler, createParentBasedSampler, isSampled, isRecording, type ParentBasedSamplerOptions, } from "./sampler.type.js";
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/sampling/index.js
CHANGED
|
@@ -4,4 +4,3 @@
|
|
|
4
4
|
* Sampling strategies: AlwaysOn, AlwaysOff, Probability, ParentBased.
|
|
5
5
|
*/
|
|
6
6
|
export { AlwaysOnSampler, AlwaysOffSampler, ProbabilitySampler, ParentBasedSampler, createAlwaysOnSampler, createAlwaysOffSampler, createProbabilitySampler, createParentBasedSampler, isSampled, isRecording, } from "./sampler.type.js";
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -64,4 +64,3 @@ export declare function createAlwaysOffSampler(): AlwaysOffSampler;
|
|
|
64
64
|
export declare function createProbabilitySampler(probability: number): ProbabilitySampler;
|
|
65
65
|
/** Creates a parent-based sampler. */
|
|
66
66
|
export declare function createParentBasedSampler(rootOrOptions?: Sampler | ParentBasedSamplerOptions): ParentBasedSampler;
|
|
67
|
-
//# sourceMappingURL=sampler.type.d.ts.map
|
package/dist/tracing/index.d.ts
CHANGED
|
@@ -5,4 +5,3 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { DefaultSpan, createSpan, createSpanContext, createChildSpanContext, isSampledContext, isValidSpanContext, } from "./span/index.js";
|
|
7
7
|
export { DefaultTracer, createTracer, withSpan, type TracerOptions, } from "./tracer/index.js";
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/tracing/index.js
CHANGED
|
@@ -38,4 +38,3 @@ export declare function createChildSpanContext(parent: SpanContext, overrides?:
|
|
|
38
38
|
}): SpanContext;
|
|
39
39
|
/** True when the context carries the W3C sampled flag. */
|
|
40
40
|
export declare function isSampledContext(context: SpanContext): boolean;
|
|
41
|
-
//# sourceMappingURL=spanContext.type.d.ts.map
|
|
@@ -16,4 +16,3 @@ import type { Span, SpanOptions, Tracer } from "../../types.js";
|
|
|
16
16
|
* rejection is recorded on the span and re-thrown.
|
|
17
17
|
*/
|
|
18
18
|
export declare function withSpan<T>(tracer: Tracer, name: string, fn: (span: Span) => T, options?: SpanOptions): T;
|
|
19
|
-
//# sourceMappingURL=tracer.active.d.ts.map
|
|
@@ -38,6 +38,10 @@ export interface LogRecord {
|
|
|
38
38
|
readonly traceId?: string;
|
|
39
39
|
/** Span this record was emitted under, when a propagation context is active. */
|
|
40
40
|
readonly spanId?: string;
|
|
41
|
+
/** `requestId` of the active propagation context, when it carries one. */
|
|
42
|
+
readonly requestId?: string;
|
|
43
|
+
/** `correlationId` of the active propagation context, when it carries one. */
|
|
44
|
+
readonly correlationId?: string;
|
|
41
45
|
}
|
|
42
46
|
/** Structured logger interface. */
|
|
43
47
|
export interface Logger {
|
|
@@ -69,7 +73,8 @@ export interface LoggerOptions {
|
|
|
69
73
|
readonly context?: Record<string, unknown>;
|
|
70
74
|
readonly transport?: LogTransport;
|
|
71
75
|
/**
|
|
72
|
-
* Stamps `traceId
|
|
76
|
+
* Stamps `traceId`, `spanId` and, when the context carries them,
|
|
77
|
+
* `requestId` and `correlationId` onto every record from the ambient
|
|
73
78
|
* propagation context. Defaults to `true`.
|
|
74
79
|
*/
|
|
75
80
|
readonly correlate?: boolean;
|
|
@@ -91,4 +96,3 @@ export interface LogExporter {
|
|
|
91
96
|
export(records: readonly LogRecord[]): Promise<void>;
|
|
92
97
|
shutdown(): Promise<void>;
|
|
93
98
|
}
|
|
94
|
-
//# sourceMappingURL=logging.types.d.ts.map
|
package/dist/types.d.ts
CHANGED
package/dist/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zudojs/observability",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Structured logging, metrics, tracing, context propagation, and exporters for Zudojs applications.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"!dist/.tsbuildinfo"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@zudojs/errors": "1.
|
|
30
|
-
"@zudojs/logger": "1.
|
|
29
|
+
"@zudojs/errors": "1.4.0",
|
|
30
|
+
"@zudojs/logger": "1.5.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"typescript": "7.0.2",
|