autotel 7.10.1 → 8.1.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.
Files changed (126) hide show
  1. package/README.md +38 -32
  2. package/dist/{attribute-redacting-processor-rkV_WL-k.d.ts → attribute-redacting-processor-BrrdojmP.d.ts} +5 -1
  3. package/dist/{attribute-redacting-processor-CvBE0z1p.d.cts → attribute-redacting-processor-Cq7K8Okp.d.cts} +5 -1
  4. package/dist/attribute-redacting-processor.cjs +18 -8
  5. package/dist/attribute-redacting-processor.d.cts +1 -1
  6. package/dist/attribute-redacting-processor.d.ts +1 -1
  7. package/dist/attribute-redacting-processor.js +18 -8
  8. package/dist/{attributes-Ii3jDPsW.cjs → attributes-BqgJl9qA.cjs} +1 -1
  9. package/dist/{attributes-CuGx6cOI.js → attributes-BtwTkuX7.js} +1 -1
  10. package/dist/attributes.cjs +1 -1
  11. package/dist/attributes.js +1 -1
  12. package/dist/auto.cjs +1 -1
  13. package/dist/auto.js +1 -1
  14. package/dist/business-baggage.cjs +1 -1
  15. package/dist/business-baggage.js +1 -1
  16. package/dist/{canonical-log-line-processor-DDGzm-wi.d.ts → canonical-log-line-processor-BaFqHO5l.d.ts} +1 -2
  17. package/dist/{canonical-log-line-processor-DLeAQjgb.d.cts → canonical-log-line-processor-C-RdV5af.d.cts} +1 -2
  18. package/dist/{canonical-log-line-processor-BU03jJeA.cjs → canonical-log-line-processor-DScNq1g8.cjs} +1 -2
  19. package/dist/{canonical-log-line-processor-BQ6NeZAk.js → canonical-log-line-processor-naZRETyk.js} +1 -2
  20. package/dist/{channel-D0eaVqn3.cjs → channel-3MV-4Aqv.cjs} +1 -1
  21. package/dist/{channel-BobQKsZd.js → channel-BNFp4Sfq.js} +1 -1
  22. package/dist/config.d.cts +1 -1
  23. package/dist/config.d.ts +1 -1
  24. package/dist/{correlated-events-BfpH5uS-.js → correlated-events-CZFe6Z1P.js} +1 -1
  25. package/dist/{correlated-events-DE_4A3oD.cjs → correlated-events-wCrXVUby.cjs} +1 -1
  26. package/dist/correlation-id.cjs +1 -1
  27. package/dist/correlation-id.js +1 -1
  28. package/dist/db.cjs +1 -1
  29. package/dist/db.js +1 -1
  30. package/dist/decorators.cjs +2 -2
  31. package/dist/decorators.d.cts +1 -1
  32. package/dist/decorators.d.ts +1 -1
  33. package/dist/decorators.js +2 -2
  34. package/dist/diagnostics.cjs +3 -3
  35. package/dist/diagnostics.js +3 -3
  36. package/dist/event.cjs +1 -1
  37. package/dist/event.d.cts +1 -1
  38. package/dist/event.d.ts +1 -1
  39. package/dist/event.js +1 -1
  40. package/dist/exception-fingerprint.cjs +1 -1
  41. package/dist/exception-fingerprint.js +1 -1
  42. package/dist/{functional-C4gGiBou.js → functional-7uwlAIJd.js} +4 -4
  43. package/dist/{functional-j8Joyrwd.d.cts → functional-CN_cqIX8.d.cts} +9 -2
  44. package/dist/{functional-DptEM9La.cjs → functional-DCfOaKoM.cjs} +4 -4
  45. package/dist/{functional-CbcInXMJ.d.ts → functional-IGZ-Urlq.d.ts} +9 -2
  46. package/dist/functional.cjs +1 -1
  47. package/dist/functional.d.cts +1 -1
  48. package/dist/functional.d.ts +1 -1
  49. package/dist/functional.js +1 -1
  50. package/dist/http.cjs +2 -2
  51. package/dist/http.js +2 -2
  52. package/dist/index.cjs +9 -8
  53. package/dist/index.d.cts +31 -7
  54. package/dist/index.d.ts +31 -7
  55. package/dist/index.js +9 -9
  56. package/dist/{init-Biyby8Br.d.ts → init-BYq2sUXg.d.ts} +26 -31
  57. package/dist/{init-BvUtwZNx.js → init-D4TpmUIg.js} +142 -27
  58. package/dist/{init-Cx1-ejLn.cjs → init-DlJvp1WH.cjs} +147 -26
  59. package/dist/{init-CHanKvOq.d.cts → init-axM4kgR4.d.cts} +26 -31
  60. package/dist/instrumentation.cjs +2 -2
  61. package/dist/instrumentation.js +2 -2
  62. package/dist/{logger-B2VPcBgZ.js → logger-4VXLbqWx.js} +11 -19
  63. package/dist/{logger-DLjHQAus.cjs → logger-CWFxTLtR.cjs} +11 -19
  64. package/dist/{logger-C9UT1aZ_.d.cts → logger-b0qgWFy7.d.cts} +10 -18
  65. package/dist/{logger-C9UT1aZ_.d.ts → logger-b0qgWFy7.d.ts} +10 -18
  66. package/dist/logger.cjs +1 -1
  67. package/dist/logger.d.cts +1 -1
  68. package/dist/logger.d.ts +1 -1
  69. package/dist/logger.js +1 -1
  70. package/dist/messaging-adapters.cjs +1 -1
  71. package/dist/messaging-adapters.js +1 -1
  72. package/dist/messaging.cjs +4 -4
  73. package/dist/messaging.js +4 -4
  74. package/dist/metric.d.cts +1 -1
  75. package/dist/metric.d.ts +1 -1
  76. package/dist/{node-require-BPsB09eC.cjs → node-require-BotQNkYw.cjs} +1 -1
  77. package/dist/{node-require-CkK_xzL-.js → node-require-CY0YUdvZ.js} +1 -1
  78. package/dist/parse-error.cjs +1 -1
  79. package/dist/parse-error.js +1 -1
  80. package/dist/policy.cjs +0 -0
  81. package/dist/policy.js +0 -0
  82. package/dist/processors.cjs +1 -1
  83. package/dist/processors.d.cts +1 -1
  84. package/dist/processors.d.ts +1 -1
  85. package/dist/processors.js +1 -1
  86. package/dist/register.cjs +1 -0
  87. package/dist/register.js +1 -0
  88. package/dist/{sampling-Dud4XU2m.d.cts → sampling-CLJmXMw0.d.cts} +1 -1
  89. package/dist/{sampling-B_8orhSB.d.ts → sampling-DBlX8Nv5.d.ts} +1 -1
  90. package/dist/sampling.cjs +1 -1
  91. package/dist/sampling.d.cts +1 -1
  92. package/dist/sampling.d.ts +1 -1
  93. package/dist/sampling.js +1 -1
  94. package/dist/semantic-helpers.cjs +2 -2
  95. package/dist/semantic-helpers.js +2 -2
  96. package/dist/{stable-hash-sLi1o4jj.cjs → stable-hash-58iP5-N-.cjs} +1 -1
  97. package/dist/{stable-hash-AOUgw1DW.js → stable-hash-DVEU2MqW.js} +1 -1
  98. package/dist/{structured-error-DynjWTTu.cjs → structured-error-Ci8s_M6u.cjs} +6 -6
  99. package/dist/{structured-error-Y9y-1Pae.js → structured-error-UEtlg9Uu.js} +6 -6
  100. package/dist/tail-sampling-processor.cjs +1 -1
  101. package/dist/tail-sampling-processor.js +1 -1
  102. package/dist/test-span-collector.cjs +1 -1
  103. package/dist/test-span-collector.js +1 -1
  104. package/dist/testing.cjs +11 -1
  105. package/dist/testing.d.cts +1 -1
  106. package/dist/testing.d.ts +1 -1
  107. package/dist/testing.js +12 -2
  108. package/dist/trace-helpers.cjs +2 -2
  109. package/dist/trace-helpers.js +2 -2
  110. package/dist/tracer-provider.cjs +1 -1
  111. package/dist/tracer-provider.js +1 -1
  112. package/dist/validate.cjs +3 -3
  113. package/dist/validate.js +3 -3
  114. package/dist/{values-AxGpgYBA.cjs → values-9A6nOyZm.cjs} +69 -3
  115. package/dist/{values-xBtdXtjA.js → values-Dm0yEC5p.js} +58 -4
  116. package/dist/webhook.cjs +3 -3
  117. package/dist/webhook.js +3 -3
  118. package/dist/workflow-distributed.cjs +3 -3
  119. package/dist/workflow-distributed.js +3 -3
  120. package/dist/workflow.cjs +3 -3
  121. package/dist/workflow.js +3 -3
  122. package/dist/yaml-config.cjs +1 -1
  123. package/dist/yaml-config.d.cts +2 -2
  124. package/dist/yaml-config.d.ts +2 -2
  125. package/dist/yaml-config.js +1 -1
  126. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.cjs');
