autotel 7.0.1 → 7.2.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 (62) hide show
  1. package/README.md +25 -0
  2. package/dist/analysis.cjs +17 -0
  3. package/dist/analysis.d.cts +9 -1
  4. package/dist/analysis.d.ts +9 -1
  5. package/dist/analysis.js +17 -1
  6. package/dist/auto.cjs +2 -3
  7. package/dist/auto.js +1 -2
  8. package/dist/correlation-id.cjs +1 -1
  9. package/dist/correlation-id.js +1 -1
  10. package/dist/decorators.cjs +1 -1
  11. package/dist/decorators.d.cts +1 -1
  12. package/dist/decorators.d.ts +1 -1
  13. package/dist/decorators.js +1 -1
  14. package/dist/event.cjs +1 -1
  15. package/dist/event.js +1 -1
  16. package/dist/evidence.cjs +57 -0
  17. package/dist/evidence.d.cts +61 -0
  18. package/dist/evidence.d.ts +61 -0
  19. package/dist/evidence.js +50 -0
  20. package/dist/{functional-C2ONG9PK.cjs → functional-C925G95W.cjs} +68 -17
  21. package/dist/{functional-CJn2zY4o.d.cts → functional-CgWcRXGX.d.cts} +12 -5
  22. package/dist/{functional-nS5U4KCQ.js → functional-Doi0hFm3.js} +64 -13
  23. package/dist/{functional-DXy1cHFF.d.ts → functional-RFFpQzAV.d.ts} +12 -5
  24. package/dist/functional.cjs +1 -1
  25. package/dist/functional.d.cts +1 -1
  26. package/dist/functional.d.ts +1 -1
  27. package/dist/functional.js +1 -1
  28. package/dist/http.cjs +1 -1
  29. package/dist/http.js +1 -1
  30. package/dist/index.cjs +53 -15
  31. package/dist/index.d.cts +24 -4
  32. package/dist/index.d.ts +24 -4
  33. package/dist/index.js +40 -5
  34. package/dist/{init-DrlL1eis.d.cts → init-8GSy2bza.d.cts} +1 -1
  35. package/dist/{init-DDyaLzeg.js → init-DzAdgcFM.js} +2181 -1303
  36. package/dist/{init-BgnYi2sm.d.ts → init-UnKrXhpq.d.ts} +1 -1
  37. package/dist/{init-C5aHRqi2.cjs → init-aTZKsAwy.cjs} +2324 -1294
  38. package/dist/instrumentation.cjs +2 -3
  39. package/dist/instrumentation.js +1 -2
  40. package/dist/messaging.cjs +5 -5
  41. package/dist/messaging.js +2 -2
  42. package/dist/{sampling-CM5S2Lp3.d.ts → sampling-DBng4Foa.d.ts} +20 -1
  43. package/dist/{sampling-CmRdnXUi.d.cts → sampling-Er217Mge.d.cts} +20 -1
  44. package/dist/sampling.cjs +22 -601
  45. package/dist/sampling.d.cts +2 -2
  46. package/dist/sampling.d.ts +2 -2
  47. package/dist/sampling.js +2 -585
  48. package/dist/semantic-helpers.cjs +1 -1
  49. package/dist/semantic-helpers.js +1 -1
  50. package/dist/tail-sampling-processor.cjs +2 -26
  51. package/dist/tail-sampling-processor.js +1 -25
  52. package/dist/webhook.cjs +1 -1
  53. package/dist/webhook.js +1 -1
  54. package/dist/workflow-distributed.cjs +1 -1
  55. package/dist/workflow-distributed.js +1 -1
  56. package/dist/workflow.cjs +1 -1
  57. package/dist/workflow.js +1 -1
  58. package/dist/yaml-config.cjs +4 -248
  59. package/dist/yaml-config.d.cts +2 -2
  60. package/dist/yaml-config.d.ts +2 -2
  61. package/dist/yaml-config.js +1 -242
  62. package/package.json +6 -1
@@ -1,13 +1,43 @@
1
1
  import { l as asString, m as isDevelopment } from "./values-BenyvWKz.js";
2
2
  import { getForceFlushableProvider } from "./tracer-provider.js";
3
3
  import { getConfig } from "./config.js";
4
- import { AUTOTEL_SAMPLING_RATE, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AlwaysSampler } from "./sampling.js";
5
- import { D as getActiveContextWithBaggage, O as getContextStorage, T as createTraceContext, h as getEventQueue, k as hasExplicitSpanStatus, m as runInOperationContext, r as getSdk, t as getConfig$1 } from "./init-DDyaLzeg.js";
4
+ import { C as AUTOTEL_SAMPLING_TAIL_EVALUATED, E as AlwaysSampler, F as debugCaptureRequested, G as getContextStorage, H as createTraceContext, K as hasExplicitSpanStatus, R as isForceKept, S as AUTOTEL_SAMPLING_RATE, W as getActiveContextWithBaggage, m as runInOperationContext, q as getEventQueue, r as getSdk, t as getConfig$1, w as AUTOTEL_SAMPLING_TAIL_KEEP } from "./init-DzAdgcFM.js";
5
+ import { evidenceAttribute } from "./evidence.js";
6
6
  import { setSpanName } from "./trace-helpers.js";
7
7
  import { SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
8
8
  import * as nodeFs from "node:fs";
9
9
  import * as nodeUrl from "node:url";
10
10
 
11
+ //#region src/is-thenable.ts
12
+ /**
13
+ * Convert anything `await` would wait on into a native Promise, or return
14
+ * `undefined` for a synchronous value.
15
+ *
16
+ * `instanceof Promise` is not enough. ORM query builders (drizzle, knex,
17
+ * Prisma, Sequelize) are lazy thenables that are not native Promises, and a
18
+ * promise created in another realm fails the check too. Treating those as
19
+ * synchronous ends the span before the work runs, which produces a short
20
+ * parent span with its real children orphaned outside it.
21
+ */
22
+ function promiseFromThenable(value) {
23
+ if (typeof value !== "object" && typeof value !== "function" || value === null) return;
24
+ let then;
25
+ try {
26
+ then = value.then;
27
+ } catch (error) {
28
+ return Promise.reject(error);
29
+ }
30
+ if (typeof then !== "function") return void 0;
31
+ return new Promise((resolve, reject) => {
32
+ try {
33
+ then.call(value, resolve, reject);
34
+ } catch (error) {
35
+ reject(error);
36
+ }
37
+ });
38
+ }
39
+
40
+ //#endregion
11
41
  //#region src/variable-name-inference.ts
12
42
  /**
13
43
  * Variable Name Inference Utility
@@ -202,25 +232,41 @@ function createDummyCtx() {
202
232
  getAllBaggage: () => /* @__PURE__ */ new Map()
203
233
  };
204
234
  }
235
+ /**
236
+ * Serialize a captured value, and say whether the ceiling cut it. The flag is
237
+ * separate from the text because `…[truncated]` inside the value is only
238
+ * legible to a human reading one span — a backend cannot filter on it.
239
+ */
205
240
  function serializeCapture(value) {
206
241
  if (value === void 0) return void 0;
207
242
  try {
208
243
  const json = asString(value) ?? JSON.stringify(value);
209
244
  if (json === void 0) return void 0;
210
- return json.length > CAPTURE_MAX_CHARS ? `${json.slice(0, CAPTURE_MAX_CHARS)}…[truncated]` : json;
245
+ return json.length > CAPTURE_MAX_CHARS ? {
246
+ text: `${json.slice(0, CAPTURE_MAX_CHARS)}…[truncated]`,
247
+ truncated: true
248
+ } : {
249
+ text: json,
250
+ truncated: false
251
+ };
211
252
  } catch {
212
253
  return;
213
254
  }
214
255
  }
