autotel 6.4.1 → 6.5.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/dist/auto.cjs +1 -1
- package/dist/auto.js +1 -1
- package/dist/correlation-id.cjs +1 -1
- package/dist/correlation-id.js +1 -1
- package/dist/decorators.cjs +1 -1
- package/dist/decorators.js +1 -1
- package/dist/event.cjs +1 -1
- package/dist/event.js +1 -1
- package/dist/{functional-qZxRcIBp.cjs → functional-C0uAZq2X.cjs} +1 -1
- package/dist/{functional-0o9xSedq.js → functional-DX7Zvag0.js} +1 -1
- package/dist/functional.cjs +1 -1
- package/dist/functional.js +1 -1
- package/dist/http.cjs +1 -1
- package/dist/http.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/{init-BnxHAi2M.cjs → init-CTtHITlX.cjs} +32 -39
- package/dist/{init-BxfZ3Vbw.js → init-WHYwyItd.js} +32 -39
- package/dist/{init-Cc7-vvzj.d.cts → init-ncTMKZ-s.d.cts} +88 -84
- package/dist/{init-CsODvlau.d.ts → init-pPI3JRRf.d.ts} +88 -84
- package/dist/instrumentation.cjs +1 -1
- package/dist/instrumentation.js +1 -1
- package/dist/messaging.cjs +1 -1
- package/dist/messaging.js +1 -1
- package/dist/semantic-helpers.cjs +1 -1
- package/dist/semantic-helpers.js +1 -1
- package/dist/webhook.cjs +1 -1
- package/dist/webhook.js +1 -1
- package/dist/workflow-distributed.cjs +1 -1
- package/dist/workflow-distributed.js +1 -1
- package/dist/workflow.cjs +1 -1
- package/dist/workflow.js +1 -1
- package/dist/yaml-config.d.cts +1 -1
- package/dist/yaml-config.d.ts +1 -1
- package/package.json +1 -1
package/dist/auto.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('./rolldown-runtime-C_NdSu1c.cjs');
|
|
2
|
-
const require_init = require('./init-
|
|
2
|
+
const require_init = require('./init-CTtHITlX.cjs');
|
|
3
3
|
const require_yaml_config = require('./yaml-config.cjs');
|
|
4
4
|
let node_module = require("node:module");
|
|
5
5
|
node_module = require_rolldown_runtime.__toESM(node_module, 1);
|
package/dist/auto.js
CHANGED
package/dist/correlation-id.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-CTtHITlX.cjs');
|
|
3
3
|
|
|
4
4
|
exports.CORRELATION_ID_BAGGAGE_KEY = require_init.CORRELATION_ID_BAGGAGE_KEY;
|
|
5
5
|
exports.generateCorrelationId = require_init.generateCorrelationId;
|
package/dist/correlation-id.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as setCorrelationId, S as runWithCorrelationId, _ as CORRELATION_ID_BAGGAGE_KEY, b as getCorrelationStorage, v as generateCorrelationId, w as setCorrelationIdInBaggage, x as getOrCreateCorrelationId, y as getCorrelationId } from "./init-
|
|
1
|
+
import { C as setCorrelationId, S as runWithCorrelationId, _ as CORRELATION_ID_BAGGAGE_KEY, b as getCorrelationStorage, v as generateCorrelationId, w as setCorrelationIdInBaggage, x as getOrCreateCorrelationId, y as getCorrelationId } from "./init-WHYwyItd.js";
|
|
2
2
|
|
|
3
3
|
export { CORRELATION_ID_BAGGAGE_KEY, generateCorrelationId, getCorrelationId, getCorrelationStorage, getOrCreateCorrelationId, runWithCorrelationId, setCorrelationId, setCorrelationIdInBaggage };
|
package/dist/decorators.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_config = require('./config.cjs');
|
|
3
|
-
const require_init = require('./init-
|
|
3
|
+
const require_init = require('./init-CTtHITlX.cjs');
|
|
4
4
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
5
5
|
|
|
6
6
|
//#region src/decorators.ts
|
package/dist/decorators.js
CHANGED
package/dist/event.cjs
CHANGED
package/dist/event.js
CHANGED
|
@@ -2,7 +2,7 @@ const require_rolldown_runtime = require('./rolldown-runtime-C_NdSu1c.cjs');
|
|
|
2
2
|
const require_tracer_provider = require('./tracer-provider.cjs');
|
|
3
3
|
const require_config = require('./config.cjs');
|
|
4
4
|
const require_sampling = require('./sampling.cjs');
|
|
5
|
-
const require_init = require('./init-
|
|
5
|
+
const require_init = require('./init-CTtHITlX.cjs');
|
|
6
6
|
const require_trace_helpers = require('./trace-helpers.cjs');
|
|
7
7
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getForceFlushableProvider } from "./tracer-provider.js";
|
|
2
2
|
import { getConfig } from "./config.js";
|
|
3
3
|
import { AUTOTEL_SAMPLING_RATE, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AlwaysSampler } from "./sampling.js";
|
|
4
|
-
import { D as getActiveContextWithBaggage, O as getContextStorage, T as createTraceContext, h as getEventQueue, m as runInOperationContext, r as getSdk, t as getConfig$1 } from "./init-
|
|
4
|
+
import { D as getActiveContextWithBaggage, O as getContextStorage, T as createTraceContext, h as getEventQueue, m as runInOperationContext, r as getSdk, t as getConfig$1 } from "./init-WHYwyItd.js";
|
|
5
5
|
import { setSpanName } from "./trace-helpers.js";
|
|
6
6
|
import { SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
|
|
7
7
|
import * as nodeFs from "node:fs";
|
package/dist/functional.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_functional = require('./functional-
|
|
2
|
+
const require_functional = require('./functional-C0uAZq2X.cjs');
|
|
3
3
|
|
|
4
4
|
exports.ctx = require_functional.ctx;
|
|
5
5
|
exports.getActiveTraceContext = require_functional.getActiveTraceContext;
|
package/dist/functional.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as trace, c as withTracing, i as span, n as getActiveTraceContext, o as withBaggage, r as instrument, s as withNewContext, t as ctx } from "./functional-
|
|
1
|
+
import { a as trace, c as withTracing, i as span, n as getActiveTraceContext, o as withBaggage, r as instrument, s as withNewContext, t as ctx } from "./functional-DX7Zvag0.js";
|
|
2
2
|
|
|
3
3
|
export { ctx, getActiveTraceContext, instrument, span, trace, withBaggage, withNewContext, withTracing };
|
package/dist/http.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_config = require('./config.cjs');
|
|
3
|
-
const require_init = require('./init-
|
|
3
|
+
const require_init = require('./init-CTtHITlX.cjs');
|
|
4
4
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
5
5
|
|
|
6
6
|
//#region src/http.ts
|
package/dist/http.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getConfig } from "./config.js";
|
|
2
|
-
import { D as getActiveContextWithBaggage } from "./init-
|
|
2
|
+
import { D as getActiveContextWithBaggage } from "./init-WHYwyItd.js";
|
|
3
3
|
import { SpanStatusCode, context, propagation } from "@opentelemetry/api";
|
|
4
4
|
|
|
5
5
|
//#region src/http.ts
|
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
const require_rolldown_runtime = require('./rolldown-runtime-C_NdSu1c.cjs');
|
|
3
3
|
const require_tracer_provider = require('./tracer-provider.cjs');
|
|
4
4
|
const require_sampling = require('./sampling.cjs');
|
|
5
|
-
const require_init = require('./init-
|
|
5
|
+
const require_init = require('./init-CTtHITlX.cjs');
|
|
6
6
|
const require_filtering_span_processor = require('./filtering-span-processor.cjs');
|
|
7
7
|
const require_span_name_normalizer = require('./span-name-normalizer.cjs');
|
|
8
8
|
const require_attribute_redacting_processor = require('./attribute-redacting-processor.cjs');
|
|
@@ -10,7 +10,7 @@ const require_canonical_log_line_processor = require('./canonical-log-line-proce
|
|
|
10
10
|
const require_structured_error = require('./structured-error-CHg7DoIQ.cjs');
|
|
11
11
|
const require_metric = require('./metric.cjs');
|
|
12
12
|
const require_trace_helpers = require('./trace-helpers.cjs');
|
|
13
|
-
const require_functional = require('./functional-
|
|
13
|
+
const require_functional = require('./functional-C0uAZq2X.cjs');
|
|
14
14
|
const require_stable_hash = require('./stable-hash-CS9BxvVQ.cjs');
|
|
15
15
|
const require_correlated_events = require('./correlated-events-kSwLo3mi.cjs');
|
|
16
16
|
const require_parse_error = require('./parse-error.cjs');
|
package/dist/index.d.cts
CHANGED
|
@@ -9,7 +9,7 @@ import { DrainPipelineOptions, PipelineDrainFn, createDrainPipeline } from "./dr
|
|
|
9
9
|
import { a as EventSubscriber, c as OutcomeStatus, i as EventSchemaMetadata, n as EventAttributes, o as EventTrackingOptions, s as FunnelStatus, t as AutotelEventContext } from "./event-subscriber-CWh8sTGh.cjs";
|
|
10
10
|
import { Event, EventsOptions, getEvents, resetEvents } from "./event.cjs";
|
|
11
11
|
import { n as FilteringSpanProcessorOptions, r as SpanFilterPredicate, t as FilteringSpanProcessor } from "./filtering-span-processor-BpDagWNa.cjs";
|
|
12
|
-
import { a as AutotelConfig, c as StringRedactor, i as lockLogger, l as createStringRedactor, n as isInitialized, r as isLoggerLocked, s as ProcessHandlersConfig, t as init } from "./init-
|
|
12
|
+
import { a as AutotelConfig, c as StringRedactor, i as lockLogger, l as createStringRedactor, n as isInitialized, r as isLoggerLocked, s as ProcessHandlersConfig, t as init } from "./init-ncTMKZ-s.cjs";
|
|
13
13
|
import { a as SpanNameNormalizerPreset, i as SpanNameNormalizerFn, n as NORMALIZER_PRESETS, o as SpanNameNormalizingProcessor, r as SpanNameNormalizerConfig, s as SpanNameNormalizingProcessorOptions, t as NORMALIZER_PATTERNS } from "./span-name-normalizer-CN1-8C76.cjs";
|
|
14
14
|
import "./canonical-log-line-processor-B4WgG-VS.cjs";
|
|
15
15
|
import { i as defineEvent, n as DefinedEvent, r as SchemaLike, t as DefineEventOptions } from "./define-event-CGG048HE.cjs";
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { DrainPipelineOptions, PipelineDrainFn, createDrainPipeline } from "./dr
|
|
|
9
9
|
import { a as EventSubscriber, c as OutcomeStatus, i as EventSchemaMetadata, n as EventAttributes, o as EventTrackingOptions, s as FunnelStatus, t as AutotelEventContext } from "./event-subscriber-CWh8sTGh.js";
|
|
10
10
|
import { Event, EventsOptions, getEvents, resetEvents } from "./event.js";
|
|
11
11
|
import { n as FilteringSpanProcessorOptions, r as SpanFilterPredicate, t as FilteringSpanProcessor } from "./filtering-span-processor-BpDagWNa.js";
|
|
12
|
-
import { a as AutotelConfig, c as StringRedactor, i as lockLogger, l as createStringRedactor, n as isInitialized, r as isLoggerLocked, s as ProcessHandlersConfig, t as init } from "./init-
|
|
12
|
+
import { a as AutotelConfig, c as StringRedactor, i as lockLogger, l as createStringRedactor, n as isInitialized, r as isLoggerLocked, s as ProcessHandlersConfig, t as init } from "./init-pPI3JRRf.js";
|
|
13
13
|
import { a as SpanNameNormalizerPreset, i as SpanNameNormalizerFn, n as NORMALIZER_PRESETS, o as SpanNameNormalizingProcessor, r as SpanNameNormalizerConfig, s as SpanNameNormalizingProcessorOptions, t as NORMALIZER_PATTERNS } from "./span-name-normalizer-CN1-8C76.js";
|
|
14
14
|
import "./canonical-log-line-processor-CL_J7gb5.js";
|
|
15
15
|
import { i as defineEvent, n as DefinedEvent, r as SchemaLike, t as DefineEventOptions } from "./define-event-B2z1SBe7.js";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAutotelTracer, getAutotelTracerProvider, setAutotelTracerProvider } from "./tracer-provider.js";
|
|
2
2
|
import { AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, NeverSampler, RandomSampler, UserIdSampler, createLinkFromHeaders, extractLinksFromBatch, resolveSamplingPreset, samplingPresets } from "./sampling.js";
|
|
3
|
-
import { A as BaggageSpanProcessor, C as setCorrelationId, E as defineBaggageSchema, S as runWithCorrelationId, T as createTraceContext, _ as CORRELATION_ID_BAGGAGE_KEY, a as isInitialized, c as flush, d as getEvents, f as resetEvents, g as track, h as getEventQueue, i as init, k as createStringRedactor, l as shutdown, m as runInOperationContext, o as isLoggerLocked, p as getOperationContext, s as lockLogger, u as Event, v as generateCorrelationId, w as setCorrelationIdInBaggage, x as getOrCreateCorrelationId, y as getCorrelationId } from "./init-
|
|
3
|
+
import { A as BaggageSpanProcessor, C as setCorrelationId, E as defineBaggageSchema, S as runWithCorrelationId, T as createTraceContext, _ as CORRELATION_ID_BAGGAGE_KEY, a as isInitialized, c as flush, d as getEvents, f as resetEvents, g as track, h as getEventQueue, i as init, k as createStringRedactor, l as shutdown, m as runInOperationContext, o as isLoggerLocked, p as getOperationContext, s as lockLogger, u as Event, v as generateCorrelationId, w as setCorrelationIdInBaggage, x as getOrCreateCorrelationId, y as getCorrelationId } from "./init-WHYwyItd.js";
|
|
4
4
|
import { FilteringSpanProcessor } from "./filtering-span-processor.js";
|
|
5
5
|
import { NORMALIZER_PATTERNS, NORMALIZER_PRESETS, SpanNameNormalizingProcessor } from "./span-name-normalizer.js";
|
|
6
6
|
import { AttributeRedactingProcessor, REDACTOR_PATTERNS, REDACTOR_PRESETS, builtinPatterns, createAttributeRedactor, createRedactedSpan, normalizeAttributeRedactorConfig } from "./attribute-redacting-processor.js";
|
|
@@ -8,7 +8,7 @@ import { n as formatDuration } from "./canonical-log-line-processor-B0vq_QR6.js"
|
|
|
8
8
|
import { a as flattenToAttributes, i as structuredErrorToJSON, n as getStructuredErrorAttributes, o as toAttributeValue, r as recordStructuredError, t as createStructuredError } from "./structured-error-9--cxBay.js";
|
|
9
9
|
import { Metric, getMetrics, resetMetrics } from "./metric.js";
|
|
10
10
|
import { createDeterministicTraceId, enrichWithTraceContext, finalizeSpan, flattenMetadata, getActiveContext, getActiveSpan, getTraceContext, getTracer, isTracing, resolveTraceUrl, runWithSpan } from "./trace-helpers.js";
|
|
11
|
-
import { a as trace$2, c as withTracing, i as span, n as getActiveTraceContext, o as withBaggage, r as instrument, s as withNewContext, t as ctx } from "./functional-
|
|
11
|
+
import { a as trace$2, c as withTracing, i as span, n as getActiveTraceContext, o as withBaggage, r as instrument, s as withNewContext, t as ctx } from "./functional-DX7Zvag0.js";
|
|
12
12
|
import { t as hashJson } from "./stable-hash-ChFBIhNt.js";
|
|
13
13
|
import { t as emitCorrelatedEvent } from "./correlated-events-Bzh5y-UB.js";
|
|
14
14
|
import { parseError } from "./parse-error.js";
|
|
@@ -27,6 +27,37 @@ let _opentelemetry_exporter_metrics_otlp_http = require("@opentelemetry/exporter
|
|
|
27
27
|
let _opentelemetry_exporter_trace_otlp_http = require("@opentelemetry/exporter-trace-otlp-http");
|
|
28
28
|
let _opentelemetry_exporter_logs_otlp_http = require("@opentelemetry/exporter-logs-otlp-http");
|
|
29
29
|
|
|
30
|
+
//#region src/init-logger.ts
|
|
31
|
+
const LOG_LEVELS = {
|
|
32
|
+
debug: 0,
|
|
33
|
+
info: 1,
|
|
34
|
+
warn: 2,
|
|
35
|
+
error: 3
|
|
36
|
+
};
|
|
37
|
+
/** Silent logger used until and unless the application opts into diagnostics. */
|
|
38
|
+
const silentLogger = {
|
|
39
|
+
info: () => {},
|
|
40
|
+
warn: () => {},
|
|
41
|
+
error: () => {},
|
|
42
|
+
debug: () => {}
|
|
43
|
+
};
|
|
44
|
+
/** Apply the resolved silence and minimum-level settings to a logger. */
|
|
45
|
+
function wrapLogger(base, silent, minLevel) {
|
|
46
|
+
if (silent) return silentLogger;
|
|
47
|
+
const threshold = LOG_LEVELS[minLevel];
|
|
48
|
+
const wrap = (fn, level) => {
|
|
49
|
+
if (LOG_LEVELS[level] < threshold) return (() => {});
|
|
50
|
+
return ((...args) => fn(...args));
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
debug: wrap(base.debug, "debug"),
|
|
54
|
+
info: wrap(base.info, "info"),
|
|
55
|
+
warn: wrap(base.warn, "warn"),
|
|
56
|
+
error: wrap(base.error, "error")
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
30
61
|
//#region src/posthog-logs.ts
|
|
31
62
|
var RedactingLogRecordProcessor = class {
|
|
32
63
|
wrapped;
|
|
@@ -2921,17 +2952,6 @@ function getAutoInstrumentations(integrations, manualInstrumentationNames = /* @
|
|
|
2921
2952
|
* Replaces initInstrumentation() and separate events config.
|
|
2922
2953
|
*/
|
|
2923
2954
|
/**
|
|
2924
|
-
* Silent logger (no-op) - used as default when user doesn't provide one.
|
|
2925
|
-
* Internal autotel logs are silent by default to avoid spam.
|
|
2926
|
-
* Users can import { autotelLogger } from 'autotel/logger' to create their own.
|
|
2927
|
-
*/
|
|
2928
|
-
const silentLogger = {
|
|
2929
|
-
info: () => {},
|
|
2930
|
-
warn: () => {},
|
|
2931
|
-
error: () => {},
|
|
2932
|
-
debug: () => {}
|
|
2933
|
-
};
|
|
2934
|
-
/**
|
|
2935
2955
|
* Adapts an Autotel Sampler to the OTel SDK Sampler interface.
|
|
2936
2956
|
*/
|
|
2937
2957
|
function toOtelSampler(sampler) {
|
|
@@ -2968,12 +2988,6 @@ function acceptsStringRedactor(subscriber) {
|
|
|
2968
2988
|
}
|
|
2969
2989
|
let _optionalRequire = require_node_require.safeRequire;
|
|
2970
2990
|
let _devtoolsClose = null;
|
|
2971
|
-
const LOG_LEVELS = {
|
|
2972
|
-
debug: 0,
|
|
2973
|
-
info: 1,
|
|
2974
|
-
warn: 2,
|
|
2975
|
-
error: 3
|
|
2976
|
-
};
|
|
2977
2991
|
/**
|
|
2978
2992
|
* Lock the logger to prevent further `init()` calls.
|
|
2979
2993
|
* Use this when framework plugins set up instrumentation and you want
|
|
@@ -2988,28 +3002,6 @@ function lockLogger() {
|
|
|
2988
3002
|
function isLoggerLocked() {
|
|
2989
3003
|
return locked;
|
|
2990
3004
|
}
|
|
2991
|
-
function createSilentLogger() {
|
|
2992
|
-
return {
|
|
2993
|
-
info: () => {},
|
|
2994
|
-
warn: () => {},
|
|
2995
|
-
error: () => {},
|
|
2996
|
-
debug: () => {}
|
|
2997
|
-
};
|
|
2998
|
-
}
|
|
2999
|
-
function wrapLogger(base, silent, minLevel) {
|
|
3000
|
-
if (silent) return createSilentLogger();
|
|
3001
|
-
const threshold = LOG_LEVELS[minLevel];
|
|
3002
|
-
const wrap = (fn, level) => {
|
|
3003
|
-
if (LOG_LEVELS[level] < threshold) return (() => {});
|
|
3004
|
-
return ((...args) => fn(...args));
|
|
3005
|
-
};
|
|
3006
|
-
return {
|
|
3007
|
-
debug: wrap(base.debug, "debug"),
|
|
3008
|
-
info: wrap(base.info, "info"),
|
|
3009
|
-
warn: wrap(base.warn, "warn"),
|
|
3010
|
-
error: wrap(base.error, "error")
|
|
3011
|
-
};
|
|
3012
|
-
}
|
|
3013
3005
|
/**
|
|
3014
3006
|
* Initialize autotel - Write Once, Observe Everywhere
|
|
3015
3007
|
*
|
|
@@ -3188,6 +3180,7 @@ function init(cfg) {
|
|
|
3188
3180
|
mergedConfig.spanFilter = userSpanFilter ? (span) => userSpanFilter(span) && require_policy.policySpanFilter(span) : require_policy.policySpanFilter;
|
|
3189
3181
|
}
|
|
3190
3182
|
if (mergedConfig.spanFilter && spanProcessors.length > 0) spanProcessors = spanProcessors.map((processor) => new require_filtering_span_processor.FilteringSpanProcessor(processor, { filter: mergedConfig.spanFilter }));
|
|
3183
|
+
if (mergedConfig.spanEnrichers && mergedConfig.spanEnrichers.length > 0) spanProcessors.unshift(...mergedConfig.spanEnrichers);
|
|
3191
3184
|
const metricReaders = [];
|
|
3192
3185
|
if (configuredMetricReaders && configuredMetricReaders.length > 0) metricReaders.push(...configuredMetricReaders);
|
|
3193
3186
|
else if (metricsEnabled) for (const destination of otlpDestinations) {
|
|
@@ -25,6 +25,37 @@ import { OTLPMetricExporter } from "@opentelemetry/exporter-metrics-otlp-http";
|
|
|
25
25
|
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
|
26
26
|
import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
|
|
27
27
|
|
|
28
|
+
//#region src/init-logger.ts
|
|
29
|
+
const LOG_LEVELS = {
|
|
30
|
+
debug: 0,
|
|
31
|
+
info: 1,
|
|
32
|
+
warn: 2,
|
|
33
|
+
error: 3
|
|
34
|
+
};
|
|
35
|
+
/** Silent logger used until and unless the application opts into diagnostics. */
|
|
36
|
+
const silentLogger = {
|
|
37
|
+
info: () => {},
|
|
38
|
+
warn: () => {},
|
|
39
|
+
error: () => {},
|
|
40
|
+
debug: () => {}
|
|
41
|
+
};
|
|
42
|
+
/** Apply the resolved silence and minimum-level settings to a logger. */
|
|
43
|
+
function wrapLogger(base, silent, minLevel) {
|
|
44
|
+
if (silent) return silentLogger;
|
|
45
|
+
const threshold = LOG_LEVELS[minLevel];
|
|
46
|
+
const wrap = (fn, level) => {
|
|
47
|
+
if (LOG_LEVELS[level] < threshold) return (() => {});
|
|
48
|
+
return ((...args) => fn(...args));
|
|
49
|
+
};
|
|
50
|
+
return {
|
|
51
|
+
debug: wrap(base.debug, "debug"),
|
|
52
|
+
info: wrap(base.info, "info"),
|
|
53
|
+
warn: wrap(base.warn, "warn"),
|
|
54
|
+
error: wrap(base.error, "error")
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
28
59
|
//#region src/posthog-logs.ts
|
|
29
60
|
var RedactingLogRecordProcessor = class {
|
|
30
61
|
wrapped;
|
|
@@ -2919,17 +2950,6 @@ function getAutoInstrumentations(integrations, manualInstrumentationNames = /* @
|
|
|
2919
2950
|
* Replaces initInstrumentation() and separate events config.
|
|
2920
2951
|
*/
|
|
2921
2952
|
/**
|
|
2922
|
-
* Silent logger (no-op) - used as default when user doesn't provide one.
|
|
2923
|
-
* Internal autotel logs are silent by default to avoid spam.
|
|
2924
|
-
* Users can import { autotelLogger } from 'autotel/logger' to create their own.
|
|
2925
|
-
*/
|
|
2926
|
-
const silentLogger = {
|
|
2927
|
-
info: () => {},
|
|
2928
|
-
warn: () => {},
|
|
2929
|
-
error: () => {},
|
|
2930
|
-
debug: () => {}
|
|
2931
|
-
};
|
|
2932
|
-
/**
|
|
2933
2953
|
* Adapts an Autotel Sampler to the OTel SDK Sampler interface.
|
|
2934
2954
|
*/
|
|
2935
2955
|
function toOtelSampler(sampler) {
|
|
@@ -2966,12 +2986,6 @@ function acceptsStringRedactor(subscriber) {
|
|
|
2966
2986
|
}
|
|
2967
2987
|
let _optionalRequire = safeRequire;
|
|
2968
2988
|
let _devtoolsClose = null;
|
|
2969
|
-
const LOG_LEVELS = {
|
|
2970
|
-
debug: 0,
|
|
2971
|
-
info: 1,
|
|
2972
|
-
warn: 2,
|
|
2973
|
-
error: 3
|
|
2974
|
-
};
|
|
2975
2989
|
/**
|
|
2976
2990
|
* Lock the logger to prevent further `init()` calls.
|
|
2977
2991
|
* Use this when framework plugins set up instrumentation and you want
|
|
@@ -2986,28 +3000,6 @@ function lockLogger() {
|
|
|
2986
3000
|
function isLoggerLocked() {
|
|
2987
3001
|
return locked;
|
|
2988
3002
|
}
|
|
2989
|
-
function createSilentLogger() {
|
|
2990
|
-
return {
|
|
2991
|
-
info: () => {},
|
|
2992
|
-
warn: () => {},
|
|
2993
|
-
error: () => {},
|
|
2994
|
-
debug: () => {}
|
|
2995
|
-
};
|
|
2996
|
-
}
|
|
2997
|
-
function wrapLogger(base, silent, minLevel) {
|
|
2998
|
-
if (silent) return createSilentLogger();
|
|
2999
|
-
const threshold = LOG_LEVELS[minLevel];
|
|
3000
|
-
const wrap = (fn, level) => {
|
|
3001
|
-
if (LOG_LEVELS[level] < threshold) return (() => {});
|
|
3002
|
-
return ((...args) => fn(...args));
|
|
3003
|
-
};
|
|
3004
|
-
return {
|
|
3005
|
-
debug: wrap(base.debug, "debug"),
|
|
3006
|
-
info: wrap(base.info, "info"),
|
|
3007
|
-
warn: wrap(base.warn, "warn"),
|
|
3008
|
-
error: wrap(base.error, "error")
|
|
3009
|
-
};
|
|
3010
|
-
}
|
|
3011
3003
|
/**
|
|
3012
3004
|
* Initialize autotel - Write Once, Observe Everywhere
|
|
3013
3005
|
*
|
|
@@ -3186,6 +3178,7 @@ function init(cfg) {
|
|
|
3186
3178
|
mergedConfig.spanFilter = userSpanFilter ? (span) => userSpanFilter(span) && policySpanFilter(span) : policySpanFilter;
|
|
3187
3179
|
}
|
|
3188
3180
|
if (mergedConfig.spanFilter && spanProcessors.length > 0) spanProcessors = spanProcessors.map((processor) => new FilteringSpanProcessor(processor, { filter: mergedConfig.spanFilter }));
|
|
3181
|
+
if (mergedConfig.spanEnrichers && mergedConfig.spanEnrichers.length > 0) spanProcessors.unshift(...mergedConfig.spanEnrichers);
|
|
3189
3182
|
const metricReaders = [];
|
|
3190
3183
|
if (configuredMetricReaders && configuredMetricReaders.length > 0) metricReaders.push(...configuredMetricReaders);
|
|
3191
3184
|
else if (metricsEnabled) for (const destination of otlpDestinations) {
|
|
@@ -6,7 +6,7 @@ import { r as SpanFilterPredicate } from "./filtering-span-processor-BpDagWNa.cj
|
|
|
6
6
|
import { r as Policy } from "./policy-CbpP4tFH.cjs";
|
|
7
7
|
import { r as SpanNameNormalizerConfig } from "./span-name-normalizer-CN1-8C76.cjs";
|
|
8
8
|
import { t as CanonicalLogLineOptions } from "./canonical-log-line-processor-B4WgG-VS.cjs";
|
|
9
|
-
import { SpanExporter, SpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
9
|
+
import { ReadableSpan, SpanExporter, SpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
10
10
|
import { Attributes } from "@opentelemetry/api";
|
|
11
11
|
import { Resource } from "@opentelemetry/resources";
|
|
12
12
|
import { NodeSDK, NodeSDKConfiguration } from "@opentelemetry/sdk-node";
|
|
@@ -223,6 +223,73 @@ interface ProcessHandlersConfig {
|
|
|
223
223
|
shutdownTimeoutMs?: number;
|
|
224
224
|
}
|
|
225
225
|
//#endregion
|
|
226
|
+
//#region src/canonical-log-lines-config.d.ts
|
|
227
|
+
/**
|
|
228
|
+
* Emit completed spans as canonical wide-event logs.
|
|
229
|
+
*
|
|
230
|
+
* Each span (or only each root span) becomes one comprehensive log record with
|
|
231
|
+
* all span attributes. This provides high-cardinality, structured events
|
|
232
|
+
* without scattering logging calls throughout a request.
|
|
233
|
+
*
|
|
234
|
+
* @example One canonical log line per request
|
|
235
|
+
* ```typescript
|
|
236
|
+
* init({
|
|
237
|
+
* service: 'checkout-api',
|
|
238
|
+
* canonicalLogLines: {
|
|
239
|
+
* enabled: true,
|
|
240
|
+
* rootSpansOnly: true,
|
|
241
|
+
* },
|
|
242
|
+
* });
|
|
243
|
+
* ```
|
|
244
|
+
*
|
|
245
|
+
* @example Custom logger and message
|
|
246
|
+
* ```typescript
|
|
247
|
+
* const logger = pino();
|
|
248
|
+
* init({
|
|
249
|
+
* service: 'checkout-api',
|
|
250
|
+
* logger,
|
|
251
|
+
* canonicalLogLines: {
|
|
252
|
+
* enabled: true,
|
|
253
|
+
* logger,
|
|
254
|
+
* messageFormat: (span) => {
|
|
255
|
+
* const status = span.status.code === 2 ? 'ERROR' : 'SUCCESS';
|
|
256
|
+
* return `${span.name} [${status}]`;
|
|
257
|
+
* },
|
|
258
|
+
* },
|
|
259
|
+
* });
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
interface CanonicalLogLinesConfig {
|
|
263
|
+
enabled: boolean;
|
|
264
|
+
/** Logger to use for emitting canonical log lines (defaults to OTel Logs API). */
|
|
265
|
+
logger?: Logger;
|
|
266
|
+
/** Only emit canonical log lines for root spans (default: false). */
|
|
267
|
+
rootSpansOnly?: boolean;
|
|
268
|
+
/** Minimum log level for canonical log lines (default: 'info'). */
|
|
269
|
+
minLevel?: 'debug' | 'info' | 'warn' | 'error';
|
|
270
|
+
/** Custom message format (default: uses the span name). */
|
|
271
|
+
messageFormat?: (span: ReadableSpan) => string;
|
|
272
|
+
/** Whether to include resource attributes (default: true). */
|
|
273
|
+
includeResourceAttributes?: boolean;
|
|
274
|
+
/** Predicate to decide whether to emit (runs after the event is built). */
|
|
275
|
+
shouldEmit?: CanonicalLogLineOptions['shouldEmit'];
|
|
276
|
+
/**
|
|
277
|
+
* Declarative tail sampling conditions (OR logic).
|
|
278
|
+
* Ignored when `shouldEmit` is provided.
|
|
279
|
+
* @example keep: [{ status: 500 }, { durationMs: 1000 }]
|
|
280
|
+
*/
|
|
281
|
+
keep?: CanonicalLogLineOptions['keep'];
|
|
282
|
+
/** Callback invoked after emit for custom fan-out. */
|
|
283
|
+
drain?: CanonicalLogLineOptions['drain'];
|
|
284
|
+
/** Handler for drain failures. */
|
|
285
|
+
onDrainError?: CanonicalLogLineOptions['onDrainError'];
|
|
286
|
+
/**
|
|
287
|
+
* Pretty-print canonical log lines to console.
|
|
288
|
+
* Defaults to true when NODE_ENV is 'development'.
|
|
289
|
+
*/
|
|
290
|
+
pretty?: boolean;
|
|
291
|
+
}
|
|
292
|
+
//#endregion
|
|
226
293
|
//#region src/otlp-exporters.d.ts
|
|
227
294
|
type OtlpSignal = 'traces' | 'metrics' | 'logs';
|
|
228
295
|
interface OtlpDestinationConfig {
|
|
@@ -465,6 +532,24 @@ interface AutotelConfig {
|
|
|
465
532
|
* ```
|
|
466
533
|
*/
|
|
467
534
|
spanProcessors?: SpanProcessor[];
|
|
535
|
+
/**
|
|
536
|
+
* Span processors that decorate spans on the way out, running before every
|
|
537
|
+
* exporting processor.
|
|
538
|
+
*
|
|
539
|
+
* Unlike {@link spanProcessors}, which replaces the pipeline autotel would
|
|
540
|
+
* have built, these are added to it. Use them for processors that enrich
|
|
541
|
+
* rather than export, so `destinations` keeps working:
|
|
542
|
+
*
|
|
543
|
+
* @example
|
|
544
|
+
* ```typescript
|
|
545
|
+
* init({
|
|
546
|
+
* service: 'support-agent',
|
|
547
|
+
* destinations: [{ endpoint: `${langfuseUrl}/api/public/otel`, headers }],
|
|
548
|
+
* spanEnrichers: [langfuseCompatibility({ tags: ['production'] })],
|
|
549
|
+
* })
|
|
550
|
+
* ```
|
|
551
|
+
*/
|
|
552
|
+
spanEnrichers?: SpanProcessor[];
|
|
468
553
|
/**
|
|
469
554
|
* Custom span processor for traces (single-item alias of spanProcessors)
|
|
470
555
|
* @deprecated Use spanProcessors for consistency with other multi-value config fields
|
|
@@ -1105,89 +1190,8 @@ interface AutotelConfig {
|
|
|
1105
1190
|
enabled: boolean;
|
|
1106
1191
|
options?: Record<string, unknown>;
|
|
1107
1192
|
};
|
|
1108
|
-
/**
|
|
1109
|
-
|
|
1110
|
-
*
|
|
1111
|
-
* When enabled, each span (or root span only) is automatically emitted as a
|
|
1112
|
-
* comprehensive log record with ALL span attributes. This implements the
|
|
1113
|
-
* "canonical log line" pattern: one comprehensive event per request with all context.
|
|
1114
|
-
*
|
|
1115
|
-
* **Benefits:**
|
|
1116
|
-
* - One log line per request with all context (wide event)
|
|
1117
|
-
* - High-cardinality, high-dimensionality data for powerful queries
|
|
1118
|
-
* - Automatic - no manual logging needed
|
|
1119
|
-
* - Queryable as structured data instead of string search
|
|
1120
|
-
*
|
|
1121
|
-
* @example Basic usage (one canonical log line per request)
|
|
1122
|
-
* ```typescript
|
|
1123
|
-
* init({
|
|
1124
|
-
* service: 'checkout-api',
|
|
1125
|
-
* canonicalLogLines: {
|
|
1126
|
-
* enabled: true,
|
|
1127
|
-
* rootSpansOnly: true, // One canonical log line per request
|
|
1128
|
-
* },
|
|
1129
|
-
* });
|
|
1130
|
-
* ```
|
|
1131
|
-
*
|
|
1132
|
-
* @example With custom logger
|
|
1133
|
-
* ```typescript
|
|
1134
|
-
* import pino from 'pino';
|
|
1135
|
-
* const logger = pino();
|
|
1136
|
-
* init({
|
|
1137
|
-
* service: 'my-app',
|
|
1138
|
-
* logger,
|
|
1139
|
-
* canonicalLogLines: {
|
|
1140
|
-
* enabled: true,
|
|
1141
|
-
* logger, // Use Pino for canonical log lines
|
|
1142
|
-
* rootSpansOnly: true,
|
|
1143
|
-
* },
|
|
1144
|
-
* });
|
|
1145
|
-
* ```
|
|
1146
|
-
*
|
|
1147
|
-
* @example Custom message format
|
|
1148
|
-
* ```typescript
|
|
1149
|
-
* init({
|
|
1150
|
-
* service: 'my-app',
|
|
1151
|
-
* canonicalLogLines: {
|
|
1152
|
-
* enabled: true,
|
|
1153
|
-
* messageFormat: (span) => {
|
|
1154
|
-
* const status = span.status.code === 2 ? 'ERROR' : 'SUCCESS';
|
|
1155
|
-
* return `${span.name} [${status}]`;
|
|
1156
|
-
* },
|
|
1157
|
-
* },
|
|
1158
|
-
* });
|
|
1159
|
-
* ```
|
|
1160
|
-
*/
|
|
1161
|
-
canonicalLogLines?: {
|
|
1162
|
-
enabled: boolean;
|
|
1163
|
-
/** Logger to use for emitting canonical log lines (defaults to OTel Logs API) */
|
|
1164
|
-
logger?: Logger;
|
|
1165
|
-
/** Only emit canonical log lines for root spans (default: false) */
|
|
1166
|
-
rootSpansOnly?: boolean;
|
|
1167
|
-
/** Minimum log level for canonical log lines (default: 'info') */
|
|
1168
|
-
minLevel?: 'debug' | 'info' | 'warn' | 'error';
|
|
1169
|
-
/** Custom message format (default: uses span name) */
|
|
1170
|
-
messageFormat?: (span: import('@opentelemetry/sdk-trace-base').ReadableSpan) => string;
|
|
1171
|
-
/** Whether to include resource attributes (default: true) */
|
|
1172
|
-
includeResourceAttributes?: boolean;
|
|
1173
|
-
/** Predicate to decide whether to emit (runs after event is built). */
|
|
1174
|
-
shouldEmit?: CanonicalLogLineOptions['shouldEmit'];
|
|
1175
|
-
/**
|
|
1176
|
-
* Declarative tail sampling conditions (OR logic).
|
|
1177
|
-
* Ignored when `shouldEmit` is provided.
|
|
1178
|
-
* @example keep: [{ status: 500 }, { durationMs: 1000 }]
|
|
1179
|
-
*/
|
|
1180
|
-
keep?: CanonicalLogLineOptions['keep'];
|
|
1181
|
-
/** Callback invoked after emit for custom fan-out. */
|
|
1182
|
-
drain?: CanonicalLogLineOptions['drain'];
|
|
1183
|
-
/** Handler for drain failures. */
|
|
1184
|
-
onDrainError?: CanonicalLogLineOptions['onDrainError'];
|
|
1185
|
-
/**
|
|
1186
|
-
* Pretty-print canonical log lines to console.
|
|
1187
|
-
* Defaults to true when NODE_ENV is 'development'.
|
|
1188
|
-
*/
|
|
1189
|
-
pretty?: boolean;
|
|
1190
|
-
};
|
|
1193
|
+
/** Emit completed spans as canonical wide-event logs. */
|
|
1194
|
+
canonicalLogLines?: CanonicalLogLinesConfig;
|
|
1191
1195
|
/**
|
|
1192
1196
|
* Suppress console output while keeping OTel exporters running.
|
|
1193
1197
|
* Useful for platforms like GCP Cloud Run / AWS Lambda where stdout
|
|
@@ -7,7 +7,7 @@ import { r as Policy } from "./policy-CbpP4tFH.js";
|
|
|
7
7
|
import { r as SpanNameNormalizerConfig } from "./span-name-normalizer-CN1-8C76.js";
|
|
8
8
|
import { t as CanonicalLogLineOptions } from "./canonical-log-line-processor-CL_J7gb5.js";
|
|
9
9
|
import { NodeSDK, NodeSDKConfiguration } from "@opentelemetry/sdk-node";
|
|
10
|
-
import { SpanExporter, SpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
10
|
+
import { ReadableSpan, SpanExporter, SpanProcessor } from "@opentelemetry/sdk-trace-base";
|
|
11
11
|
import { Resource } from "@opentelemetry/resources";
|
|
12
12
|
import { Attributes } from "@opentelemetry/api";
|
|
13
13
|
import { MetricReader } from "@opentelemetry/sdk-metrics";
|
|
@@ -223,6 +223,73 @@ interface ProcessHandlersConfig {
|
|
|
223
223
|
shutdownTimeoutMs?: number;
|
|
224
224
|
}
|
|
225
225
|
//#endregion
|
|
226
|
+
//#region src/canonical-log-lines-config.d.ts
|
|
227
|
+
/**
|
|
228
|
+
* Emit completed spans as canonical wide-event logs.
|
|
229
|
+
*
|
|
230
|
+
* Each span (or only each root span) becomes one comprehensive log record with
|
|
231
|
+
* all span attributes. This provides high-cardinality, structured events
|
|
232
|
+
* without scattering logging calls throughout a request.
|
|
233
|
+
*
|
|
234
|
+
* @example One canonical log line per request
|
|
235
|
+
* ```typescript
|
|
236
|
+
* init({
|
|
237
|
+
* service: 'checkout-api',
|
|
238
|
+
* canonicalLogLines: {
|
|
239
|
+
* enabled: true,
|
|
240
|
+
* rootSpansOnly: true,
|
|
241
|
+
* },
|
|
242
|
+
* });
|
|
243
|
+
* ```
|
|
244
|
+
*
|
|
245
|
+
* @example Custom logger and message
|
|
246
|
+
* ```typescript
|
|
247
|
+
* const logger = pino();
|
|
248
|
+
* init({
|
|
249
|
+
* service: 'checkout-api',
|
|
250
|
+
* logger,
|
|
251
|
+
* canonicalLogLines: {
|
|
252
|
+
* enabled: true,
|
|
253
|
+
* logger,
|
|
254
|
+
* messageFormat: (span) => {
|
|
255
|
+
* const status = span.status.code === 2 ? 'ERROR' : 'SUCCESS';
|
|
256
|
+
* return `${span.name} [${status}]`;
|
|
257
|
+
* },
|
|
258
|
+
* },
|
|
259
|
+
* });
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
interface CanonicalLogLinesConfig {
|
|
263
|
+
enabled: boolean;
|
|
264
|
+
/** Logger to use for emitting canonical log lines (defaults to OTel Logs API). */
|
|
265
|
+
logger?: Logger;
|
|
266
|
+
/** Only emit canonical log lines for root spans (default: false). */
|
|
267
|
+
rootSpansOnly?: boolean;
|
|
268
|
+
/** Minimum log level for canonical log lines (default: 'info'). */
|
|
269
|
+
minLevel?: 'debug' | 'info' | 'warn' | 'error';
|
|
270
|
+
/** Custom message format (default: uses the span name). */
|
|
271
|
+
messageFormat?: (span: ReadableSpan) => string;
|
|
272
|
+
/** Whether to include resource attributes (default: true). */
|
|
273
|
+
includeResourceAttributes?: boolean;
|
|
274
|
+
/** Predicate to decide whether to emit (runs after the event is built). */
|
|
275
|
+
shouldEmit?: CanonicalLogLineOptions['shouldEmit'];
|
|
276
|
+
/**
|
|
277
|
+
* Declarative tail sampling conditions (OR logic).
|
|
278
|
+
* Ignored when `shouldEmit` is provided.
|
|
279
|
+
* @example keep: [{ status: 500 }, { durationMs: 1000 }]
|
|
280
|
+
*/
|
|
281
|
+
keep?: CanonicalLogLineOptions['keep'];
|
|
282
|
+
/** Callback invoked after emit for custom fan-out. */
|
|
283
|
+
drain?: CanonicalLogLineOptions['drain'];
|
|
284
|
+
/** Handler for drain failures. */
|
|
285
|
+
onDrainError?: CanonicalLogLineOptions['onDrainError'];
|
|
286
|
+
/**
|
|
287
|
+
* Pretty-print canonical log lines to console.
|
|
288
|
+
* Defaults to true when NODE_ENV is 'development'.
|
|
289
|
+
*/
|
|
290
|
+
pretty?: boolean;
|
|
291
|
+
}
|
|
292
|
+
//#endregion
|
|
226
293
|
//#region src/otlp-exporters.d.ts
|
|
227
294
|
type OtlpSignal = 'traces' | 'metrics' | 'logs';
|
|
228
295
|
interface OtlpDestinationConfig {
|
|
@@ -465,6 +532,24 @@ interface AutotelConfig {
|
|
|
465
532
|
* ```
|
|
466
533
|
*/
|
|
467
534
|
spanProcessors?: SpanProcessor[];
|
|
535
|
+
/**
|
|
536
|
+
* Span processors that decorate spans on the way out, running before every
|
|
537
|
+
* exporting processor.
|
|
538
|
+
*
|
|
539
|
+
* Unlike {@link spanProcessors}, which replaces the pipeline autotel would
|
|
540
|
+
* have built, these are added to it. Use them for processors that enrich
|
|
541
|
+
* rather than export, so `destinations` keeps working:
|
|
542
|
+
*
|
|
543
|
+
* @example
|
|
544
|
+
* ```typescript
|
|
545
|
+
* init({
|
|
546
|
+
* service: 'support-agent',
|
|
547
|
+
* destinations: [{ endpoint: `${langfuseUrl}/api/public/otel`, headers }],
|
|
548
|
+
* spanEnrichers: [langfuseCompatibility({ tags: ['production'] })],
|
|
549
|
+
* })
|
|
550
|
+
* ```
|
|
551
|
+
*/
|
|
552
|
+
spanEnrichers?: SpanProcessor[];
|
|
468
553
|
/**
|
|
469
554
|
* Custom span processor for traces (single-item alias of spanProcessors)
|
|
470
555
|
* @deprecated Use spanProcessors for consistency with other multi-value config fields
|
|
@@ -1105,89 +1190,8 @@ interface AutotelConfig {
|
|
|
1105
1190
|
enabled: boolean;
|
|
1106
1191
|
options?: Record<string, unknown>;
|
|
1107
1192
|
};
|
|
1108
|
-
/**
|
|
1109
|
-
|
|
1110
|
-
*
|
|
1111
|
-
* When enabled, each span (or root span only) is automatically emitted as a
|
|
1112
|
-
* comprehensive log record with ALL span attributes. This implements the
|
|
1113
|
-
* "canonical log line" pattern: one comprehensive event per request with all context.
|
|
1114
|
-
*
|
|
1115
|
-
* **Benefits:**
|
|
1116
|
-
* - One log line per request with all context (wide event)
|
|
1117
|
-
* - High-cardinality, high-dimensionality data for powerful queries
|
|
1118
|
-
* - Automatic - no manual logging needed
|
|
1119
|
-
* - Queryable as structured data instead of string search
|
|
1120
|
-
*
|
|
1121
|
-
* @example Basic usage (one canonical log line per request)
|
|
1122
|
-
* ```typescript
|
|
1123
|
-
* init({
|
|
1124
|
-
* service: 'checkout-api',
|
|
1125
|
-
* canonicalLogLines: {
|
|
1126
|
-
* enabled: true,
|
|
1127
|
-
* rootSpansOnly: true, // One canonical log line per request
|
|
1128
|
-
* },
|
|
1129
|
-
* });
|
|
1130
|
-
* ```
|
|
1131
|
-
*
|
|
1132
|
-
* @example With custom logger
|
|
1133
|
-
* ```typescript
|
|
1134
|
-
* import pino from 'pino';
|
|
1135
|
-
* const logger = pino();
|
|
1136
|
-
* init({
|
|
1137
|
-
* service: 'my-app',
|
|
1138
|
-
* logger,
|
|
1139
|
-
* canonicalLogLines: {
|
|
1140
|
-
* enabled: true,
|
|
1141
|
-
* logger, // Use Pino for canonical log lines
|
|
1142
|
-
* rootSpansOnly: true,
|
|
1143
|
-
* },
|
|
1144
|
-
* });
|
|
1145
|
-
* ```
|
|
1146
|
-
*
|
|
1147
|
-
* @example Custom message format
|
|
1148
|
-
* ```typescript
|
|
1149
|
-
* init({
|
|
1150
|
-
* service: 'my-app',
|
|
1151
|
-
* canonicalLogLines: {
|
|
1152
|
-
* enabled: true,
|
|
1153
|
-
* messageFormat: (span) => {
|
|
1154
|
-
* const status = span.status.code === 2 ? 'ERROR' : 'SUCCESS';
|
|
1155
|
-
* return `${span.name} [${status}]`;
|
|
1156
|
-
* },
|
|
1157
|
-
* },
|
|
1158
|
-
* });
|
|
1159
|
-
* ```
|
|
1160
|
-
*/
|
|
1161
|
-
canonicalLogLines?: {
|
|
1162
|
-
enabled: boolean;
|
|
1163
|
-
/** Logger to use for emitting canonical log lines (defaults to OTel Logs API) */
|
|
1164
|
-
logger?: Logger;
|
|
1165
|
-
/** Only emit canonical log lines for root spans (default: false) */
|
|
1166
|
-
rootSpansOnly?: boolean;
|
|
1167
|
-
/** Minimum log level for canonical log lines (default: 'info') */
|
|
1168
|
-
minLevel?: 'debug' | 'info' | 'warn' | 'error';
|
|
1169
|
-
/** Custom message format (default: uses span name) */
|
|
1170
|
-
messageFormat?: (span: import('@opentelemetry/sdk-trace-base').ReadableSpan) => string;
|
|
1171
|
-
/** Whether to include resource attributes (default: true) */
|
|
1172
|
-
includeResourceAttributes?: boolean;
|
|
1173
|
-
/** Predicate to decide whether to emit (runs after event is built). */
|
|
1174
|
-
shouldEmit?: CanonicalLogLineOptions['shouldEmit'];
|
|
1175
|
-
/**
|
|
1176
|
-
* Declarative tail sampling conditions (OR logic).
|
|
1177
|
-
* Ignored when `shouldEmit` is provided.
|
|
1178
|
-
* @example keep: [{ status: 500 }, { durationMs: 1000 }]
|
|
1179
|
-
*/
|
|
1180
|
-
keep?: CanonicalLogLineOptions['keep'];
|
|
1181
|
-
/** Callback invoked after emit for custom fan-out. */
|
|
1182
|
-
drain?: CanonicalLogLineOptions['drain'];
|
|
1183
|
-
/** Handler for drain failures. */
|
|
1184
|
-
onDrainError?: CanonicalLogLineOptions['onDrainError'];
|
|
1185
|
-
/**
|
|
1186
|
-
* Pretty-print canonical log lines to console.
|
|
1187
|
-
* Defaults to true when NODE_ENV is 'development'.
|
|
1188
|
-
*/
|
|
1189
|
-
pretty?: boolean;
|
|
1190
|
-
};
|
|
1193
|
+
/** Emit completed spans as canonical wide-event logs. */
|
|
1194
|
+
canonicalLogLines?: CanonicalLogLinesConfig;
|
|
1191
1195
|
/**
|
|
1192
1196
|
* Suppress console output while keeping OTel exporters running.
|
|
1193
1197
|
* Useful for platforms like GCP Cloud Run / AWS Lambda where stdout
|
package/dist/instrumentation.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_init = require('./init-CTtHITlX.cjs');
|
|
2
3
|
const require_node_require = require('./node-require-PFqDihze.cjs');
|
|
3
|
-
const require_init = require('./init-BnxHAi2M.cjs');
|
|
4
4
|
const require_tail_sampling_processor = require('./tail-sampling-processor.cjs');
|
|
5
5
|
let _opentelemetry_sdk_node = require("@opentelemetry/sdk-node");
|
|
6
6
|
let _opentelemetry_sdk_trace_base = require("@opentelemetry/sdk-trace-base");
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { n as getLogger } from "./init-WHYwyItd.js";
|
|
1
2
|
import { n as safeRequire, t as requireModule } from "./node-require-vROmTeJ8.js";
|
|
2
|
-
import { n as getLogger } from "./init-BxfZ3Vbw.js";
|
|
3
3
|
import { TailSamplingSpanProcessor } from "./tail-sampling-processor.js";
|
|
4
4
|
import { NodeSDK } from "@opentelemetry/sdk-node";
|
|
5
5
|
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-base";
|
package/dist/messaging.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_sampling = require('./sampling.cjs');
|
|
3
|
-
const require_functional = require('./functional-
|
|
3
|
+
const require_functional = require('./functional-C0uAZq2X.cjs');
|
|
4
4
|
const require_correlated_events = require('./correlated-events-kSwLo3mi.cjs');
|
|
5
5
|
const require_trace_factory_validation = require('./trace-factory-validation-Dc8epn87.cjs');
|
|
6
6
|
let _opentelemetry_api = require("@opentelemetry/api");
|
package/dist/messaging.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLinkFromHeaders, extractLinksFromBatch } from "./sampling.js";
|
|
2
|
-
import { c as withTracing } from "./functional-
|
|
2
|
+
import { c as withTracing } from "./functional-DX7Zvag0.js";
|
|
3
3
|
import { t as emitCorrelatedEvent } from "./correlated-events-Bzh5y-UB.js";
|
|
4
4
|
import { t as assertTraceFactory } from "./trace-factory-validation-BjVAinz6.js";
|
|
5
5
|
import { SpanKind, context, propagation } from "@opentelemetry/api";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_functional = require('./functional-
|
|
2
|
+
const require_functional = require('./functional-C0uAZq2X.cjs');
|
|
3
3
|
const require_trace_factory_validation = require('./trace-factory-validation-Dc8epn87.cjs');
|
|
4
4
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
5
5
|
|
package/dist/semantic-helpers.js
CHANGED
package/dist/webhook.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_structured_error = require('./structured-error-CHg7DoIQ.cjs');
|
|
3
|
-
const require_functional = require('./functional-
|
|
3
|
+
const require_functional = require('./functional-C0uAZq2X.cjs');
|
|
4
4
|
const require_correlated_events = require('./correlated-events-kSwLo3mi.cjs');
|
|
5
5
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
6
6
|
|
package/dist/webhook.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as recordStructuredError } from "./structured-error-9--cxBay.js";
|
|
2
|
-
import { c as withTracing } from "./functional-
|
|
2
|
+
import { c as withTracing } from "./functional-DX7Zvag0.js";
|
|
3
3
|
import { t as emitCorrelatedEvent } from "./correlated-events-Bzh5y-UB.js";
|
|
4
4
|
import { SpanKind, trace } from "@opentelemetry/api";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_functional = require('./functional-
|
|
2
|
+
const require_functional = require('./functional-C0uAZq2X.cjs');
|
|
3
3
|
const require_correlated_events = require('./correlated-events-kSwLo3mi.cjs');
|
|
4
4
|
const require_business_baggage = require('./business-baggage.cjs');
|
|
5
5
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as withTracing } from "./functional-
|
|
1
|
+
import { c as withTracing } from "./functional-DX7Zvag0.js";
|
|
2
2
|
import { t as emitCorrelatedEvent } from "./correlated-events-Bzh5y-UB.js";
|
|
3
3
|
import { createSafeBaggageSchema } from "./business-baggage.js";
|
|
4
4
|
import { SpanKind, context, propagation } from "@opentelemetry/api";
|
package/dist/workflow.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_rolldown_runtime = require('./rolldown-runtime-C_NdSu1c.cjs');
|
|
3
3
|
const require_trace_helpers = require('./trace-helpers.cjs');
|
|
4
|
-
const require_functional = require('./functional-
|
|
4
|
+
const require_functional = require('./functional-C0uAZq2X.cjs');
|
|
5
5
|
const require_correlated_events = require('./correlated-events-kSwLo3mi.cjs');
|
|
6
6
|
const require_trace_factory_validation = require('./trace-factory-validation-Dc8epn87.cjs');
|
|
7
7
|
let node_async_hooks = require("node:async_hooks");
|
package/dist/workflow.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getActiveSpan } from "./trace-helpers.js";
|
|
2
|
-
import { c as withTracing } from "./functional-
|
|
2
|
+
import { c as withTracing } from "./functional-DX7Zvag0.js";
|
|
3
3
|
import { t as emitCorrelatedEvent } from "./correlated-events-Bzh5y-UB.js";
|
|
4
4
|
import { t as assertTraceFactory } from "./trace-factory-validation-BjVAinz6.js";
|
|
5
5
|
import * as nodeAsyncHooks from "node:async_hooks";
|
package/dist/yaml-config.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as SamplingPreset } from "./sampling-BR9fkSwx.cjs";
|
|
2
|
-
import { a as AutotelConfig, o as OtlpSignal } from "./init-
|
|
2
|
+
import { a as AutotelConfig, o as OtlpSignal } from "./init-ncTMKZ-s.cjs";
|
|
3
3
|
//#region src/yaml-config.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* YAML config structure
|
package/dist/yaml-config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h as SamplingPreset } from "./sampling-CP3e7-Yr.js";
|
|
2
|
-
import { a as AutotelConfig, o as OtlpSignal } from "./init-
|
|
2
|
+
import { a as AutotelConfig, o as OtlpSignal } from "./init-pPI3JRRf.js";
|
|
3
3
|
//#region src/yaml-config.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* YAML config structure
|