2
- const require_init = require('./init-Cx1-ejLn.cjs');
3
- const require_values = require('./values-AxGpgYBA.cjs');
2
+ const require_init = require('./init-DlJvp1WH.cjs');
3
+ const require_values = require('./values-9A6nOyZm.cjs');
4
4
  const require_tracer_provider = require('./tracer-provider.cjs');
5
5
  const require_config = require('./config.cjs');
6
- const require_structured_error = require('./structured-error-DynjWTTu.cjs');
6
+ const require_structured_error = require('./structured-error-Ci8s_M6u.cjs');
7
7
  const require_evidence = require('./evidence.cjs');
8
8
  const require_trace_helpers = require('./trace-helpers.cjs');
9
9
  let _opentelemetry_api = require("@opentelemetry/api");
@@ -737,7 +737,7 @@ const trace = Object.assign(traceImpl, { run });
737
737
  * ```
738
738
  */
739
739
  function withTracing(options = {}) {
740
- return (fnFactory) => wrapFactoryWithTracing(fnFactory, options);
740
+ return ((fnFactory) => wrapFactoryWithTracing(fnFactory, options));
741
741
  }
742
742
  function instrument(options) {
743
743
  if (!options || typeof options !== "object") throw new TypeError("instrument: expected { key, fn } or { functions: { name: fn } }");
@@ -1,5 +1,5 @@
1
1
  import { n as TraceContext } from "./trace-context-CqCblIQE.js";
2
- import { m as Sampler$1 } from "./sampling-B_8orhSB.js";
2
+ import { m as Sampler$1 } from "./sampling-DBlX8Nv5.js";
3
3
  import { Attributes, Span, SpanKind } from "@opentelemetry/api";
4
4
  //#region src/functional-wrapper.d.ts
5
5
  type WrappedFunction<TArgs extends unknown[], TReturn> = (...args: TArgs) => TReturn | Promise<TReturn>;
@@ -250,6 +250,13 @@ declare function run<TReturn>(options: TracingOptions<[], TReturn>, operation: (
250
250
  declare const trace$1: typeof traceImpl & {
251
251
  run: typeof run;
252
252
  };
253
+ /** `T` when it has no awaitable member; otherwise `never`, so the match fails. */
254
+ type NotThenable<T> = T extends PromiseLike<unknown> ? never : T;
255
+ interface TracingWrapper<TCfgArgs extends unknown[], TCfgReturn> {
256
+ <TArgs extends TCfgArgs, TReturn extends TCfgReturn>(fnFactory: (ctx: TraceContext) => (...args: TArgs) => PromiseLike<TReturn>): (...args: TArgs) => Promise<TReturn>;
257
+ <TArgs extends TCfgArgs, TReturn extends TCfgReturn>(fnFactory: (ctx: TraceContext) => (...args: TArgs) => NotThenable<TReturn>): (...args: TArgs) => TReturn;
258
+ <TArgs extends TCfgArgs, TReturn extends TCfgReturn>(fnFactory: (ctx: TraceContext) => (...args: TArgs) => TReturn | PromiseLike<TReturn>): WrappedFunction<TArgs, TReturn>;
259
+ }
253
260
  /**
254
261
  * Approach 2: withTracing() - Middleware-style composable wrapper
255
262
  *
@@ -283,7 +290,7 @@ declare const trace$1: typeof traceImpl & {
283
290
  * )(ctx => async (data) => { })
284
291
  * ```
285
292
  */