215
- function captureInputAttrs(args, enabled) {
256
+ function captureAttrs(value, valueAttr, field, enabled) {
216
257
  if (!enabled) return {};
217
- const serialized = serializeCapture(args.length === 1 ? args[0] : args);
218
- return serialized === void 0 ? {} : { [AUTOTEL_INPUT_ATTR]: serialized };
258
+ const serialized = serializeCapture(value);
259
+ if (serialized === void 0) return {};
260
+ return {
261
+ [valueAttr]: serialized.text,
262
+ ...serialized.truncated && { [evidenceAttribute(field)]: "truncated" }
263
+ };
264
+ }
265
+ function captureInputAttrs(args, enabled) {
266
+ return captureAttrs(args.length === 1 ? args[0] : args, AUTOTEL_INPUT_ATTR, "input", enabled);
219
267
  }
220
268
  function captureOutputAttrs(result, enabled) {
221
- if (!enabled) return {};
222
- const serialized = serializeCapture(result);
223
- return serialized === void 0 ? {} : { [AUTOTEL_OUTPUT_ATTR]: serialized };
269
+ return captureAttrs(result, AUTOTEL_OUTPUT_ATTR, "output", enabled);
224
270
  }
225
271
  function truncateErrorMessage(message) {
226
272
  return message.length <= 500 ? message : `${message.slice(0, 500)}... (truncated)`;
@@ -318,7 +364,10 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
318
364
  const shouldSample = sampler.shouldSample(samplingContext);
319
365
  const sampleRate = sampler.sampleRate?.(samplingContext);
320
366
  const needsTailSampling = sampler.needsTailSampling?.() ?? false;
321
- if (!shouldSample && !needsTailSampling) return fnFactory(createDummyCtx()).call(this, ...args);
367
+ if (!shouldSample && !needsTailSampling) {
368
+ const unsampled = fnFactory(createDummyCtx()).call(this, ...args);
369
+ return promiseFromThenable(unsampled) ?? unsampled;
370
+ }
322
371
  const startTime = performance.now();
323
372
  const flushRootTelemetry = createRootTelemetryFlusher(options, options.startNewRoot || trace.getActiveSpan() === void 0);
324
373
  const spanOptions = {};
@@ -334,7 +383,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
334
383
  ...options.attributesFromArgs?.(args)
335
384
  };
336
385
  const handleTailSampling = (success, duration, error) => {
337
- if (needsTailSampling && sampler.shouldKeepTrace) {
386
+ if (needsTailSampling && sampler.shouldKeepTrace && !isForceKept(span) && !debugCaptureRequested()) {
338
387
  shouldKeepSpan = sampler.shouldKeepTrace(samplingContext, {
339
388
  success,
340
389
  duration,
@@ -389,7 +438,8 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
389
438
  status: "started"
390
439
  });
391
440
  const result = context.with(trace.setSpan(getActiveContextWithBaggage(), span), () => fn.call(this, ...args));
392
- if (result instanceof Promise) return result.then(async (value) => {
441
+ const resultPromise = promiseFromThenable(result);
442
+ if (resultPromise) return resultPromise.then(async (value) => {
393
443
  const completed = onSuccess(value);
394
444
  await flushRootTelemetry();
395
445
  return completed;
@@ -639,7 +689,8 @@ function span(nameOrOptions, fn) {
639
689
  try {
640
690
  if (attributes) for (const [key, value] of Object.entries(attributes)) span.setAttribute(key, value);
641
691
  const result = fn(span);
642
- if (result instanceof Promise) return result.then((resolved) => {
692
+ const resultPromise = promiseFromThenable(result);
693
+ if (resultPromise) return resultPromise.then((resolved) => {
643
694
  span.setStatus({ code: SpanStatusCode.OK });
644
695
  span.end();
645
696
  return resolved;
@@ -1,5 +1,5 @@
1
1
  import { n as TraceContext } from "./trace-context-f89xPJbK.js";
2
- import { p as Sampler } from "./sampling-CM5S2Lp3.js";
2
+ import { m as Sampler } from "./sampling-DBng4Foa.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>;
@@ -192,7 +192,9 @@ declare const ctx: TraceContext;
192
192
  * })
193
193
  * ```
194
194
  */
195
+ declare function traceImpl<TArgs extends unknown[], TReturn>(fn: (...args: TArgs) => PromiseLike<TReturn>): (...args: TArgs) => Promise<TReturn>;
195
196
  declare function traceImpl<TArgs extends unknown[], TReturn>(fn: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
197
+ declare function traceImpl<TArgs extends unknown[], TReturn>(name: string, fn: (...args: TArgs) => PromiseLike<TReturn>): (...args: TArgs) => Promise<TReturn>;
196
198
  declare function traceImpl<TArgs extends unknown[], TReturn>(name: string, fn: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
197
199
  declare function traceImpl<TArgs extends unknown[], TReturn>(options: TracingOptions<TArgs, TReturn>, fn: (...args: TArgs) => TReturn): (...args: TArgs) => TReturn;
198
200
  declare function traceImpl(name: string): <TArgs extends unknown[], TReturn>(fn: (...args: TArgs) => TReturn) => (...args: TArgs) => TReturn;
@@ -258,7 +260,7 @@ declare const trace$1: typeof traceImpl & {
258
260
  * )(ctx => async (data) => { })
259
261
  * ```
260
262
  */
261
- 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 | Promise<TReturn>) => WrappedFunction<TArgs, TReturn>;
263
+ 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>;
262
264
  /**
263
265
  * Approach 3: instrument() - Batch auto-instrumentation
264
266
  *
@@ -309,8 +311,13 @@ declare function withTracing<TCfgArgs extends unknown[] = unknown[], TCfgReturn
309
311
  * })
310
312
  * ```
311
313
  */
314
+ type InstrumentedFunction<TFunction extends AnyInstrumentable> = TFunction extends ((...args: infer TArgs) => infer TReturn) ? (...args: TArgs) => TReturn extends PromiseLike<infer TValue> ? Promise<TValue> : TReturn : never;
315
+ type InstrumentedFunctions<T extends Record<string, AnyInstrumentable>> = { [TKey in keyof T]: InstrumentedFunction<T[TKey]>; };
316
+ declare function instrument<TFunction extends AnyInstrumentable>(options: SingleInstrumentOptions<TFunction> & {
317
+ fn: TFunction & ((...args: Parameters<TFunction>) => PromiseLike<unknown>);
318
+ }): (...args: Parameters<TFunction>) => Promise<Awaited<ReturnType<TFunction>>>;
312
319
  declare function instrument<TFunction extends AnyInstrumentable>(options: SingleInstrumentOptions<TFunction>): TFunction;
313
- declare function instrument<T extends Record<string, AnyInstrumentable>>(options: InstrumentOptions<T>): T;
320
+ declare function instrument<T extends Record<string, AnyInstrumentable>>(options: InstrumentOptions<T>): InstrumentedFunctions<T>;
314
321
  /**
315
322
  * Options for span() function
316
323
  */
@@ -352,10 +359,10 @@ interface SpanOptions {
352
359
  * })
353
360
  * ```
354
361
  */
362
+ declare function span<T = unknown>(name: string, fn: (span: Span) => PromiseLike<T>): Promise<T>;
363
+ declare function span<T = unknown>(options: SpanOptions, fn: (span: Span) => PromiseLike<T>): Promise<T>;
355
364
  declare function span<T = unknown>(name: string, fn: (span: Span) => T): T;
356
- declare function span<T = unknown>(name: string, fn: (span: Span) => Promise<T>): Promise<T>;
357
365
  declare function span<T = unknown>(options: SpanOptions, fn: (span: Span) => T): T;
358
- declare function span<T = unknown>(options: SpanOptions, fn: (span: Span) => Promise<T>): Promise<T>;
359
366
  /**
360
367
  * Options for withNewContext() function
361
368
  */
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_functional = require('./functional-C2ONG9PK.cjs');
2
+ const require_functional = require('./functional-C925G95W.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-C1Cn1q0y.cjs";
2
- import { a as getActiveTraceContext, c as trace, d as withTracing, f as InstrumentOptions, i as ctx, l as withBaggage, m as TracingOptions, n as WithBaggageOptions, o as instrument, p as SingleInstrumentOptions, r as WithNewContextOptions, s as span, t as SpanOptions, u as withNewContext } from "./functional-CJn2zY4o.cjs";
2
+ import { a as getActiveTraceContext, c as trace, d as withTracing, f as InstrumentOptions, i as ctx, l as withBaggage, m as TracingOptions, n as WithBaggageOptions, o as instrument, p as SingleInstrumentOptions, r as WithNewContextOptions, s as span, t as SpanOptions, u as withNewContext } from "./functional-CgWcRXGX.cjs";
3
3
  export { type InstrumentOptions, type SingleInstrumentOptions, SpanOptions, type TraceContext, type TracingOptions, WithBaggageOptions, WithNewContextOptions, ctx, getActiveTraceContext, instrument, span, trace, withBaggage, withNewContext, withTracing };
@@ -1,3 +1,3 @@
1
1
  import { n as TraceContext } from "./trace-context-f89xPJbK.js";
2
- import { a as getActiveTraceContext, c as trace, d as withTracing, f as InstrumentOptions, i as ctx, l as withBaggage, m as TracingOptions, n as WithBaggageOptions, o as instrument, p as SingleInstrumentOptions, r as WithNewContextOptions, s as span, t as SpanOptions, u as withNewContext } from "./functional-DXy1cHFF.js";
2
+ import { a as getActiveTraceContext, c as trace, d as withTracing, f as InstrumentOptions, i as ctx, l as withBaggage, m as TracingOptions, n as WithBaggageOptions, o as instrument, p as SingleInstrumentOptions, r as WithNewContextOptions, s as span, t as SpanOptions, u as withNewContext } from "./functional-RFFpQzAV.js";
3
3
  export { type InstrumentOptions, type SingleInstrumentOptions, SpanOptions, type TraceContext, type TracingOptions, WithBaggageOptions, WithNewContextOptions, ctx, getActiveTraceContext, instrument, span, trace, withBaggage, withNewContext, withTracing };
@@ -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-nS5U4KCQ.js";
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-Doi0hFm3.js";
2
2
 
3
3
  export { ctx, getActiveTraceContext, instrument, span, trace, withBaggage, withNewContext, withTracing };
package/dist/http.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_values = require('./values-DApyq53y.cjs');
3
3
  const require_config = require('./config.cjs');
4
- const require_init = require('./init-C5aHRqi2.cjs');
4
+ const require_init = require('./init-aTZKsAwy.cjs');
5
5
  let _opentelemetry_api = require("@opentelemetry/api");
6
6
 
7
7
  //#region src/http.ts
package/dist/http.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { _ as readProperty, h as isFunction, i as asNumber, l as asString } from "./values-BenyvWKz.js";
2
2
  import { getConfig } from "./config.js";
3
- import { D as getActiveContextWithBaggage } from "./init-DDyaLzeg.js";
3
+ import { W as getActiveContextWithBaggage } from "./init-DzAdgcFM.js";
4
4
  import { SpanStatusCode, context, propagation } from "@opentelemetry/api";
5
5
 
6
6
  //#region src/http.ts
package/dist/index.cjs CHANGED
@@ -2,16 +2,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_rolldown_runtime = require('./rolldown-runtime-C_NdSu1c.cjs');
3
3
  const require_values = require('./values-DApyq53y.cjs');
4
4
  const require_tracer_provider = require('./tracer-provider.cjs');
5
- const require_sampling = require('./sampling.cjs');
6
- const require_init = require('./init-C5aHRqi2.cjs');
5
+ const require_structured_error = require('./structured-error--_wXpd_C.cjs');
6
+ const require_init = require('./init-aTZKsAwy.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
10
  const require_canonical_log_line_processor = require('./canonical-log-line-processor-DolzdawH.cjs');
11
- const require_structured_error = require('./structured-error--_wXpd_C.cjs');
12
11
  const require_metric = require('./metric.cjs');
12
+ const require_functional = require('./functional-C925G95W.cjs');
13
13
  const require_trace_helpers = require('./trace-helpers.cjs');
14
- const require_functional = require('./functional-C2ONG9PK.cjs');
15
14
  const require_stable_hash = require('./stable-hash-C0pOegH_.cjs');
16
15
  const require_correlated_events = require('./correlated-events-CcuknWnU.cjs');
17
16
  const require_parse_error = require('./parse-error.cjs');
@@ -28,6 +27,42 @@ let _opentelemetry_api = require("@opentelemetry/api");
28
27
  let node_async_hooks = require("node:async_hooks");
29
28
  node_async_hooks = require_rolldown_runtime.__toESM(node_async_hooks, 1);
30
29
 
30
+ //#region src/force-keep.ts
31
+ /**
32
+ * Keep this trace whatever the sampler decides.
33
+ *
34
+ * Reach for it where a trace is worth more than the sampling budget: a
35
+ * payment, an audit-relevant action, or a request you are debugging now.
36
+ */
37
+ function forceKeep() {
38
+ const ctx = require_functional.getActiveTraceContext();
39
+ if (!ctx) return;
40
+ ctx.setAttribute(require_init.AUTOTEL_SAMPLING_TAIL_EVALUATED, true);
41
+ ctx.setAttribute(require_init.AUTOTEL_SAMPLING_TAIL_KEEP, true);
42
+ const span = require_trace_helpers.getActiveSpan();
43
+ if (span) require_init.markForceKept(span);
44
+ }
45
+
46
+ //#endregion
47
+ //#region src/experiment.ts
48
+ /**
49
+ * Record which experiment a unit of work is part of.
50
+ *
51
+ * An experiment needs a guess and a way to check it. Instrumentation gives you
52
+ * the check; this names the guess, so the two cohorts you want to compare are
53
+ * selectable from the telemetry rather than reconstructed by hand afterwards.
54
+ */
55
+ function experiment(options) {
56
+ const ctx = require_functional.getActiveTraceContext();
57
+ if (!ctx) return;
58
+ ctx.setAttribute("experiment.name", options.name);
59
+ ctx.setAttribute("experiment.variant", options.variant);
60
+ if (options.expect !== void 0) ctx.setAttribute("experiment.expectation", options.expect);
61
+ ctx.setBaggage("experiment.name", options.name);
62
+ ctx.setBaggage("experiment.variant", options.variant);
63
+ }
64
+
65
+ //#endregion
31
66
  //#region src/trace-hybrid.ts
32
67
  /**
33
68
  * Hybrid `trace` export: callable like autotel's `trace(fn)`, AND exposes the
@@ -516,10 +551,11 @@ function defineEnricher(def, options = {}) {
516
551
  }
517
552
 
518
553
  //#endregion
519
- exports.AUTOTEL_SAMPLING_TAIL_EVALUATED = require_sampling.AUTOTEL_SAMPLING_TAIL_EVALUATED;
520
- exports.AUTOTEL_SAMPLING_TAIL_KEEP = require_sampling.AUTOTEL_SAMPLING_TAIL_KEEP;
521
- exports.AdaptiveSampler = require_sampling.AdaptiveSampler;
522
- exports.AlwaysSampler = require_sampling.AlwaysSampler;
554
+ exports.AUTOTEL_DEBUG_BAGGAGE_KEY = require_init.AUTOTEL_DEBUG_BAGGAGE_KEY;
555
+ exports.AUTOTEL_SAMPLING_TAIL_EVALUATED = require_init.AUTOTEL_SAMPLING_TAIL_EVALUATED;
556
+ exports.AUTOTEL_SAMPLING_TAIL_KEEP = require_init.AUTOTEL_SAMPLING_TAIL_KEEP;
557
+ exports.AdaptiveSampler = require_init.AdaptiveSampler;
558
+ exports.AlwaysSampler = require_init.AlwaysSampler;
523
559
  exports.AttributeRedactingProcessor = require_attribute_redacting_processor.AttributeRedactingProcessor;
524
560
  exports.BaggageSpanProcessor = require_init.BaggageSpanProcessor;
525
561
  exports.BusinessBaggage = require_business_baggage.BusinessBaggage;
@@ -530,7 +566,7 @@ exports.HTTPAttributes = require_registry.HTTPAttributes;
530
566
  exports.Metric = require_metric.Metric;
531
567
  exports.NORMALIZER_PATTERNS = require_span_name_normalizer.NORMALIZER_PATTERNS;
532
568
  exports.NORMALIZER_PRESETS = require_span_name_normalizer.NORMALIZER_PRESETS;
533
- exports.NeverSampler = require_sampling.NeverSampler;
569
+ exports.NeverSampler = require_init.NeverSampler;
534
570
  exports.REDACTOR_PATTERNS = require_attribute_redacting_processor.REDACTOR_PATTERNS;
535
571
  exports.REDACTOR_PRESETS = require_attribute_redacting_processor.REDACTOR_PRESETS;
536
572
  Object.defineProperty(exports, 'ROOT_CONTEXT', {
@@ -539,7 +575,7 @@ Object.defineProperty(exports, 'ROOT_CONTEXT', {
539
575
  return _opentelemetry_api.ROOT_CONTEXT;
540
576
  }
541
577
  });
542
- exports.RandomSampler = require_sampling.RandomSampler;
578
+ exports.RandomSampler = require_init.RandomSampler;
543
579
  exports.ServiceAttributes = require_registry.ServiceAttributes;
544
580
  Object.defineProperty(exports, 'SpanKind', {
545
581
  enumerable: true,
@@ -555,7 +591,7 @@ Object.defineProperty(exports, 'SpanStatusCode', {
555
591
  }
556
592
  });
557
593
  exports.URLAttributes = require_registry.URLAttributes;
558
- exports.UserIdSampler = require_sampling.UserIdSampler;
594
+ exports.UserIdSampler = require_init.UserIdSampler;
559
595
  exports.attrs = require_attributes.attrs;
560
596
  exports.autoRedactPII = require_attributes.autoRedactPII;
561
597
  exports.builtinPatterns = require_attribute_redacting_processor.builtinPatterns;
@@ -570,7 +606,7 @@ exports.createCounter = require_metric_helpers.createCounter;
570
606
  exports.createDeterministicTraceId = require_trace_helpers.createDeterministicTraceId;
571
607
  exports.createDrainPipeline = require_drain_pipeline.createDrainPipeline;
572
608
  exports.createHistogram = require_metric_helpers.createHistogram;
573
- exports.createLinkFromHeaders = require_sampling.createLinkFromHeaders;
609
+ exports.createLinkFromHeaders = require_init.createLinkFromHeaders;
574
610
  exports.createNoopRequestLogger = createNoopRequestLogger;
575
611
  exports.createObservableGauge = require_metric_helpers.createObservableGauge;
576
612
  exports.createRedactedSpan = require_attribute_redacting_processor.createRedactedSpan;
@@ -588,11 +624,13 @@ exports.defineErrorCatalog = defineErrorCatalog;
588
624
  exports.defineEvent = defineEvent;
589
625
  exports.defineHttpDrain = defineHttpDrain;
590
626
  exports.enrichWithTraceContext = require_trace_helpers.enrichWithTraceContext;
591
- exports.extractLinksFromBatch = require_sampling.extractLinksFromBatch;
627
+ exports.experiment = experiment;
628
+ exports.extractLinksFromBatch = require_init.extractLinksFromBatch;
592
629
  exports.finalizeSpan = require_trace_helpers.finalizeSpan;
593
630
  exports.flattenMetadata = require_trace_helpers.flattenMetadata;
594
631
  exports.flattenToAttributes = require_structured_error.flattenToAttributes;
595
632
  exports.flush = require_init.flush;
633
+ exports.forceKeep = forceKeep;
596
634
  exports.formatDuration = require_canonical_log_line_processor.formatDuration;
597
635
  exports.generateCorrelationId = require_init.generateCorrelationId;
598
636
  exports.getActiveContext = require_trace_helpers.getActiveContext;
@@ -648,14 +686,14 @@ exports.recordStructuredError = require_structured_error.recordStructuredError;
648
686
  exports.request = require_attributes.request;
649
687
  exports.resetEvents = require_init.resetEvents;
650
688
  exports.resetMetrics = require_metric.resetMetrics;
651
- exports.resolveSamplingPreset = require_sampling.resolveSamplingPreset;
689
+ exports.resolveSamplingPreset = require_init.resolveSamplingPreset;
652
690
  exports.resolveTraceUrl = require_trace_helpers.resolveTraceUrl;
653
691
  exports.runInOperationContext = require_init.runInOperationContext;
654
692
  exports.runWithCorrelationId = require_init.runWithCorrelationId;
655
693
  exports.runWithRequestContext = runWithRequestContext;
656
694
  exports.runWithSpan = require_trace_helpers.runWithSpan;
657
695
  exports.safeSetAttributes = require_attributes.safeSetAttributes;
658
- exports.samplingPresets = require_sampling.samplingPresets;
696
+ exports.samplingPresets = require_init.samplingPresets;
659
697
  exports.setAutotelTracerProvider = require_tracer_provider.setAutotelTracerProvider;
660
698
  exports.setCorrelationId = require_init.setCorrelationId;
661
699
  exports.setCorrelationIdInBaggage = require_init.setCorrelationIdInBaggage;
package/dist/index.d.cts CHANGED
@@ -4,13 +4,13 @@ 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-C1Cn1q0y.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 { _ as createLinkFromHeaders, a as AlwaysSampler, b as resolveSamplingPreset, f as RandomSampler, g as UserIdSampler, h as SamplingPreset, i as AdaptiveSampler, m as SamplingContext, n as AUTOTEL_SAMPLING_TAIL_EVALUATED, p as Sampler, r as AUTOTEL_SAMPLING_TAIL_KEEP, u as NeverSampler, v as extractLinksFromBatch, x as samplingPresets } from "./sampling-CmRdnXUi.cjs";
8
- import { a as getActiveTraceContext, c as trace$2, d as withTracing, f as InstrumentOptions, i as ctx, l as withBaggage, n as WithBaggageOptions, o as instrument, p as SingleInstrumentOptions, r as WithNewContextOptions, s as span, t as SpanOptions, u as withNewContext } from "./functional-CJn2zY4o.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-Er217Mge.cjs";
8
+ import { a as getActiveTraceContext, c as trace$2, d as withTracing, f as InstrumentOptions, i as ctx, l as withBaggage, n as WithBaggageOptions, o as instrument, p as SingleInstrumentOptions, r as WithNewContextOptions, s as span, t as SpanOptions, u as withNewContext } from "./functional-CgWcRXGX.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-BpDagWNa.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-DrlL1eis.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-8GSy2bza.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
15
  import "./canonical-log-line-processor-l0Aqe6yp.cjs";
16
16
  import { i as defineEvent, n as DefinedEvent, r as SchemaLike, t as DefineEventOptions } from "./define-event-BNeuKUPv.cjs";
@@ -73,6 +73,26 @@ declare class BaggageSpanProcessor implements SpanProcessor {
73
73
  forceFlush(): Promise<void>;
74
74
  }
75
75
  //#endregion
76
+ //#region src/force-keep.d.ts
77
+ /**
78
+ * Keep this trace whatever the sampler decides.
79
+ *
80
+ * Reach for it where a trace is worth more than the sampling budget: a
81
+ * payment, an audit-relevant action, or a request you are debugging now.
82
+ */
83
+ declare function forceKeep(): void;
84
+ //#endregion
85
+ //#region src/experiment.d.ts
86
+ interface ExperimentOptions {
87
+ /** Stable name for the experiment, shared by every variant. */
88
+ name: string;
89
+ /** Which arm of the experiment this call took. */
90
+ variant: string;
91
+ /** What you expect this variant to do, in your own words. */
92
+ expect?: string;
93
+ }
94
+ declare function experiment(options: ExperimentOptions): void;
95
+ //#endregion
76
96
  //#region src/trace-hybrid.d.ts
77
97
  declare const trace: typeof trace$2 & typeof trace$1;
78
98
  //#endregion
@@ -652,4 +672,4 @@ declare function defineEnricher<TEvent extends UnknownRecord, TValue extends obj
652
672
  */
653
673
  declare function formatDuration(ms: number): string;
654
674
  //#endregion
655
- export { AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, type AttributeGuardrails, type AttributePolicy, AttributeRedactingProcessor, type AttributeRedactingProcessorOptions, type AttributeRedactorConfig, type AttributeRedactorFn, type AttributeRedactorPreset, type AttributeValue, type Attributes, type AuditAction, type AuditCatalog, type AuditCatalogEntry, type AuditDescriptor, type AuditSeverity, type AutotelConfig, type Baggage, type BaggageEntry, type BaggageError, type BaggageFieldDefinition, type BaggageFieldType, BaggageSpanProcessor, type BaggageSpanProcessorOptions, type BuiltinPatternName, BusinessBaggage, type BusinessBaggageValues, CORRELATION_ID_BAGGAGE_KEY, type ClientAttrs, type CloudAttrs, type CodeAttrs, type ConsumerConfig, type ConsumerContext, type ContainerAttrs, type Context, type DBAttrs, type DBConfig, type DefineEventOptions, type DefinedEvent, type DeploymentAttrs, type DeviceAttrs, type DrainOptions, type DrainPipelineOptions, type EnrichContext, type EnricherDefinition, type EnricherOptions, type ErrorAttrs, type ErrorBuildOptions, type ErrorBuilder, type ErrorCatalog, type ErrorCatalogEntry, Event, type EventAttributes, type EventSubscriber, type EventsOptions, type Exception, type ExceptionAttrs, type FaaSAttrs, type FeatureFlagAttrs, FilteringSpanProcessor, type FilteringSpanProcessorOptions, type ForkLifecycle, type ForkOptions, type FunnelStatus, type GraphQLAttrs, HTTPAttributes, type HTTPClientAttrs, type HTTPConfig, type HTTPServerAttrs, type HrTime, type HttpDrainOptions, type HttpDrainRequest, type InstrumentOptions, type K8sAttrs, type LagMetricsConfig, type Link, type MaskFn, type MessagingAttrs, type MessagingConfig, type MessagingOperation, type MessagingSystem, Metric, type MetricsOptions, NORMALIZER_PATTERNS, NORMALIZER_PRESETS, type NetworkAttrs, NeverSampler, type OTelAttrs, type OperationContext, type TraceContext as OtelTraceContext, type OutcomeStatus, type ParsedError, type PeerAttrs, type PipelineDrainFn, type ProcessAttrs, type ProcessHandlersConfig, type ProducerConfig, type ProducerContext, REDACTOR_PATTERNS, REDACTOR_PRESETS, ROOT_CONTEXT, type RPCAttrs, RandomSampler, type RequestLogLevel, type RequestLogSnapshot, type RequestLogger, type RequestLoggerOptions, type SafeBaggageOptions, type SafeBaggageSchema, type Sampler, type SamplingContext, type SamplingPreset, type SchemaLike, type ServerAddressAttrs, ServiceAttributes, type ServiceAttrs, type SessionAttrs, type SingleInstrumentOptions, type Span, type SpanAttributes, type SpanContext, type SpanFilterPredicate, SpanKind, type SpanLink, type SpanNameNormalizerConfig, type SpanNameNormalizerFn, type SpanNameNormalizerPreset, SpanNameNormalizingProcessor, type SpanNameNormalizingProcessorOptions, type SpanOptions, SpanStatusCode, type StepConfig, type StepContext, type StepStatus, type StringRedactor, type StructuredError, type StructuredErrorInput, type TLSAttrs, type TextMapGetter, type TextMapSetter, type ThreadAttrs, type TimeInput, type TraceContext$1 as TraceContext, type TraceFlags, type TraceState, type Tracer, type TracerProvider, URLAttributes, type URLAttrs, type UserAttrs, UserIdSampler, type ValuePatternConfig, type WithBaggageOptions, type WithNewContextOptions, type WorkflowConfig, type WorkflowContext, type WorkflowStatus, 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, extractLinksFromBatch, finalizeSpan, flattenMetadata, flattenToAttributes, flush, formatDuration, generateCorrelationId, getActiveContext, getActiveSpan, getActiveTraceContext, getAutotelTracer, getAutotelTracerProvider, getCatalogCode, getCorrelationId, getCurrentWorkflowContext, getEventQueue, getEvents, getMeter, getMetrics, getOperationContext, getOrCreateCorrelationId, getRequestLogger, getRequestLoggerSafe, getStructuredErrorAttributes, getTraceContext, getTracer, hasRequestContext, httpClient, httpRequestHeaderAttribute, httpResponseHeaderAttribute, httpServer, identify, init, instrument, isCatalogError, isInWorkflow, isInitialized, isLoggerLocked, isTracing, lockLogger, mergeAttrs, mergeServiceResource, normalizeAttributeRedactorConfig, otelTrace, parseError, propagation, recordStructuredError, request, 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 };
675
+ export { AUTOTEL_DEBUG_BAGGAGE_KEY, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, type AttributeGuardrails, type AttributePolicy, AttributeRedactingProcessor, type AttributeRedactingProcessorOptions, type AttributeRedactorConfig, type AttributeRedactorFn, type AttributeRedactorPreset, type AttributeValue, type Attributes, type AuditAction, type AuditCatalog, type AuditCatalogEntry, type AuditDescriptor, type AuditSeverity, type AutotelConfig, type Baggage, type BaggageEntry, type BaggageError, type BaggageFieldDefinition, type BaggageFieldType, BaggageSpanProcessor, type BaggageSpanProcessorOptions, type BuiltinPatternName, BusinessBaggage, type BusinessBaggageValues, CORRELATION_ID_BAGGAGE_KEY, type ClientAttrs, type CloudAttrs, type CodeAttrs, type ConsumerConfig, type ConsumerContext, type ContainerAttrs, type Context, type DBAttrs, type DBConfig, type DefineEventOptions, type DefinedEvent, type DeploymentAttrs, type DeviceAttrs, type DrainOptions, type DrainPipelineOptions, type EnrichContext, type EnricherDefinition, type EnricherOptions, type ErrorAttrs, type ErrorBuildOptions, type ErrorBuilder, type ErrorCatalog, type ErrorCatalogEntry, Event, type EventAttributes, type EventSubscriber, type EventsOptions, type Exception, type ExceptionAttrs, type ExperimentOptions, type FaaSAttrs, type FeatureFlagAttrs, FilteringSpanProcessor, type FilteringSpanProcessorOptions, type ForkLifecycle, type ForkOptions, type FunnelStatus, type GraphQLAttrs, HTTPAttributes, type HTTPClientAttrs, type HTTPConfig, type HTTPServerAttrs, type HrTime, type HttpDrainOptions, type HttpDrainRequest, type InstrumentOptions, type K8sAttrs, type LagMetricsConfig, type Link, type MaskFn, type MessagingAttrs, type MessagingConfig, type MessagingOperation, type MessagingSystem, Metric, type MetricsOptions, NORMALIZER_PATTERNS, NORMALIZER_PRESETS, type NetworkAttrs, NeverSampler, type OTelAttrs, type OperationContext, type TraceContext as OtelTraceContext, type OutcomeStatus, type ParsedError, type PeerAttrs, type PipelineDrainFn, type ProcessAttrs, type ProcessHandlersConfig, type ProducerConfig, type ProducerContext, REDACTOR_PATTERNS, REDACTOR_PRESETS, ROOT_CONTEXT, type RPCAttrs, RandomSampler, type RequestLogLevel, type RequestLogSnapshot, type RequestLogger, type RequestLoggerOptions, type SafeBaggageOptions, type SafeBaggageSchema, type Sampler, type SamplingContext, type SamplingPreset, type SchemaLike, type ServerAddressAttrs, ServiceAttributes, type ServiceAttrs, type SessionAttrs, type SingleInstrumentOptions, type Span, type SpanAttributes, type SpanContext, type SpanFilterPredicate, SpanKind, type SpanLink, type SpanNameNormalizerConfig, type SpanNameNormalizerFn, type SpanNameNormalizerPreset, SpanNameNormalizingProcessor, type SpanNameNormalizingProcessorOptions, type SpanOptions, SpanStatusCode, type StepConfig, type StepContext, type StepStatus, type StringRedactor, type StructuredError, type StructuredErrorInput, type TLSAttrs, type TextMapGetter, type TextMapSetter, type ThreadAttrs, type TimeInput, type TraceContext$1 as TraceContext, type TraceFlags, type TraceState, type Tracer, type TracerProvider, URLAttributes, type URLAttrs, type UserAttrs, UserIdSampler, type ValuePatternConfig, type WithBaggageOptions, type WithNewContextOptions, type WorkflowConfig, type WorkflowContext, type WorkflowStatus, 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, httpClient, httpRequestHeaderAttribute, httpResponseHeaderAttribute, httpServer, identify, init, instrument, isCatalogError, isInWorkflow, isInitialized, isLoggerLocked, isTracing, lockLogger, mergeAttrs, mergeServiceResource, normalizeAttributeRedactorConfig, otelTrace, parseError, propagation, recordStructuredError, request, 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 };
package/dist/index.d.ts CHANGED
@@ -4,13 +4,13 @@ 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-f89xPJbK.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 { _ as createLinkFromHeaders, a as AlwaysSampler, b as resolveSamplingPreset, f as RandomSampler, g as UserIdSampler, h as SamplingPreset, i as AdaptiveSampler, m as SamplingContext, n as AUTOTEL_SAMPLING_TAIL_EVALUATED, p as Sampler, r as AUTOTEL_SAMPLING_TAIL_KEEP, u as NeverSampler, v as extractLinksFromBatch, x as samplingPresets } from "./sampling-CM5S2Lp3.js";
8
- import { a as getActiveTraceContext, c as trace$2, d as withTracing, f as InstrumentOptions, i as ctx, l as withBaggage, n as WithBaggageOptions, o as instrument, p as SingleInstrumentOptions, r as WithNewContextOptions, s as span, t as SpanOptions, u as withNewContext } from "./functional-DXy1cHFF.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-DBng4Foa.js";
8
+ import { a as getActiveTraceContext, c as trace$2, d as withTracing, f as InstrumentOptions, i as ctx, l as withBaggage, n as WithBaggageOptions, o as instrument, p as SingleInstrumentOptions, r as WithNewContextOptions, s as span, t as SpanOptions, u as withNewContext } from "./functional-RFFpQzAV.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-BpDagWNa.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-BgnYi2sm.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-UnKrXhpq.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-CN1-8C76.js";
15
15
  import "./canonical-log-line-processor-cPB4Axk-.js";
16
16
  import { i as defineEvent, n as DefinedEvent, r as SchemaLike, t as DefineEventOptions } from "./define-event-Bd8f8mST.js";
@@ -73,6 +73,26 @@ declare class BaggageSpanProcessor implements SpanProcessor {
73
73
  forceFlush(): Promise<void>;
74
74
  }
75
75
  //#endregion
76
+ //#region src/force-keep.d.ts
77
+ /**
78
+ * Keep this trace whatever the sampler decides.
79
+ *
80
+ * Reach for it where a trace is worth more than the sampling budget: a
81
+ * payment, an audit-relevant action, or a request you are debugging now.
82
+ */
83
+ declare function forceKeep(): void;
84
+ //#endregion
85
+ //#region src/experiment.d.ts
86
+ interface ExperimentOptions {
87
+ /** Stable name for the experiment, shared by every variant. */
88
+ name: string;
89
+ /** Which arm of the experiment this call took. */
90
+ variant: string;
91
+ /** What you expect this variant to do, in your own words. */
92
+ expect?: string;
93
+ }
94
+ declare function experiment(options: ExperimentOptions): void;
95
+ //#endregion
76
96
  //#region src/trace-hybrid.d.ts
77
97
  declare const trace: typeof trace$2 & typeof trace$1;
78
98
  //#endregion
@@ -652,4 +672,4 @@ declare function defineEnricher<TEvent extends UnknownRecord, TValue extends obj
652
672
  */
653
673
  declare function formatDuration(ms: number): string;
654
674
  //#endregion
655
- export { AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, type AttributeGuardrails, type AttributePolicy, AttributeRedactingProcessor, type AttributeRedactingProcessorOptions, type AttributeRedactorConfig, type AttributeRedactorFn, type AttributeRedactorPreset, type AttributeValue, type Attributes, type AuditAction, type AuditCatalog, type AuditCatalogEntry, type AuditDescriptor, type AuditSeverity, type AutotelConfig, type Baggage, type BaggageEntry, type BaggageError, type BaggageFieldDefinition, type BaggageFieldType, BaggageSpanProcessor, type BaggageSpanProcessorOptions, type BuiltinPatternName, BusinessBaggage, type BusinessBaggageValues, CORRELATION_ID_BAGGAGE_KEY, type ClientAttrs, type CloudAttrs, type CodeAttrs, type ConsumerConfig, type ConsumerContext, type ContainerAttrs, type Context, type DBAttrs, type DBConfig, type DefineEventOptions, type DefinedEvent, type DeploymentAttrs, type DeviceAttrs, type DrainOptions, type DrainPipelineOptions, type EnrichContext, type EnricherDefinition, type EnricherOptions, type ErrorAttrs, type ErrorBuildOptions, type ErrorBuilder, type ErrorCatalog, type ErrorCatalogEntry, Event, type EventAttributes, type EventSubscriber, type EventsOptions, type Exception, type ExceptionAttrs, type FaaSAttrs, type FeatureFlagAttrs, FilteringSpanProcessor, type FilteringSpanProcessorOptions, type ForkLifecycle, type ForkOptions, type FunnelStatus, type GraphQLAttrs, HTTPAttributes, type HTTPClientAttrs, type HTTPConfig, type HTTPServerAttrs, type HrTime, type HttpDrainOptions, type HttpDrainRequest, type InstrumentOptions, type K8sAttrs, type LagMetricsConfig, type Link, type MaskFn, type MessagingAttrs, type MessagingConfig, type MessagingOperation, type MessagingSystem, Metric, type MetricsOptions, NORMALIZER_PATTERNS, NORMALIZER_PRESETS, type NetworkAttrs, NeverSampler, type OTelAttrs, type OperationContext, type TraceContext as OtelTraceContext, type OutcomeStatus, type ParsedError, type PeerAttrs, type PipelineDrainFn, type ProcessAttrs, type ProcessHandlersConfig, type ProducerConfig, type ProducerContext, REDACTOR_PATTERNS, REDACTOR_PRESETS, ROOT_CONTEXT, type RPCAttrs, RandomSampler, type RequestLogLevel, type RequestLogSnapshot, type RequestLogger, type RequestLoggerOptions, type SafeBaggageOptions, type SafeBaggageSchema, type Sampler, type SamplingContext, type SamplingPreset, type SchemaLike, type ServerAddressAttrs, ServiceAttributes, type ServiceAttrs, type SessionAttrs, type SingleInstrumentOptions, type Span, type SpanAttributes, type SpanContext, type SpanFilterPredicate, SpanKind, type SpanLink, type SpanNameNormalizerConfig, type SpanNameNormalizerFn, type SpanNameNormalizerPreset, SpanNameNormalizingProcessor, type SpanNameNormalizingProcessorOptions, type SpanOptions, SpanStatusCode, type StepConfig, type StepContext, type StepStatus, type StringRedactor, type StructuredError, type StructuredErrorInput, type TLSAttrs, type TextMapGetter, type TextMapSetter, type ThreadAttrs, type TimeInput, type TraceContext$1 as TraceContext, type TraceFlags, type TraceState, type Tracer, type TracerProvider, URLAttributes, type URLAttrs, type UserAttrs, UserIdSampler, type ValuePatternConfig, type WithBaggageOptions, type WithNewContextOptions, type WorkflowConfig, type WorkflowContext, type WorkflowStatus, 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, extractLinksFromBatch, finalizeSpan, flattenMetadata, flattenToAttributes, flush, formatDuration, generateCorrelationId, getActiveContext, getActiveSpan, getActiveTraceContext, getAutotelTracer, getAutotelTracerProvider, getCatalogCode, getCorrelationId, getCurrentWorkflowContext, getEventQueue, getEvents, getMeter, getMetrics, getOperationContext, getOrCreateCorrelationId, getRequestLogger, getRequestLoggerSafe, getStructuredErrorAttributes, getTraceContext, getTracer, hasRequestContext, httpClient, httpRequestHeaderAttribute, httpResponseHeaderAttribute, httpServer, identify, init, instrument, isCatalogError, isInWorkflow, isInitialized, isLoggerLocked, isTracing, lockLogger, mergeAttrs, mergeServiceResource, normalizeAttributeRedactorConfig, otelTrace, parseError, propagation, recordStructuredError, request, 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 };
675
+ export { AUTOTEL_DEBUG_BAGGAGE_KEY, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, type AttributeGuardrails, type AttributePolicy, AttributeRedactingProcessor, type AttributeRedactingProcessorOptions, type AttributeRedactorConfig, type AttributeRedactorFn, type AttributeRedactorPreset, type AttributeValue, type Attributes, type AuditAction, type AuditCatalog, type AuditCatalogEntry, type AuditDescriptor, type AuditSeverity, type AutotelConfig, type Baggage, type BaggageEntry, type BaggageError, type BaggageFieldDefinition, type BaggageFieldType, BaggageSpanProcessor, type BaggageSpanProcessorOptions, type BuiltinPatternName, BusinessBaggage, type BusinessBaggageValues, CORRELATION_ID_BAGGAGE_KEY, type ClientAttrs, type CloudAttrs, type CodeAttrs, type ConsumerConfig, type ConsumerContext, type ContainerAttrs, type Context, type DBAttrs, type DBConfig, type DefineEventOptions, type DefinedEvent, type DeploymentAttrs, type DeviceAttrs, type DrainOptions, type DrainPipelineOptions, type EnrichContext, type EnricherDefinition, type EnricherOptions, type ErrorAttrs, type ErrorBuildOptions, type ErrorBuilder, type ErrorCatalog, type ErrorCatalogEntry, Event, type EventAttributes, type EventSubscriber, type EventsOptions, type Exception, type ExceptionAttrs, type ExperimentOptions, type FaaSAttrs, type FeatureFlagAttrs, FilteringSpanProcessor, type FilteringSpanProcessorOptions, type ForkLifecycle, type ForkOptions, type FunnelStatus, type GraphQLAttrs, HTTPAttributes, type HTTPClientAttrs, type HTTPConfig, type HTTPServerAttrs, type HrTime, type HttpDrainOptions, type HttpDrainRequest, type InstrumentOptions, type K8sAttrs, type LagMetricsConfig, type Link, type MaskFn, type MessagingAttrs, type MessagingConfig, type MessagingOperation, type MessagingSystem, Metric, type MetricsOptions, NORMALIZER_PATTERNS, NORMALIZER_PRESETS, type NetworkAttrs, NeverSampler, type OTelAttrs, type OperationContext, type TraceContext as OtelTraceContext, type OutcomeStatus, type ParsedError, type PeerAttrs, type PipelineDrainFn, type ProcessAttrs, type ProcessHandlersConfig, type ProducerConfig, type ProducerContext, REDACTOR_PATTERNS, REDACTOR_PRESETS, ROOT_CONTEXT, type RPCAttrs, RandomSampler, type RequestLogLevel, type RequestLogSnapshot, type RequestLogger, type RequestLoggerOptions, type SafeBaggageOptions, type SafeBaggageSchema, type Sampler, type SamplingContext, type SamplingPreset, type SchemaLike, type ServerAddressAttrs, ServiceAttributes, type ServiceAttrs, type SessionAttrs, type SingleInstrumentOptions, type Span, type SpanAttributes, type SpanContext, type SpanFilterPredicate, SpanKind, type SpanLink, type SpanNameNormalizerConfig, type SpanNameNormalizerFn, type SpanNameNormalizerPreset, SpanNameNormalizingProcessor, type SpanNameNormalizingProcessorOptions, type SpanOptions, SpanStatusCode, type StepConfig, type StepContext, type StepStatus, type StringRedactor, type StructuredError, type StructuredErrorInput, type TLSAttrs, type TextMapGetter, type TextMapSetter, type ThreadAttrs, type TimeInput, type TraceContext$1 as TraceContext, type TraceFlags, type TraceState, type Tracer, type TracerProvider, URLAttributes, type URLAttrs, type UserAttrs, UserIdSampler, type ValuePatternConfig, type WithBaggageOptions, type WithNewContextOptions, type WorkflowConfig, type WorkflowContext, type WorkflowStatus, 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, httpClient, httpRequestHeaderAttribute, httpResponseHeaderAttribute, httpServer, identify, init, instrument, isCatalogError, isInWorkflow, isInitialized, isLoggerLocked, isTracing, lockLogger, mergeAttrs, mergeServiceResource, normalizeAttributeRedactorConfig, otelTrace, parseError, propagation, recordStructuredError, request, 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 };
package/dist/index.js CHANGED
@@ -1,15 +1,14 @@
1
1
  import { g as nonEmptyString, i as asNumber, l as asString, r as asFunction, s as asRecord, x as toError } from "./values-BenyvWKz.js";
2
2
  import { getAutotelTracer, getAutotelTracerProvider, setAutotelTracerProvider } from "./tracer-provider.js";
3
- import { AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, NeverSampler, RandomSampler, UserIdSampler, createLinkFromHeaders, extractLinksFromBatch, resolveSamplingPreset, samplingPresets } from "./sampling.js";
4
- import { A as createStringRedactor, 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, j as BaggageSpanProcessor, 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-DDyaLzeg.js";
3
+ import { a as flattenToAttributes, i as structuredErrorToJSON, n as getStructuredErrorAttributes, o as toAttributeValue, r as recordStructuredError, t as createStructuredError } from "./structured-error-YIuka-FE.js";
4
+ import { $ as getOrCreateCorrelationId, B as resolveSamplingPreset, C as AUTOTEL_SAMPLING_TAIL_EVALUATED, E as AlwaysSampler, H as createTraceContext, I as extractLinksFromBatch, J as track, M as RandomSampler, N as UserIdSampler, P as createLinkFromHeaders, T as AdaptiveSampler, U as defineBaggageSchema, V as samplingPresets, X as generateCorrelationId, Y as CORRELATION_ID_BAGGAGE_KEY, Z as getCorrelationId, a as isInitialized, c as flush, d as getEvents, et as runWithCorrelationId, f as resetEvents, i as init, j as NeverSampler, l as shutdown, m as runInOperationContext, nt as setCorrelationIdInBaggage, o as isLoggerLocked, p as getOperationContext, q as getEventQueue, s as lockLogger, tt as setCorrelationId, u as Event, v as createStringRedactor, w as AUTOTEL_SAMPLING_TAIL_KEEP, x as AUTOTEL_DEBUG_BAGGAGE_KEY, y as BaggageSpanProcessor, z as markForceKept } from "./init-DzAdgcFM.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
8
  import { n as formatDuration } from "./canonical-log-line-processor-hFUmS__K.js";
9
- import { a as flattenToAttributes, i as structuredErrorToJSON, n as getStructuredErrorAttributes, o as toAttributeValue, r as recordStructuredError, t as createStructuredError } from "./structured-error-YIuka-FE.js";
10
9
  import { Metric, getMetrics, resetMetrics } from "./metric.js";
10
+ 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-Doi0hFm3.js";
11
11
  import { createDeterministicTraceId, enrichWithTraceContext, finalizeSpan, flattenMetadata, getActiveContext, getActiveSpan, getTraceContext, getTracer, isTracing, resolveTraceUrl, runWithSpan } from "./trace-helpers.js";
12
- 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-nS5U4KCQ.js";
13
12
  import { t as hashJson } from "./stable-hash-BkoAYVks.js";
14
13
  import { t as emitCorrelatedEvent } from "./correlated-events-DwMMbItg.js";
15
14
  import { parseError } from "./parse-error.js";
@@ -25,6 +24,42 @@ import { getCurrentWorkflowContext, isInWorkflow, traceStep, traceWorkflow } fro
25
24
  import { ROOT_CONTEXT, SpanKind, SpanStatusCode, context, propagation, trace as otelTrace, trace as trace$1 } from "@opentelemetry/api";
26
25
  import * as nodeAsyncHooks from "node:async_hooks";
27
26
 
27
+ //#region src/force-keep.ts
28
+ /**
29
+ * Keep this trace whatever the sampler decides.
30
+ *
31
+ * Reach for it where a trace is worth more than the sampling budget: a
32
+ * payment, an audit-relevant action, or a request you are debugging now.
33
+ */
34
+ function forceKeep() {
35
+ const ctx = getActiveTraceContext();
36
+ if (!ctx) return;
37
+ ctx.setAttribute(AUTOTEL_SAMPLING_TAIL_EVALUATED, true);
38
+ ctx.setAttribute(AUTOTEL_SAMPLING_TAIL_KEEP, true);
39
+ const span = getActiveSpan();
40
+ if (span) markForceKept(span);
41
+ }
42
+
43
+ //#endregion
44
+ //#region src/experiment.ts
45
+ /**
46
+ * Record which experiment a unit of work is part of.
47
+ *
48
+ * An experiment needs a guess and a way to check it. Instrumentation gives you
49
+ * the check; this names the guess, so the two cohorts you want to compare are
50
+ * selectable from the telemetry rather than reconstructed by hand afterwards.
51
+ */
52
+ function experiment(options) {
53
+ const ctx = getActiveTraceContext();
54
+ if (!ctx) return;
55
+ ctx.setAttribute("experiment.name", options.name);
56
+ ctx.setAttribute("experiment.variant", options.variant);
57
+ if (options.expect !== void 0) ctx.setAttribute("experiment.expectation", options.expect);
58
+ ctx.setBaggage("experiment.name", options.name);
59
+ ctx.setBaggage("experiment.variant", options.variant);
60
+ }
61
+
62
+ //#endregion
28
63
  //#region src/trace-hybrid.ts
29
64
  /**
30
65
  * Hybrid `trace` export: callable like autotel's `trace(fn)`, AND exposes the
@@ -513,4 +548,4 @@ function defineEnricher(def, options = {}) {
513
548
  }
514
549
 
515
550
  //#endregion
516
- export { 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, extractLinksFromBatch, finalizeSpan, flattenMetadata, flattenToAttributes, flush, formatDuration, generateCorrelationId, getActiveContext, getActiveSpan, getActiveTraceContext, getAutotelTracer, getAutotelTracerProvider, getCatalogCode, getCorrelationId, getCurrentWorkflowContext, getEventQueue, getEvents, getMeter, getMetrics, getOperationContext, getOrCreateCorrelationId, getRequestLogger, getRequestLoggerSafe, getStructuredErrorAttributes, getTraceContext, getTracer, hasRequestContext, httpClient, httpRequestHeaderAttribute, httpResponseHeaderAttribute, httpServer, identify, init, instrument, isCatalogError, isInWorkflow, isInitialized, isLoggerLocked, isTracing, lockLogger, mergeAttrs, mergeServiceResource, normalizeAttributeRedactorConfig, otelTrace, parseError, propagation, recordStructuredError, request, 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, 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, httpClient, httpRequestHeaderAttribute, httpResponseHeaderAttribute, httpServer, identify, init, instrument, isCatalogError, isInWorkflow, isInitialized, isLoggerLocked, isTracing, lockLogger, mergeAttrs, mergeServiceResource, normalizeAttributeRedactorConfig, otelTrace, parseError, propagation, recordStructuredError, request, 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,6 +1,6 @@
1
1
  import { a as AttributeRedactorPreset, r as AttributeRedactorConfig } from "./attribute-redacting-processor-CvBE0z1p.cjs";
2
2
  import { s as Logger } from "./logger-S1Fgl0g3.cjs";
3
- import { h as SamplingPreset, p as Sampler } from "./sampling-CmRdnXUi.cjs";
3
+ import { g as SamplingPreset, m as Sampler } from "./sampling-Er217Mge.cjs";
4
4
  import { o as EventSubscriber } from "./event-subscriber-DMACQA-1.cjs";
5
5
  import { r as SpanFilterPredicate } from "./filtering-span-processor-BpDagWNa.cjs";
6
6
  import { r as Policy } from "./policy-CbpP4tFH.cjs";