286
- declare function withTracing<TCfgArgs extends unknown[] = unknown[], TCfgReturn = unknown>(options?: TracingOptions<TCfgArgs, TCfgReturn>): <TArgs extends TCfgArgs, TReturn extends TCfgReturn>(fnFactory: (ctx: TraceContext) => (...args: TArgs) => TReturn | PromiseLike<TReturn>) => WrappedFunction<TArgs, TReturn>;
293
+ declare function withTracing<TCfgArgs extends unknown[] = unknown[], TCfgReturn = unknown>(options?: TracingOptions<TCfgArgs, TCfgReturn>): TracingWrapper<TCfgArgs, TCfgReturn>;
287
294
  /**
288
295
  * Approach 3: instrument() - Batch auto-instrumentation
289
296
  *
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_functional = require('./functional-DptEM9La.cjs');
2
+ const require_functional = require('./functional-DCfOaKoM.cjs');
3
3
 
4
4
  exports.ctx = require_functional.ctx;
5
5
  exports.getActiveTraceContext = require_functional.getActiveTraceContext;
@@ -1,3 +1,3 @@
1
1
  import { n as TraceContext } from "./trace-context-f7Xq0Q2q.cjs";
2
- import { a as getActiveTraceContext, c as span, d as withNewContext, f as withTracing, h as TracingOptions, i as ctx, l as trace, m as SingleInstrumentOptions, n as WithBaggageOptions, o as instrument, p as InstrumentOptions, r as WithNewContextOptions, s as requestCtx, t as SpanOptions, u as withBaggage } from "./functional-j8Joyrwd.cjs";
2
+ import { a as getActiveTraceContext, c as span, d as withNewContext, f as withTracing, h as TracingOptions, i as ctx, l as trace, m as SingleInstrumentOptions, n as WithBaggageOptions, o as instrument, p as InstrumentOptions, r as WithNewContextOptions, s as requestCtx, t as SpanOptions, u as withBaggage } from "./functional-CN_cqIX8.cjs";
3
3
  export { type InstrumentOptions, type SingleInstrumentOptions, SpanOptions, type TraceContext, type TracingOptions, WithBaggageOptions, WithNewContextOptions, ctx, getActiveTraceContext, instrument, requestCtx, span, trace, withBaggage, withNewContext, withTracing };
@@ -1,3 +1,3 @@
1
1
  import { n as TraceContext } from "./trace-context-CqCblIQE.js";
2
- import { a as getActiveTraceContext, c as span, d as withNewContext, f as withTracing, h as TracingOptions, i as ctx, l as trace, m as SingleInstrumentOptions, n as WithBaggageOptions, o as instrument, p as InstrumentOptions, r as WithNewContextOptions, s as requestCtx, t as SpanOptions, u as withBaggage } from "./functional-CbcInXMJ.js";
2
+ import { a as getActiveTraceContext, c as span, d as withNewContext, f as withTracing, h as TracingOptions, i as ctx, l as trace, m as SingleInstrumentOptions, n as WithBaggageOptions, o as instrument, p as InstrumentOptions, r as WithNewContextOptions, s as requestCtx, t as SpanOptions, u as withBaggage } from "./functional-IGZ-Urlq.js";
3
3
  export { type InstrumentOptions, type SingleInstrumentOptions, SpanOptions, type TraceContext, type TracingOptions, WithBaggageOptions, WithNewContextOptions, ctx, getActiveTraceContext, instrument, requestCtx, span, trace, withBaggage, withNewContext, withTracing };
@@ -1,3 +1,3 @@
1
- import { a as span, c as withNewContext, i as requestCtx, l as withTracing, n as getActiveTraceContext, o as trace, r as instrument, s as withBaggage, t as ctx } from "./functional-C4gGiBou.js";
1
+ import { a as span, c as withNewContext, i as requestCtx, l as withTracing, n as getActiveTraceContext, o as trace, r as instrument, s as withBaggage, t as ctx } from "./functional-7uwlAIJd.js";
2
2
 
3
3
  export { ctx, getActiveTraceContext, instrument, requestCtx, span, trace, withBaggage, withNewContext, withTracing };
package/dist/http.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_init = require('./init-Cx1-ejLn.cjs');
3
- const require_values = require('./values-AxGpgYBA.cjs');
2
+ const require_init = require('./init-DlJvp1WH.cjs');
3
+ const require_values = require('./values-9A6nOyZm.cjs');
4
4
  const require_config = require('./config.cjs');
5
5
  let _opentelemetry_api = require("@opentelemetry/api");
6
6
 
package/dist/http.js CHANGED
@@ -1,5 +1,5 @@
1
- import { J as getActiveContextWithBaggage } from "./init-BvUtwZNx.js";
2
- import { _ as readProperty, h as isFunction, i as asNumber, l as asString } from "./values-xBtdXtjA.js";
1
+ import { Y as getActiveContextWithBaggage } from "./init-D4TpmUIg.js";
2
+ import { g as isFunction, i as asNumber, l as asString, v as readProperty } from "./values-Dm0yEC5p.js";
3
3
  import { getConfig } from "./config.js";
4
4
  import { SpanStatusCode, context, propagation } from "@opentelemetry/api";
5
5
 
package/dist/index.cjs CHANGED
@@ -1,25 +1,25 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.cjs');
3
- const require_init = require('./init-Cx1-ejLn.cjs');
4
- const require_values = require('./values-AxGpgYBA.cjs');
3
+ const require_init = require('./init-DlJvp1WH.cjs');
4
+ const require_values = require('./values-9A6nOyZm.cjs');
5
5
  const require_tracer_provider = require('./tracer-provider.cjs');
6
- const require_structured_error = require('./structured-error-DynjWTTu.cjs');
6
+ const require_structured_error = require('./structured-error-Ci8s_M6u.cjs');
7
7
  const require_filtering_span_processor = require('./filtering-span-processor.cjs');
8
8
  const require_span_name_normalizer = require('./span-name-normalizer.cjs');
9
9
  const require_attribute_redacting_processor = require('./attribute-redacting-processor.cjs');
10
- const require_canonical_log_line_processor = require('./canonical-log-line-processor-BU03jJeA.cjs');
10
+ const require_canonical_log_line_processor = require('./canonical-log-line-processor-DScNq1g8.cjs');
11
11
  const require_metric = require('./metric.cjs');
12
- const require_functional = require('./functional-DptEM9La.cjs');
12
+ const require_functional = require('./functional-DCfOaKoM.cjs');
13
13
  const require_trace_helpers = require('./trace-helpers.cjs');
14
- const require_stable_hash = require('./stable-hash-sLi1o4jj.cjs');
15
- const require_correlated_events = require('./correlated-events-DE_4A3oD.cjs');
14
+ const require_stable_hash = require('./stable-hash-58iP5-N-.cjs');
15
+ const require_correlated_events = require('./correlated-events-wCrXVUby.cjs');
16
16
  const require_parse_error = require('./parse-error.cjs');
17
17
  const require_drain_pipeline = require('./drain-pipeline.cjs');
18
18
  const require_metric_helpers = require('./metric-helpers.cjs');
19
19
  const require_semantic_helpers = require('./semantic-helpers.cjs');
20
20
  const require_registry = require('./registry-B3ZJmUtU.cjs');
21
21
  const require_semantic_conventions = require('./semantic-conventions.cjs');
22
- const require_attributes = require('./attributes-Ii3jDPsW.cjs');
22
+ const require_attributes = require('./attributes-BqgJl9qA.cjs');
23
23
  const require_messaging = require('./messaging.cjs');
24
24
  const require_business_baggage = require('./business-baggage.cjs');
25
25
  const require_workflow = require('./workflow.cjs');
@@ -560,6 +560,7 @@ exports.AttributeRedactingProcessor = require_attribute_redacting_processor.Attr
560
560
  exports.BaggageSpanProcessor = require_init.BaggageSpanProcessor;
561
561
  exports.BusinessBaggage = require_business_baggage.BusinessBaggage;
562
562
  exports.CORRELATION_ID_BAGGAGE_KEY = require_init.CORRELATION_ID_BAGGAGE_KEY;
563
+ exports.EnrichedSpanProcessor = require_init.EnrichedSpanProcessor;
563
564
  exports.Event = require_init.Event;
564
565
  exports.FilteringSpanProcessor = require_filtering_span_processor.FilteringSpanProcessor;
565
566
  exports.HTTPAttributes = require_registry.HTTPAttributes;
package/dist/index.d.cts CHANGED
@@ -1,18 +1,18 @@
1
- import { a as AttributeRedactorPreset, c as REDACTOR_PATTERNS, d as builtinPatterns, f as createAttributeRedactor, i as AttributeRedactorFn, l as REDACTOR_PRESETS, m as normalizeAttributeRedactorConfig, n as AttributeRedactingProcessorOptions, o as BuiltinPatternName, p as createRedactedSpan, r as AttributeRedactorConfig, s as MaskFn, t as AttributeRedactingProcessor, u as ValuePatternConfig } from "./attribute-redacting-processor-CvBE0z1p.cjs";
1
+ import { a as AttributeRedactorPreset, c as REDACTOR_PATTERNS, d as builtinPatterns, f as createAttributeRedactor, i as AttributeRedactorFn, l as REDACTOR_PRESETS, m as normalizeAttributeRedactorConfig, n as AttributeRedactingProcessorOptions, o as BuiltinPatternName, p as createRedactedSpan, r as AttributeRedactorConfig, s as MaskFn, t as AttributeRedactingProcessor, u as ValuePatternConfig } from "./attribute-redacting-processor-Cq7K8Okp.cjs";
2
2
  import { A as ExceptionAttrs, B as PeerAttrs, C as CloudAttrs, D as DeploymentAttrs, E as DBAttrs, F as HTTPServerAttrs, G as SessionAttrs, H as RPCAttrs, I as K8sAttrs, J as URLAttrs, K as TLSAttrs, L as MessagingAttrs, M as FeatureFlagAttrs, N as GraphQLAttrs, O as DeviceAttrs, P as HTTPClientAttrs, R as NetworkAttrs, S as ClientAttrs, T as ContainerAttrs, U as ServerAddressAttrs, V as ProcessAttrs, W as ServiceAttrs, Y as UserAttrs, _ as autoRedactPII, a as httpClient, b as validateAttribute, c as mergeServiceResource, d as setError, f as setException, g as AttributePolicy, h as AttributeGuardrails, i as dbClient, j as FaaSAttrs, k as ErrorAttrs, l as request, m as setUser, n as safeSetAttributes, o as httpServer, p as setSession, q as ThreadAttrs, s as identify, t as mergeAttrs, u as setDevice, w as CodeAttrs, x as attrs, z as OTelAttrs } from "./index-DVPsz3DK.cjs";
3
3
  import { t as UnknownRecord } from "./values-CeMH-mYG.cjs";
4
4
  import { n as TraceContext$1, r as defineBaggageSchema, t as AttributeValue$2 } from "./trace-context-f7Xq0Q2q.cjs";
5
5
  import { BaggageError, BaggageFieldDefinition, BaggageFieldType, BusinessBaggage, BusinessBaggageValues, SafeBaggageOptions, SafeBaggageSchema, createSafeBaggageSchema } from "./business-baggage.cjs";
6
6
  import { CORRELATION_ID_BAGGAGE_KEY, generateCorrelationId, getCorrelationId, getOrCreateCorrelationId, runWithCorrelationId, setCorrelationId, setCorrelationIdInBaggage } from "./correlation-id.cjs";
7
- import { T as samplingPresets, _ as UserIdSampler, a as AdaptiveSampler, b as extractLinksFromBatch, d as NeverSampler, g as SamplingPreset, h as SamplingContext, i as AUTOTEL_SAMPLING_TAIL_KEEP, m as Sampler, o as AlwaysSampler, p as RandomSampler, r as AUTOTEL_SAMPLING_TAIL_EVALUATED, t as AUTOTEL_DEBUG_BAGGAGE_KEY, v as createLinkFromHeaders, w as resolveSamplingPreset } from "./sampling-Dud4XU2m.cjs";
8
- import { a as getActiveTraceContext, c as span, d as withNewContext, f as withTracing, i as ctx, l as trace$2, m as SingleInstrumentOptions, n as WithBaggageOptions, o as instrument, p as InstrumentOptions, r as WithNewContextOptions, s as requestCtx, t as SpanOptions, u as withBaggage } from "./functional-j8Joyrwd.cjs";
7
+ import { T as samplingPresets, _ as UserIdSampler, a as AdaptiveSampler, b as extractLinksFromBatch, d as NeverSampler, g as SamplingPreset, h as SamplingContext, i as AUTOTEL_SAMPLING_TAIL_KEEP, m as Sampler, o as AlwaysSampler, p as RandomSampler, r as AUTOTEL_SAMPLING_TAIL_EVALUATED, t as AUTOTEL_DEBUG_BAGGAGE_KEY, v as createLinkFromHeaders, w as resolveSamplingPreset } from "./sampling-CLJmXMw0.cjs";
8
+ import { a as getActiveTraceContext, c as span, d as withNewContext, f as withTracing, i as ctx, l as trace$2, m as SingleInstrumentOptions, n as WithBaggageOptions, o as instrument, p as InstrumentOptions, r as WithNewContextOptions, s as requestCtx, t as SpanOptions, u as withBaggage } from "./functional-CN_cqIX8.cjs";
9
9
  import { DrainPipelineOptions, PipelineDrainFn, createDrainPipeline } from "./drain-pipeline.cjs";
10
10
  import { a as EventSchemaMetadata, c as FunnelStatus, l as OutcomeStatus, n as EventAttributeValue, o as EventSubscriber, r as EventAttributes, s as EventTrackingOptions, t as AutotelEventContext } from "./event-subscriber-DMACQA-1.cjs";
11
11
  import { Event, EventsOptions, getEvents, resetEvents } from "./event.cjs";
12
12
  import { n as FilteringSpanProcessorOptions, r as SpanFilterPredicate, t as FilteringSpanProcessor } from "./filtering-span-processor-BYvLMiNz.cjs";
13
- 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-CHanKvOq.cjs";
13
+ 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-axM4kgR4.cjs";
14
14
  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";
15
- import "./canonical-log-line-processor-DLeAQjgb.cjs";
15
+ import "./canonical-log-line-processor-C-RdV5af.cjs";
16
16
  import { i as defineEvent, n as DefinedEvent, r as SchemaLike, t as DefineEventOptions } from "./define-event-BNeuKUPv.cjs";
17
17
  import { ParsedError, parseError } from "./parse-error.cjs";
18
18
  import { Metric, MetricsOptions, getMetrics, resetMetrics } from "./metric.cjs";
@@ -23,7 +23,7 @@ import { DBConfig, HTTPConfig, MessagingConfig, traceDB, traceHTTP, traceMessagi
23
23
  import { a as URLAttributes, i as ServiceAttributes, n as httpResponseHeaderAttribute, r as HTTPAttributes, t as httpRequestHeaderAttribute } from "./semantic-conventions-yG0X2AsN.cjs";
24
24
  import { ConsumerConfig, ConsumerContext, LagMetricsConfig, MessagingOperation, MessagingSystem, ProducerConfig, ProducerContext, traceConsumer, traceProducer } from "./messaging.cjs";
25
25
  import { StepConfig, StepContext, StepStatus, WorkflowConfig, WorkflowContext, WorkflowStatus, getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from "./workflow.cjs";
26
- import { ReadableSpan, SpanProcessor } from "@opentelemetry/sdk-trace-base";
26
+ import { ReadableSpan, Span as Span$1, SpanProcessor } from "@opentelemetry/sdk-trace-base";
27
27
  import { AttributeValue, Attributes, Baggage, BaggageEntry, Context, Context as Context$1, Exception, HrTime, Link, Link as SpanLink, ROOT_CONTEXT, Span, Span as Span$2, SpanAttributes, SpanContext, SpanKind, SpanStatusCode, TextMapGetter, TextMapSetter, TimeInput, TraceFlags, TraceState, Tracer, TracerProvider, context, propagation, trace as otelTrace, trace as trace$1 } from "@opentelemetry/api";
28
28
  //#region src/baggage-span-processor.d.ts
29
29
  interface BaggageSpanProcessorOptions {
@@ -73,6 +73,29 @@ export declare class BaggageSpanProcessor implements SpanProcessor {
73
73
  forceFlush(): Promise<void>;
74
74
  }
75
75
  //#endregion
76
+ //#region src/enriched-span-processor.d.ts
77
+ /**
78
+ * `spanEnrichers` in front of the processors that export, as one processor.
79
+ *
80
+ * Spans reach the enrichers first, as they would in a flat list. The
81
+ * difference is flush and shutdown: the SDK runs those on every processor at
82
+ * once, so an enricher that ends a span of its own while it drains (an async
83
+ * judgment, say) would hand it to an exporter that had already closed. Here the
84
+ * enrichers drain first and the exporters flush after them.
85
+ */
86
+ export declare class EnrichedSpanProcessor implements SpanProcessor {
87
+ private readonly enrichers;
88
+ private readonly downstream;
89
+ /** Every processor in call order: the enrichers, then the rest. */
90
+ readonly processors: readonly SpanProcessor[];
91
+ constructor(enrichers: readonly SpanProcessor[], downstream: readonly SpanProcessor[]);
92
+ onStart(span: Span$1, parentContext: Context$1): void;
93
+ onEnd(span: ReadableSpan): void;
94
+ forceFlush(): Promise<void>;
95
+ shutdown(): Promise<void>;
96
+ private drainThenRun;
97
+ }
98
+ //#endregion
76
99
  //#region src/force-keep.d.ts
77
100
  /**
78
101
  * Keep this trace whatever the sampler decides.
@@ -595,7 +618,8 @@ export declare function defineAuditCatalog<const T extends Record<string, AuditC
595
618
  * Convert a value that arrived from outside to an OTel-compatible
596
619
  * AttributeValue. Returns undefined when the value cannot be represented -
597
620
  * which is how flattenToAttributes below learns it has an object to descend
598
- * into rather than a leaf to record.
621
+ * into rather than a leaf to record. An Error is one of those: it flattens to
622
+ * its name, message, stack, cause and fields, not its message alone.
599
623
  *
600
624
  * Total by construction: this runs on whatever an application hands an
601
625
  * attribute setter, so a value that cannot be read is a marker in the
package/dist/index.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- import { a as AttributeRedactorPreset, c as REDACTOR_PATTERNS, d as builtinPatterns, f as createAttributeRedactor, i as AttributeRedactorFn, l as REDACTOR_PRESETS, m as normalizeAttributeRedactorConfig, n as AttributeRedactingProcessorOptions, o as BuiltinPatternName, p as createRedactedSpan, r as AttributeRedactorConfig, s as MaskFn, t as AttributeRedactingProcessor, u as ValuePatternConfig } from "./attribute-redacting-processor-rkV_WL-k.js";
1
+ import { a as AttributeRedactorPreset, c as REDACTOR_PATTERNS, d as builtinPatterns, f as createAttributeRedactor, i as AttributeRedactorFn, l as REDACTOR_PRESETS, m as normalizeAttributeRedactorConfig, n as AttributeRedactingProcessorOptions, o as BuiltinPatternName, p as createRedactedSpan, r as AttributeRedactorConfig, s as MaskFn, t as AttributeRedactingProcessor, u as ValuePatternConfig } from "./attribute-redacting-processor-BrrdojmP.js";
2
2
  import { A as ExceptionAttrs, B as PeerAttrs, C as CloudAttrs, D as DeploymentAttrs, E as DBAttrs, F as HTTPServerAttrs, G as SessionAttrs, H as RPCAttrs, I as K8sAttrs, J as URLAttrs, K as TLSAttrs, L as MessagingAttrs, M as FeatureFlagAttrs, N as GraphQLAttrs, O as DeviceAttrs, P as HTTPClientAttrs, R as NetworkAttrs, S as ClientAttrs, T as ContainerAttrs, U as ServerAddressAttrs, V as ProcessAttrs, W as ServiceAttrs, Y as UserAttrs, _ as autoRedactPII, a as httpClient, b as validateAttribute, c as mergeServiceResource, d as setError, f as setException, g as AttributePolicy, h as AttributeGuardrails, i as dbClient, j as FaaSAttrs, k as ErrorAttrs, l as request, m as setUser, n as safeSetAttributes, o as httpServer, p as setSession, q as ThreadAttrs, s as identify, t as mergeAttrs, u as setDevice, w as CodeAttrs, x as attrs, z as OTelAttrs } from "./index-DAH41w0W.js";
3
3
  import { t as UnknownRecord } from "./values-CeMH-mYG.js";
4
4
  import { n as TraceContext$1, r as defineBaggageSchema, t as AttributeValue$2 } from "./trace-context-CqCblIQE.js";
5
5
  import { BaggageError, BaggageFieldDefinition, BaggageFieldType, BusinessBaggage, BusinessBaggageValues, SafeBaggageOptions, SafeBaggageSchema, createSafeBaggageSchema } from "./business-baggage.js";
6
6
  import { CORRELATION_ID_BAGGAGE_KEY, generateCorrelationId, getCorrelationId, getOrCreateCorrelationId, runWithCorrelationId, setCorrelationId, setCorrelationIdInBaggage } from "./correlation-id.js";
7
- import { T as samplingPresets, _ as UserIdSampler, a as AdaptiveSampler, b as extractLinksFromBatch, d as NeverSampler, g as SamplingPreset, h as SamplingContext, i as AUTOTEL_SAMPLING_TAIL_KEEP, m as Sampler, o as AlwaysSampler, p as RandomSampler, r as AUTOTEL_SAMPLING_TAIL_EVALUATED, t as AUTOTEL_DEBUG_BAGGAGE_KEY, v as createLinkFromHeaders, w as resolveSamplingPreset } from "./sampling-B_8orhSB.js";
8
- import { a as getActiveTraceContext, c as span, d as withNewContext, f as withTracing, i as ctx, l as trace$2, m as SingleInstrumentOptions, n as WithBaggageOptions, o as instrument, p as InstrumentOptions, r as WithNewContextOptions, s as requestCtx, t as SpanOptions, u as withBaggage } from "./functional-CbcInXMJ.js";
7
+ import { T as samplingPresets, _ as UserIdSampler, a as AdaptiveSampler, b as extractLinksFromBatch, d as NeverSampler, g as SamplingPreset, h as SamplingContext, i as AUTOTEL_SAMPLING_TAIL_KEEP, m as Sampler, o as AlwaysSampler, p as RandomSampler, r as AUTOTEL_SAMPLING_TAIL_EVALUATED, t as AUTOTEL_DEBUG_BAGGAGE_KEY, v as createLinkFromHeaders, w as resolveSamplingPreset } from "./sampling-DBlX8Nv5.js";
8
+ import { a as getActiveTraceContext, c as span, d as withNewContext, f as withTracing, i as ctx, l as trace$2, m as SingleInstrumentOptions, n as WithBaggageOptions, o as instrument, p as InstrumentOptions, r as WithNewContextOptions, s as requestCtx, t as SpanOptions, u as withBaggage } from "./functional-IGZ-Urlq.js";
9
9
  import { DrainPipelineOptions, PipelineDrainFn, createDrainPipeline } from "./drain-pipeline.js";
10
10
  import { a as EventSchemaMetadata, c as FunnelStatus, l as OutcomeStatus, n as EventAttributeValue, o as EventSubscriber, r as EventAttributes, s as EventTrackingOptions, t as AutotelEventContext } from "./event-subscriber-DMACQA-1.js";
11
11
  import { Event, EventsOptions, getEvents, resetEvents } from "./event.js";
12
12
  import { n as FilteringSpanProcessorOptions, r as SpanFilterPredicate, t as FilteringSpanProcessor } from "./filtering-span-processor-BDGe1myy.js";
13
- 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-Biyby8Br.js";
13
+ 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-BYq2sUXg.js";
14
14
  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-DHcg1bSP.js";
15
- import "./canonical-log-line-processor-DDGzm-wi.js";
15
+ import "./canonical-log-line-processor-BaFqHO5l.js";
16
16
  import { i as defineEvent, n as DefinedEvent, r as SchemaLike, t as DefineEventOptions } from "./define-event-Bd8f8mST.js";
17
17
  import { ParsedError, parseError } from "./parse-error.js";
18
18
  import { Metric, MetricsOptions, getMetrics, resetMetrics } from "./metric.js";
@@ -24,7 +24,7 @@ import { a as URLAttributes, i as ServiceAttributes, n as httpResponseHeaderAttr
24
24
  import { ConsumerConfig, ConsumerContext, LagMetricsConfig, MessagingOperation, MessagingSystem, ProducerConfig, ProducerContext, traceConsumer, traceProducer } from "./messaging.js";
25
25
  import { StepConfig, StepContext, StepStatus, WorkflowConfig, WorkflowContext, WorkflowStatus, getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from "./workflow.js";
26
26
  import { AttributeValue, Attributes, Baggage, BaggageEntry, Context, Context as Context$1, Exception, HrTime, Link, Link as SpanLink, ROOT_CONTEXT, Span, Span as Span$1, SpanAttributes, SpanContext, SpanKind, SpanStatusCode, TextMapGetter, TextMapSetter, TimeInput, TraceFlags, TraceState, Tracer, TracerProvider, context, propagation, trace as otelTrace, trace as trace$1 } from "@opentelemetry/api";
27
- import { ReadableSpan, SpanProcessor } from "@opentelemetry/sdk-trace-base";
27
+ import { ReadableSpan, Span as Span$2, SpanProcessor } from "@opentelemetry/sdk-trace-base";
28
28
  //#region src/baggage-span-processor.d.ts
29
29
  interface BaggageSpanProcessorOptions {
30
30
  /**
@@ -73,6 +73,29 @@ export declare class BaggageSpanProcessor implements SpanProcessor {
73
73
  forceFlush(): Promise<void>;
74
74
  }
75
75
  //#endregion
76
+ //#region src/enriched-span-processor.d.ts
77
+ /**
78
+ * `spanEnrichers` in front of the processors that export, as one processor.
79
+ *
80
+ * Spans reach the enrichers first, as they would in a flat list. The
81
+ * difference is flush and shutdown: the SDK runs those on every processor at
82
+ * once, so an enricher that ends a span of its own while it drains (an async
83
+ * judgment, say) would hand it to an exporter that had already closed. Here the
84
+ * enrichers drain first and the exporters flush after them.
85
+ */
86
+ export declare class EnrichedSpanProcessor implements SpanProcessor {
87
+ private readonly enrichers;
88
+ private readonly downstream;
89
+ /** Every processor in call order: the enrichers, then the rest. */
90
+ readonly processors: readonly SpanProcessor[];
91
+ constructor(enrichers: readonly SpanProcessor[], downstream: readonly SpanProcessor[]);
92
+ onStart(span: Span$2, parentContext: Context$1): void;
93
+ onEnd(span: ReadableSpan): void;
94
+ forceFlush(): Promise<void>;
95
+ shutdown(): Promise<void>;
96
+ private drainThenRun;
97
+ }
98
+ //#endregion
76
99
  //#region src/force-keep.d.ts
77
100
  /**
78
101
  * Keep this trace whatever the sampler decides.
@@ -595,7 +618,8 @@ export declare function defineAuditCatalog<const T extends Record<string, AuditC
595
618
  * Convert a value that arrived from outside to an OTel-compatible
596
619
  * AttributeValue. Returns undefined when the value cannot be represented -
597
620
  * which is how flattenToAttributes below learns it has an object to descend
598
- * into rather than a leaf to record.
621
+ * into rather than a leaf to record. An Error is one of those: it flattens to
622
+ * its name, message, stack, cause and fields, not its message alone.
599
623
  *
600
624
  * Total by construction: this runs on whatever an application hands an
601
625
  * attribute setter, so a value that cannot be read is a marker in the
package/dist/index.js CHANGED
@@ -1,23 +1,23 @@
1
- import { $ as generateCorrelationId, D as AUTOTEL_SAMPLING_TAIL_KEEP, E as AUTOTEL_SAMPLING_TAIL_EVALUATED, F as RandomSampler, G as createTraceContext, H as markForceKept, I as UserIdSampler, K as defineBaggageSchema, L as createLinkFromHeaders, O as AdaptiveSampler, P as NeverSampler, Q as CORRELATION_ID_BAGGAGE_KEY, S as BaggageSpanProcessor, U as resolveSamplingPreset, W as samplingPresets, X as getEventQueue, Z as track, a as init, at as setCorrelationIdInBaggage, c as lockLogger, d as Event, et as getCorrelationId, f as getEvents, h as runInOperationContext, it as setCorrelationId, k as AlwaysSampler, l as flush, m as getOperationContext, nt as getOrCreateCorrelationId, o as isInitialized, p as resetEvents, rt as runWithCorrelationId, s as isLoggerLocked, u as shutdown, w as AUTOTEL_DEBUG_BAGGAGE_KEY, y as createStringRedactor, z as extractLinksFromBatch } from "./init-BvUtwZNx.js";
2
- import { g as nonEmptyString, i as asNumber, l as asString, r as asFunction, s as asRecord, x as toError } from "./values-xBtdXtjA.js";
1
+ import { $ as CORRELATION_ID_BAGGAGE_KEY, A as AlwaysSampler, B as extractLinksFromBatch, C as BaggageSpanProcessor, D as AUTOTEL_SAMPLING_TAIL_EVALUATED, F as NeverSampler, G as samplingPresets, I as RandomSampler, K as createTraceContext, L as UserIdSampler, O as AUTOTEL_SAMPLING_TAIL_KEEP, Q as track, R as createLinkFromHeaders, T as AUTOTEL_DEBUG_BAGGAGE_KEY, U as markForceKept, W as resolveSamplingPreset, Z as getEventQueue, a as init, at as setCorrelationId, b as EnrichedSpanProcessor, c as lockLogger, d as Event, et as generateCorrelationId, f as getEvents, h as runInOperationContext, it as runWithCorrelationId, k as AdaptiveSampler, l as flush, m as getOperationContext, o as isInitialized, ot as setCorrelationIdInBaggage, p as resetEvents, q as defineBaggageSchema, rt as getOrCreateCorrelationId, s as isLoggerLocked, tt as getCorrelationId, u as shutdown, y as createStringRedactor } from "./init-D4TpmUIg.js";
2
+ import { C as toError, _ as nonEmptyString, i as asNumber, l as asString, r as asFunction, s as asRecord } from "./values-Dm0yEC5p.js";
3
3
  import { getAutotelTracer, getAutotelTracerProvider, hasTracerProvider, setAutotelTracerProvider } from "./tracer-provider.js";
4
- import { a as flattenToAttributes, i as structuredErrorToJSON, n as getStructuredErrorAttributes, o as toAttributeValue, r as recordStructuredError, t as createStructuredError } from "./structured-error-Y9y-1Pae.js";
4
+ import { a as flattenToAttributes, i as structuredErrorToJSON, n as getStructuredErrorAttributes, o as toAttributeValue, r as recordStructuredError, t as createStructuredError } from "./structured-error-UEtlg9Uu.js";
5
5
  import { FilteringSpanProcessor } from "./filtering-span-processor.js";
6
6
  import { NORMALIZER_PATTERNS, NORMALIZER_PRESETS, SpanNameNormalizingProcessor } from "./span-name-normalizer.js";
7
7
  import { AttributeRedactingProcessor, REDACTOR_PATTERNS, REDACTOR_PRESETS, builtinPatterns, createAttributeRedactor, createRedactedSpan, normalizeAttributeRedactorConfig } from "./attribute-redacting-processor.js";
8
- import { n as formatDuration } from "./canonical-log-line-processor-BQ6NeZAk.js";
8
+ import { n as formatDuration } from "./canonical-log-line-processor-naZRETyk.js";
9
9
  import { Metric, getMetrics, resetMetrics } from "./metric.js";
10
- import { a as span, c as withNewContext, i as requestCtx, l as withTracing, n as getActiveTraceContext, o as trace$2, r as instrument, s as withBaggage, t as ctx } from "./functional-C4gGiBou.js";
10
+ import { a as span, c as withNewContext, i as requestCtx, l as withTracing, n as getActiveTraceContext, o as trace$2, r as instrument, s as withBaggage, t as ctx } from "./functional-7uwlAIJd.js";
11
11
  import { createDeterministicTraceId, enrichWithTraceContext, finalizeSpan, flattenMetadata, getActiveContext, getActiveSpan, getTraceContext, getTracer, isTracing, resolveTraceUrl, runWithSpan } from "./trace-helpers.js";
12
- import { t as hashJson } from "./stable-hash-AOUgw1DW.js";
13
- import { t as emitCorrelatedEvent } from "./correlated-events-BfpH5uS-.js";
12
+ import { t as hashJson } from "./stable-hash-DVEU2MqW.js";
13
+ import { t as emitCorrelatedEvent } from "./correlated-events-CZFe6Z1P.js";
14
14
  import { parseError } from "./parse-error.js";
15
15
  import { createDrainPipeline } from "./drain-pipeline.js";
16
16
  import { createCounter, createHistogram, createObservableGauge, createUpDownCounter, getMeter } from "./metric-helpers.js";
17
17
  import { traceDB, traceHTTP, traceMessaging } from "./semantic-helpers.js";
18
18
  import { C as URLAttributes, d as HTTPAttributes, y as ServiceAttributes } from "./registry-Cy4JjIB-.js";
19
19
  import { httpRequestHeaderAttribute, httpResponseHeaderAttribute } from "./semantic-conventions.js";
20
- import { a as identify, c as setDevice, d as setSession, f as setUser, h as autoRedactPII, i as httpServer, l as setError, m as safeSetAttributes, n as dbClient, o as mergeServiceResource, p as mergeAttrs, r as httpClient, s as request, u as setException, v as validateAttribute, y as attrs } from "./attributes-CuGx6cOI.js";
20
+ import { a as identify, c as setDevice, d as setSession, f as setUser, h as autoRedactPII, i as httpServer, l as setError, m as safeSetAttributes, n as dbClient, o as mergeServiceResource, p as mergeAttrs, r as httpClient, s as request, u as setException, v as validateAttribute, y as attrs } from "./attributes-BtwTkuX7.js";
21
21
  import { traceConsumer, traceProducer } from "./messaging.js";
22
22
  import { BusinessBaggage, createSafeBaggageSchema } from "./business-baggage.js";
23
23
  import { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } from "./workflow.js";
@@ -548,4 +548,4 @@ function defineEnricher(def, options = {}) {
548
548
  }
549
549
 
550
550
  //#endregion
551
- export { AUTOTEL_DEBUG_BAGGAGE_KEY, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, AttributeRedactingProcessor, BaggageSpanProcessor, BusinessBaggage, CORRELATION_ID_BAGGAGE_KEY, Event, FilteringSpanProcessor, HTTPAttributes, Metric, NORMALIZER_PATTERNS, NORMALIZER_PRESETS, NeverSampler, REDACTOR_PATTERNS, REDACTOR_PRESETS, ROOT_CONTEXT, RandomSampler, ServiceAttributes, SpanKind, SpanNameNormalizingProcessor, SpanStatusCode, URLAttributes, UserIdSampler, attrs, autoRedactPII, builtinPatterns, context, createAttributeRedactor, createCounter, createDeterministicTraceId, createDrainPipeline, createHistogram, createLinkFromHeaders, createNoopRequestLogger, createObservableGauge, createRedactedSpan, createSafeBaggageSchema, createStringRedactor, createStructuredError, createUpDownCounter, ctx, dbClient, defineAuditCatalog, defineBaggageSchema, defineDrain, defineEnricher, defineErrorCatalog, defineEvent, defineHttpDrain, enrichWithTraceContext, experiment, extractLinksFromBatch, finalizeSpan, flattenMetadata, flattenToAttributes, flush, forceKeep, formatDuration, generateCorrelationId, getActiveContext, getActiveSpan, getActiveTraceContext, getAutotelTracer, getAutotelTracerProvider, getCatalogCode, getCorrelationId, getCurrentWorkflowContext, getEventQueue, getEvents, getMeter, getMetrics, getOperationContext, getOrCreateCorrelationId, getRequestLogger, getRequestLoggerSafe, getStructuredErrorAttributes, getTraceContext, getTracer, hasRequestContext, hasTracerProvider, httpClient, httpRequestHeaderAttribute, httpResponseHeaderAttribute, httpServer, identify, init, instrument, isCatalogError, isInWorkflow, isInitialized, isLoggerLocked, isTracing, lockLogger, mergeAttrs, mergeServiceResource, normalizeAttributeRedactorConfig, otelTrace, parseError, propagation, recordStructuredError, request, requestCtx, resetEvents, resetMetrics, resolveSamplingPreset, resolveTraceUrl, runInOperationContext, runWithCorrelationId, runWithRequestContext, runWithSpan, safeSetAttributes, samplingPresets, setAutotelTracerProvider, setCorrelationId, setCorrelationIdInBaggage, setDevice, setError, setException, setSession, setUser, shutdown, span, structuredErrorToJSON, toAttributeValue, trace, traceConsumer, traceDB, traceHTTP, traceMessaging, traceProducer, traceStep, traceWorkflow, track, validateAttribute, withBaggage, withNewContext, withTracing };
551
+ export { AUTOTEL_DEBUG_BAGGAGE_KEY, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, AttributeRedactingProcessor, BaggageSpanProcessor, BusinessBaggage, CORRELATION_ID_BAGGAGE_KEY, EnrichedSpanProcessor, Event, FilteringSpanProcessor, HTTPAttributes, Metric, NORMALIZER_PATTERNS, NORMALIZER_PRESETS, NeverSampler, REDACTOR_PATTERNS, REDACTOR_PRESETS, ROOT_CONTEXT, RandomSampler, ServiceAttributes, SpanKind, SpanNameNormalizingProcessor, SpanStatusCode, URLAttributes, UserIdSampler, attrs, autoRedactPII, builtinPatterns, context, createAttributeRedactor, createCounter, createDeterministicTraceId, createDrainPipeline, createHistogram, createLinkFromHeaders, createNoopRequestLogger, createObservableGauge, createRedactedSpan, createSafeBaggageSchema, createStringRedactor, createStructuredError, createUpDownCounter, ctx, dbClient, defineAuditCatalog, defineBaggageSchema, defineDrain, defineEnricher, defineErrorCatalog, defineEvent, defineHttpDrain, enrichWithTraceContext, experiment, extractLinksFromBatch, finalizeSpan, flattenMetadata, flattenToAttributes, flush, forceKeep, formatDuration, generateCorrelationId, getActiveContext, getActiveSpan, getActiveTraceContext, getAutotelTracer, getAutotelTracerProvider, getCatalogCode, getCorrelationId, getCurrentWorkflowContext, getEventQueue, getEvents, getMeter, getMetrics, getOperationContext, getOrCreateCorrelationId, getRequestLogger, getRequestLoggerSafe, getStructuredErrorAttributes, getTraceContext, getTracer, hasRequestContext, hasTracerProvider, httpClient, httpRequestHeaderAttribute, httpResponseHeaderAttribute, httpServer, identify, init, instrument, isCatalogError, isInWorkflow, isInitialized, isLoggerLocked, isTracing, lockLogger, mergeAttrs, mergeServiceResource, normalizeAttributeRedactorConfig, otelTrace, parseError, propagation, recordStructuredError, request, requestCtx, resetEvents, resetMetrics, resolveSamplingPreset, resolveTraceUrl, runInOperationContext, runWithCorrelationId, runWithRequestContext, runWithSpan, safeSetAttributes, samplingPresets, setAutotelTracerProvider, setCorrelationId, setCorrelationIdInBaggage, setDevice, setError, setException, setSession, setUser, shutdown, span, structuredErrorToJSON, toAttributeValue, trace, traceConsumer, traceDB, traceHTTP, traceMessaging, traceProducer, traceStep, traceWorkflow, track, validateAttribute, withBaggage, withNewContext, withTracing };
@@ -1,11 +1,11 @@
1
- import { a as AttributeRedactorPreset, r as AttributeRedactorConfig } from "./attribute-redacting-processor-rkV_WL-k.js";
2
- import { s as Logger } from "./logger-C9UT1aZ_.js";
3
- import { g as SamplingPreset, m as Sampler$1 } from "./sampling-B_8orhSB.js";
1
+ import { a as AttributeRedactorPreset, r as AttributeRedactorConfig } from "./attribute-redacting-processor-BrrdojmP.js";
2
+ import { s as Logger } from "./logger-b0qgWFy7.js";
3
+ import { g as SamplingPreset, m as Sampler$1 } from "./sampling-DBlX8Nv5.js";
4
4
  import { o as EventSubscriber } from "./event-subscriber-DMACQA-1.js";
5
5
  import { r as SpanFilterPredicate } from "./filtering-span-processor-BDGe1myy.js";
6
6
  import { r as Policy } from "./policy-DNw_0qUq.js";
7
7
  import { r as SpanNameNormalizerConfig } from "./span-name-normalizer-DHcg1bSP.js";
8
- import { t as CanonicalLogLineOptions } from "./canonical-log-line-processor-DDGzm-wi.js";
8
+ import { t as CanonicalLogLineOptions } from "./canonical-log-line-processor-BaFqHO5l.js";
9
9
  import { Attributes, Sampler, TextMapPropagator } from "@opentelemetry/api";
10
10
  import { Instrumentation } from "@opentelemetry/instrumentation";
11
11
  import { Resource, ResourceDetector } from "@opentelemetry/resources";
@@ -289,10 +289,11 @@ interface CanonicalLogLinesConfig {
289
289
  enabled: boolean;
290
290
  /**
291
291
  * Logger(s) to emit canonical log lines through. Pass an array to fan out to
292
- * several. When omitted, lines go to the OTel Logs API instead.
292
+ * several. When omitted, lines go to the OTel Logs API instead. The
293
+ * top-level `logger` is for autotel's diagnostics and is not used here.
293
294
  *
294
- * Note this falls back to the top-level `logger` on AutotelConfig, so
295
- * setting that alone also diverts canonical log lines away from OTLP.
295
+ * Called as `logger[level](fields, message)`, pino's signature (bunyan's
296
+ * too). Winston takes `(message, meta)`, so wrap it.
296
297
  */
297
298
  logger?: Logger | Logger[];
298
299
  /**
@@ -488,7 +489,7 @@ interface AutotelConfig {
488
489
  * })
489
490
  * ```
490
491
  *
491
- * @example Enable specific auto-instrumentations
492
+ * @example Enable only these (the array is an allowlist; include `'http'` for request spans)
492
493
  * ```typescript
493
494
  * init({
494
495
  * service: 'my-app',
@@ -496,7 +497,7 @@ interface AutotelConfig {
496
497
  * })
497
498
  * ```
498
499
  *
499
- * @example Configure specific auto-instrumentations
500
+ * @example Everything, with per-package overrides (unlisted packages still load)
500
501
  * ```typescript
501
502
  * init({
502
503
  * service: 'my-app',
@@ -628,7 +629,9 @@ interface AutotelConfig {
628
629
  *
629
630
  * Unlike {@link spanProcessors}, which replaces the pipeline autotel would
630
631
  * have built, these are added to it. Use them for processors that enrich
631
- * rather than export, so `destinations` keeps working:
632
+ * rather than export, so `destinations` keeps working. On flush and
633
+ * shutdown they drain before the exporters do, so a span an enricher ends
634
+ * while draining is still exported:
632
635
  *
633
636
  * @example
634
637
  * ```typescript
@@ -867,7 +870,8 @@ interface AutotelConfig {
867
870
  * Logger instance for internal autotel diagnostic messages
868
871
  *
869
872
  * This logger is used by autotel internally to log initialization, warnings,
870
- * and debug information. Any logger with info/warn/error/debug methods works.
873
+ * and debug information. It is called pino-style, `(fields, message)`, so pino
874
+ * and bunyan work as is; wrap a `(message, meta)` logger such as winston.
871
875
  *
872
876
  * **For OTel instrumentation of your application logs**, use the `autoInstrumentations` option:
873
877
  * - `autoInstrumentations: ['pino']` - Injects traceId/spanId into Pino logs
@@ -875,18 +879,17 @@ interface AutotelConfig {
875
879
  *
876
880
  * Default: silent logger (no-op)
877
881
  *
878
- * @example Pino with OTel instrumentation
882
+ * @example Pino with trace context (no `logger` needed)
879
883
  * ```typescript
880
- * import pino from 'pino'
884
+ * // telemetry.ts - imported first, before anything that creates the logger
881
885
  * import { init } from 'autotel'
886
+ * init({ service: 'my-app', autoInstrumentations: ['pino'], logs: true })
882
887
  *
883
- * const logger = pino({ level: 'info' })
884
- * init({
885
- * service: 'my-app',
886
- * logger, // For autotel's internal logs
887
- * autoInstrumentations: ['pino'] // For OTel trace context in YOUR logs
888
- * })
888
+ * // logger.ts - created after init(), so pino is patched as it loads
889
+ * import pino from 'pino'
890
+ * export const logger = pino()
889
891
  * ```
892
+ * Under ESM, start node with `--import autotel/register` too.
890
893
  *
891
894
  * @example Custom logger for autotel diagnostics
892
895
  * ```typescript
@@ -900,18 +903,10 @@ interface AutotelConfig {
900
903
  * ```
901
904
  *
902
905
  * @remarks
903
- * This is also the fallback logger for canonical log lines, so setting it
904
- * sends them here INSTEAD of the OTel Logs API — and therefore stops them
905
- * reaching an OTLP logs backend such as Loki. On a platform whose log view
906
- * reads stdout you usually want both, which is what
907
- * `canonicalLogLines.otel` is for:
908
- *
909
- * ```typescript
910
- * init({
911
- * service: 'my-app',
912
- * canonicalLogLines: { enabled: true, logger, otel: true },
913
- * })
914
- * ```
906
+ * Don't pass your app logger here to get trace context: creating it before
907
+ * `init()` loads its package before the instrumentation, so it is never
908
+ * patched. Canonical log lines do not use this logger either; set
909
+ * `canonicalLogLines.logger` (or `pretty`) for those.
915
910
  */
916
911
  logger?: Logger;
917
912
  /**