autotel 7.10.0 → 7.10.1

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 (44) hide show
  1. package/README.md +2 -0
  2. package/dist/auto.cjs +1 -1
  3. package/dist/auto.js +1 -1
  4. package/dist/correlation-id.cjs +1 -1
  5. package/dist/correlation-id.js +1 -1
  6. package/dist/decorators.cjs +1 -1
  7. package/dist/decorators.js +1 -1
  8. package/dist/event.cjs +1 -1
  9. package/dist/event.js +1 -1
  10. package/dist/{functional-DHn-xGtR.js → functional-C4gGiBou.js} +12 -7
  11. package/dist/{functional-CjZT7Jur.cjs → functional-DptEM9La.cjs} +12 -7
  12. package/dist/functional.cjs +1 -1
  13. package/dist/functional.js +1 -1
  14. package/dist/http.cjs +1 -1
  15. package/dist/http.js +1 -1
  16. package/dist/index.cjs +2 -2
  17. package/dist/index.d.cts +1 -1
  18. package/dist/index.d.ts +1 -1
  19. package/dist/index.js +2 -2
  20. package/dist/{init-DUIFqRRS.d.ts → init-Biyby8Br.d.ts} +3 -1
  21. package/dist/{init-rVPOUqng.js → init-BvUtwZNx.js} +6 -6
  22. package/dist/{init-BtYaU5n9.d.cts → init-CHanKvOq.d.cts} +3 -1
  23. package/dist/{init-zb68UvOW.cjs → init-Cx1-ejLn.cjs} +11 -11
  24. package/dist/instrumentation.cjs +1 -1
  25. package/dist/instrumentation.js +1 -1
  26. package/dist/messaging.cjs +2 -2
  27. package/dist/messaging.js +2 -2
  28. package/dist/sampling.cjs +1 -1
  29. package/dist/sampling.js +1 -1
  30. package/dist/semantic-helpers.cjs +1 -1
  31. package/dist/semantic-helpers.js +1 -1
  32. package/dist/tail-sampling-processor.cjs +1 -1
  33. package/dist/tail-sampling-processor.js +1 -1
  34. package/dist/webhook.cjs +1 -1
  35. package/dist/webhook.js +1 -1
  36. package/dist/workflow-distributed.cjs +1 -1
  37. package/dist/workflow-distributed.js +1 -1
  38. package/dist/workflow.cjs +1 -1
  39. package/dist/workflow.js +1 -1
  40. package/dist/yaml-config.cjs +1 -1
  41. package/dist/yaml-config.d.cts +1 -1
  42. package/dist/yaml-config.d.ts +1 -1
  43. package/dist/yaml-config.js +1 -1
  44. package/package.json +1 -1
package/README.md CHANGED
@@ -656,6 +656,8 @@ export const createUser = withTracing({})(
656
656
 
657
657
  Available helpers: `traceId`, `spanId`, `correlationId`, `setAttribute`, `setAttributes`, `setStatus`, `getBaggage`, `setBaggage`, `deleteBaggage`, `getAllBaggage`.
658
658
 
659
+ An operation that returns normally counts as a success. To report a failure you return as a value, such as an HTTP 502, call `ctx.setStatus({ code: SpanStatusCode.ERROR })` before returning: the span gets `operation.success: false` and `error: true`, and metrics and tail sampling count it as failed.
660
+
659
661
  > **Errors and events:** prefer `recordStructuredError(ctx, error)` and the
660
662
  > request logger over the raw `Span.recordException` / `Span.addEvent` APIs.
661
663
  > See [MIGRATION.md](./MIGRATION.md) for the OTel Span Event deprecation
package/dist/auto.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.cjs');
2
- const require_init = require('./init-zb68UvOW.cjs');
2
+ const require_init = require('./init-Cx1-ejLn.cjs');
3
3
  let node_module = require("node:module");
4
4
  node_module = require_rolldown_runtime.__toESM(node_module, 1);
5
5
  let import_in_the_middle = require("import-in-the-middle");
package/dist/auto.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as loadYamlConfig, a as init } from "./init-rVPOUqng.js";
1
+ import { _ as loadYamlConfig, a as init } from "./init-BvUtwZNx.js";
2
2
  import * as nodeModule from "node:module";
3
3
  import { createAddHookMessageChannel } from "import-in-the-middle";
4
4
 
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_init = require('./init-zb68UvOW.cjs');
2
+ const require_init = require('./init-Cx1-ejLn.cjs');
3
3
 
4
4
  exports.CORRELATION_ID_BAGGAGE_KEY = require_init.CORRELATION_ID_BAGGAGE_KEY;
5
5
  exports.generateCorrelationId = require_init.generateCorrelationId;
@@ -1,3 +1,3 @@
1
- import { $ as generateCorrelationId, Q as CORRELATION_ID_BAGGAGE_KEY, at as setCorrelationIdInBaggage, et as getCorrelationId, it as setCorrelationId, nt as getOrCreateCorrelationId, rt as runWithCorrelationId, tt as getCorrelationStorage } from "./init-rVPOUqng.js";
1
+ import { $ as generateCorrelationId, Q as CORRELATION_ID_BAGGAGE_KEY, at as setCorrelationIdInBaggage, et as getCorrelationId, it as setCorrelationId, nt as getOrCreateCorrelationId, rt as runWithCorrelationId, tt as getCorrelationStorage } from "./init-BvUtwZNx.js";
2
2
 
3
3
  export { CORRELATION_ID_BAGGAGE_KEY, generateCorrelationId, getCorrelationId, getCorrelationStorage, getOrCreateCorrelationId, runWithCorrelationId, setCorrelationId, setCorrelationIdInBaggage };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_init = require('./init-zb68UvOW.cjs');
2
+ const require_init = require('./init-Cx1-ejLn.cjs');
3
3
  const require_values = require('./values-AxGpgYBA.cjs');
4
4
  const require_config = require('./config.cjs');
5
5
  let _opentelemetry_api = require("@opentelemetry/api");
@@ -1,4 +1,4 @@
1
- import { G as createTraceContext } from "./init-rVPOUqng.js";
1
+ import { G as createTraceContext } from "./init-BvUtwZNx.js";
2
2
  import { y as splitNameOrOptions } from "./values-xBtdXtjA.js";
3
3
  import { getConfig } from "./config.js";
4
4
  import { SpanStatusCode } from "@opentelemetry/api";
package/dist/event.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_init = require('./init-zb68UvOW.cjs');
2
+ const require_init = require('./init-Cx1-ejLn.cjs');
3
3
 
4
4
  exports.Event = require_init.Event;
5
5
  exports.getEvents = require_init.getEvents;
package/dist/event.js CHANGED
@@ -1,3 +1,3 @@
1
- import { d as Event, f as getEvents, p as resetEvents } from "./init-rVPOUqng.js";
1
+ import { d as Event, f as getEvents, p as resetEvents } from "./init-BvUtwZNx.js";
2
2
 
3
3
  export { Event, getEvents, resetEvents };
@@ -1,4 +1,4 @@
1
- import { D as AUTOTEL_SAMPLING_TAIL_KEEP, E as AUTOTEL_SAMPLING_TAIL_EVALUATED, G as createTraceContext, J as getContextStorage, R as debugCaptureRequested, T as AUTOTEL_SAMPLING_RATE, V as isForceKept, X as getEventQueue, Y as hasExplicitSpanStatus, b as getRequestSpanIn, h as runInOperationContext, i as getSdk, k as AlwaysSampler, n as getConfiguredSampler, q as getActiveContextWithBaggage, t as getConfig, x as rememberRequestAttributes } from "./init-rVPOUqng.js";
1
+ import { D as AUTOTEL_SAMPLING_TAIL_KEEP, E as AUTOTEL_SAMPLING_TAIL_EVALUATED, G as createTraceContext, J as getActiveContextWithBaggage, R as debugCaptureRequested, T as AUTOTEL_SAMPLING_RATE, V as isForceKept, X as getEventQueue, Y as getContextStorage, b as getRequestSpanIn, h as runInOperationContext, i as getSdk, k as AlwaysSampler, n as getConfiguredSampler, q as explicitSpanStatus, t as getConfig, x as rememberRequestAttributes } from "./init-BvUtwZNx.js";
2
2
  import { l as asString, m as isDevelopment } from "./values-xBtdXtjA.js";
3
3
  import { getForceFlushableProvider } from "./tracer-provider.js";
4
4
  import { getConfig as getConfig$1 } from "./config.js";
@@ -373,7 +373,8 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
373
373
  return promiseFromThenable(unsampled) ?? unsampled;
374
374
  }
375
375
  const startTime = performance.now();
376
- const flushRootTelemetry = createRootTelemetryFlusher(options, options.startNewRoot || trace.getActiveSpan() === void 0);
376
+ const activeSpan = trace.getActiveSpan();
377
+ const flushRootTelemetry = createRootTelemetryFlusher(options, options.startNewRoot || activeSpan === void 0 || activeSpan.spanContext().isRemote === true);
377
378
  const spanOptions = {};
378
379
  if (options.startNewRoot) spanOptions.root = true;
379
380
  if (options.spanKind !== void 0) spanOptions.kind = options.spanKind;
@@ -400,28 +401,32 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
400
401
  };
401
402
  const onSuccess = (result) => {
402
403
  const duration = performance.now() - startTime;
404
+ const explicitStatus = explicitSpanStatus(span);
405
+ const success = explicitStatus !== SpanStatusCode.ERROR;
406
+ const status = success ? "success" : "error";
403
407
  callCounter?.add(1, {
404
408
  operation: spanName,
405
- status: "success"
409
+ status
406
410
  });
407
411
  durationHistogram?.record(duration, {
408
412
  operation: spanName,
409
- status: "success"
413
+ status
410
414
  });
411
415
  const resultAttributes = {
412
416
  ...captureOutputAttrs(result, options.captureOutput),
413
417
  ...options.attributesFromResult?.(result)
414
418
  };
415
- if (!hasExplicitSpanStatus(span)) span.setStatus({ code: SpanStatusCode.OK });
419
+ if (explicitStatus === void 0) span.setStatus({ code: SpanStatusCode.OK });
416
420
  span.setAttributes({
417
421
  ...argsAttributes,
418
422
  ...resultAttributes,
419
423
  "operation.name": spanName,
420
424
  "code.function": spanName,
421
425
  "operation.duration": duration,
422
- "operation.success": true
426
+ "operation.success": success,
427
+ ...success ? {} : { error: true }
423
428
  });
424
- handleTailSampling(true, duration);
429
+ handleTailSampling(success, duration);
425
430
  span.end();
426
431
  return result;
427
432
  };
@@ -1,5 +1,5 @@
1
1
  const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.cjs');
2
- const require_init = require('./init-zb68UvOW.cjs');
2
+ const require_init = require('./init-Cx1-ejLn.cjs');
3
3
  const require_values = require('./values-AxGpgYBA.cjs');
4
4
  const require_tracer_provider = require('./tracer-provider.cjs');
5
5
  const require_config = require('./config.cjs');
@@ -376,7 +376,8 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
376
376
  return promiseFromThenable(unsampled) ?? unsampled;
377
377
  }
378
378
  const startTime = performance.now();
379
- const flushRootTelemetry = createRootTelemetryFlusher(options, options.startNewRoot || _opentelemetry_api.trace.getActiveSpan() === void 0);
379
+ const activeSpan = _opentelemetry_api.trace.getActiveSpan();
380
+ const flushRootTelemetry = createRootTelemetryFlusher(options, options.startNewRoot || activeSpan === void 0 || activeSpan.spanContext().isRemote === true);
380
381
  const spanOptions = {};
381
382
  if (options.startNewRoot) spanOptions.root = true;
382
383
  if (options.spanKind !== void 0) spanOptions.kind = options.spanKind;
@@ -403,28 +404,32 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
403
404
  };
404
405
  const onSuccess = (result) => {
405
406
  const duration = performance.now() - startTime;
407
+ const explicitStatus = require_init.explicitSpanStatus(span);
408
+ const success = explicitStatus !== _opentelemetry_api.SpanStatusCode.ERROR;
409
+ const status = success ? "success" : "error";
406
410
  callCounter?.add(1, {
407
411
  operation: spanName,
408
- status: "success"
412
+ status
409
413
  });
410
414
  durationHistogram?.record(duration, {
411
415
  operation: spanName,
412
- status: "success"
416
+ status
413
417
  });
414
418
  const resultAttributes = {
415
419
  ...captureOutputAttrs(result, options.captureOutput),
416
420
  ...options.attributesFromResult?.(result)
417
421
  };
418
- if (!require_init.hasExplicitSpanStatus(span)) span.setStatus({ code: _opentelemetry_api.SpanStatusCode.OK });
422
+ if (explicitStatus === void 0) span.setStatus({ code: _opentelemetry_api.SpanStatusCode.OK });
419
423
  span.setAttributes({
420
424
  ...argsAttributes,
421
425
  ...resultAttributes,
422
426
  "operation.name": spanName,
423
427
  "code.function": spanName,
424
428
  "operation.duration": duration,
425
- "operation.success": true
429
+ "operation.success": success,
430
+ ...success ? {} : { error: true }
426
431
  });
427
- handleTailSampling(true, duration);
432
+ handleTailSampling(success, duration);
428
433
  span.end();
429
434
  return result;
430
435
  };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_functional = require('./functional-CjZT7Jur.cjs');
2
+ const require_functional = require('./functional-DptEM9La.cjs');
3
3
 
4
4
  exports.ctx = require_functional.ctx;
5
5
  exports.getActiveTraceContext = require_functional.getActiveTraceContext;
@@ -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-DHn-xGtR.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-C4gGiBou.js";
2
2
 
3
3
  export { ctx, getActiveTraceContext, instrument, requestCtx, span, trace, withBaggage, withNewContext, withTracing };
package/dist/http.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_init = require('./init-zb68UvOW.cjs');
2
+ const require_init = require('./init-Cx1-ejLn.cjs');
3
3
  const require_values = require('./values-AxGpgYBA.cjs');
4
4
  const require_config = require('./config.cjs');
5
5
  let _opentelemetry_api = require("@opentelemetry/api");
package/dist/http.js CHANGED
@@ -1,4 +1,4 @@
1
- import { q as getActiveContextWithBaggage } from "./init-rVPOUqng.js";
1
+ import { J as getActiveContextWithBaggage } from "./init-BvUtwZNx.js";
2
2
  import { _ as readProperty, h as isFunction, i as asNumber, l as asString } from "./values-xBtdXtjA.js";
3
3
  import { getConfig } from "./config.js";
4
4
  import { SpanStatusCode, context, propagation } from "@opentelemetry/api";
package/dist/index.cjs CHANGED
@@ -1,6 +1,6 @@
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-zb68UvOW.cjs');
3
+ const require_init = require('./init-Cx1-ejLn.cjs');
4
4
  const require_values = require('./values-AxGpgYBA.cjs');
5
5
  const require_tracer_provider = require('./tracer-provider.cjs');
6
6
  const require_structured_error = require('./structured-error-DynjWTTu.cjs');
@@ -9,7 +9,7 @@ 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-BU03jJeA.cjs');
11
11
  const require_metric = require('./metric.cjs');
12
- const require_functional = require('./functional-CjZT7Jur.cjs');
12
+ const require_functional = require('./functional-DptEM9La.cjs');
13
13
  const require_trace_helpers = require('./trace-helpers.cjs');
14
14
  const require_stable_hash = require('./stable-hash-sLi1o4jj.cjs');
15
15
  const require_correlated_events = require('./correlated-events-DE_4A3oD.cjs');
package/dist/index.d.cts CHANGED
@@ -10,7 +10,7 @@ import { DrainPipelineOptions, PipelineDrainFn, createDrainPipeline } from "./dr
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-BtYaU5n9.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";
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-DLeAQjgb.cjs";
16
16
  import { i as defineEvent, n as DefinedEvent, r as SchemaLike, t as DefineEventOptions } from "./define-event-BNeuKUPv.cjs";
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@ import { DrainPipelineOptions, PipelineDrainFn, createDrainPipeline } from "./dr
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-DUIFqRRS.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";
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
15
  import "./canonical-log-line-processor-DDGzm-wi.js";
16
16
  import { i as defineEvent, n as DefinedEvent, r as SchemaLike, t as DefineEventOptions } from "./define-event-Bd8f8mST.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
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-rVPOUqng.js";
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
2
  import { g as nonEmptyString, i as asNumber, l as asString, r as asFunction, s as asRecord, x as toError } from "./values-xBtdXtjA.js";
3
3
  import { getAutotelTracer, getAutotelTracerProvider, hasTracerProvider, setAutotelTracerProvider } from "./tracer-provider.js";
4
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";
@@ -7,7 +7,7 @@ import { NORMALIZER_PATTERNS, NORMALIZER_PRESETS, SpanNameNormalizingProcessor }
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-BQ6NeZAk.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-DHn-xGtR.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";
11
11
  import { createDeterministicTraceId, enrichWithTraceContext, finalizeSpan, flattenMetadata, getActiveContext, getActiveSpan, getTraceContext, getTracer, isTracing, resolveTraceUrl, runWithSpan } from "./trace-helpers.js";
12
12
  import { t as hashJson } from "./stable-hash-AOUgw1DW.js";
13
13
  import { t as emitCorrelatedEvent } from "./correlated-events-BfpH5uS-.js";
@@ -919,7 +919,9 @@ interface AutotelConfig {
919
919
  * - true: Flush on root span completion (default)
920
920
  * - false: Use batching (events flush every 10 seconds automatically)
921
921
  *
922
- * Only flushes on root spans to avoid excessive network calls.
922
+ * Only flushes on root spans to avoid excessive network calls. A span whose
923
+ * parent arrived from another process (an extracted `traceparent`) counts as
924
+ * a root, so a server flushes once per incoming request.
923
925
  * Default is true for serverless/short-lived processes. Set to false
924
926
  * for long-running services where batching is more efficient.
925
927
  */
@@ -1075,10 +1075,10 @@ function resetEventQueue() {
1075
1075
 
1076
1076
  //#endregion
1077
1077
  //#region src/trace-context.ts
1078
- const spansWithExplicitStatus = /* @__PURE__ */ new WeakSet();
1079
- /** Whether a TraceContext consumer explicitly chose this span's status. */
1080
- function hasExplicitSpanStatus(span) {
1081
- return spansWithExplicitStatus.has(span);
1078
+ const explicitSpanStatuses = /* @__PURE__ */ new WeakMap();
1079
+ /** The status a TraceContext consumer explicitly chose for this span, if any. */
1080
+ function explicitSpanStatus(span) {
1081
+ return explicitSpanStatuses.get(span);
1082
1082
  }
1083
1083
  /**
1084
1084
  * AsyncLocalStorage for storing the active context with baggage
@@ -1166,7 +1166,7 @@ function createTraceContext(span) {
1166
1166
  span.setAttributes(flattenToAttributes(attrs));
1167
1167
  },
1168
1168
  setStatus: (status) => {
1169
- spansWithExplicitStatus.add(span);
1169
+ explicitSpanStatuses.set(span, status.code);
1170
1170
  span.setStatus(status);
1171
1171
  },
1172
1172
  recordException: span.recordException.bind(span),
@@ -4623,4 +4623,4 @@ function getSdk() {
4623
4623
  }
4624
4624
 
4625
4625
  //#endregion
4626
- export { generateCorrelationId as $, CompositeSampler as A, hashUnitInterval as B, TailSamplingSpanProcessor as C, AUTOTEL_SAMPLING_TAIL_KEEP as D, AUTOTEL_SAMPLING_TAIL_EVALUATED as E, RandomSampler as F, createTraceContext as G, markForceKept as H, UserIdSampler as I, getContextStorage as J, defineBaggageSchema as K, createLinkFromHeaders as L, FeatureFlagSampler as M, KeyTargetRateSampler as N, AdaptiveSampler as O, NeverSampler as P, CORRELATION_ID_BAGGAGE_KEY as Q, debugCaptureRequested as R, BaggageSpanProcessor as S, AUTOTEL_SAMPLING_RATE as T, resolveSamplingPreset as U, isForceKept as V, samplingPresets as W, getEventQueue as X, hasExplicitSpanStatus as Y, track as Z, loadYamlConfig as _, init as a, setCorrelationIdInBaggage as at, getRequestSpanIn as b, lockLogger as c, Event as d, getCorrelationId as et, getEvents as f, hasYamlConfig as g, runInOperationContext as h, getSdk as i, setCorrelationId as it, DeterministicSampler as j, AlwaysSampler as k, flush as l, getOperationContext as m, getConfiguredSampler as n, getOrCreateCorrelationId as nt, isInitialized as o, resetEvents as p, getActiveContextWithBaggage as q, getLogger as r, runWithCorrelationId as rt, isLoggerLocked as s, getConfig as t, getCorrelationStorage as tt, shutdown as u, loadYamlConfigFromFile as v, AUTOTEL_DEBUG_BAGGAGE_KEY as w, rememberRequestAttributes as x, createStringRedactor as y, extractLinksFromBatch as z };
4626
+ export { generateCorrelationId as $, CompositeSampler as A, hashUnitInterval as B, TailSamplingSpanProcessor as C, AUTOTEL_SAMPLING_TAIL_KEEP as D, AUTOTEL_SAMPLING_TAIL_EVALUATED as E, RandomSampler as F, createTraceContext as G, markForceKept as H, UserIdSampler as I, getActiveContextWithBaggage as J, defineBaggageSchema as K, createLinkFromHeaders as L, FeatureFlagSampler as M, KeyTargetRateSampler as N, AdaptiveSampler as O, NeverSampler as P, CORRELATION_ID_BAGGAGE_KEY as Q, debugCaptureRequested as R, BaggageSpanProcessor as S, AUTOTEL_SAMPLING_RATE as T, resolveSamplingPreset as U, isForceKept as V, samplingPresets as W, getEventQueue as X, getContextStorage as Y, track as Z, loadYamlConfig as _, init as a, setCorrelationIdInBaggage as at, getRequestSpanIn as b, lockLogger as c, Event as d, getCorrelationId as et, getEvents as f, hasYamlConfig as g, runInOperationContext as h, getSdk as i, setCorrelationId as it, DeterministicSampler as j, AlwaysSampler as k, flush as l, getOperationContext as m, getConfiguredSampler as n, getOrCreateCorrelationId as nt, isInitialized as o, resetEvents as p, explicitSpanStatus as q, getLogger as r, runWithCorrelationId as rt, isLoggerLocked as s, getConfig as t, getCorrelationStorage as tt, shutdown as u, loadYamlConfigFromFile as v, AUTOTEL_DEBUG_BAGGAGE_KEY as w, rememberRequestAttributes as x, createStringRedactor as y, extractLinksFromBatch as z };
@@ -919,7 +919,9 @@ interface AutotelConfig {
919
919
  * - true: Flush on root span completion (default)
920
920
  * - false: Use batching (events flush every 10 seconds automatically)
921
921
  *
922
- * Only flushes on root spans to avoid excessive network calls.
922
+ * Only flushes on root spans to avoid excessive network calls. A span whose
923
+ * parent arrived from another process (an extracted `traceparent`) counts as
924
+ * a root, so a server flushes once per incoming request.
923
925
  * Default is true for serverless/short-lived processes. Set to false
924
926
  * for long-running services where batching is more efficient.
925
927
  */
@@ -1080,10 +1080,10 @@ function resetEventQueue() {
1080
1080
 
1081
1081
  //#endregion
1082
1082
  //#region src/trace-context.ts
1083
- const spansWithExplicitStatus = /* @__PURE__ */ new WeakSet();
1084
- /** Whether a TraceContext consumer explicitly chose this span's status. */
1085
- function hasExplicitSpanStatus(span) {
1086
- return spansWithExplicitStatus.has(span);
1083
+ const explicitSpanStatuses = /* @__PURE__ */ new WeakMap();
1084
+ /** The status a TraceContext consumer explicitly chose for this span, if any. */
1085
+ function explicitSpanStatus(span) {
1086
+ return explicitSpanStatuses.get(span);
1087
1087
  }
1088
1088
  /**
1089
1089
  * AsyncLocalStorage for storing the active context with baggage
@@ -1171,7 +1171,7 @@ function createTraceContext(span) {
1171
1171
  span.setAttributes(require_structured_error.flattenToAttributes(attrs));
1172
1172
  },
1173
1173
  setStatus: (status) => {
1174
- spansWithExplicitStatus.add(span);
1174
+ explicitSpanStatuses.set(span, status.code);
1175
1175
  span.setStatus(status);
1176
1176
  },
1177
1177
  recordException: span.recordException.bind(span),
@@ -4760,6 +4760,12 @@ Object.defineProperty(exports, 'defineBaggageSchema', {
4760
4760
  return defineBaggageSchema;
4761
4761
  }
4762
4762
  });
4763
+ Object.defineProperty(exports, 'explicitSpanStatus', {
4764
+ enumerable: true,
4765
+ get: function () {
4766
+ return explicitSpanStatus;
4767
+ }
4768
+ });
4763
4769
  Object.defineProperty(exports, 'extractLinksFromBatch', {
4764
4770
  enumerable: true,
4765
4771
  get: function () {
@@ -4856,12 +4862,6 @@ Object.defineProperty(exports, 'getSdk', {
4856
4862
  return getSdk;
4857
4863
  }
4858
4864
  });
4859
- Object.defineProperty(exports, 'hasExplicitSpanStatus', {
4860
- enumerable: true,
4861
- get: function () {
4862
- return hasExplicitSpanStatus;
4863
- }
4864
- });
4865
4865
  Object.defineProperty(exports, 'hasYamlConfig', {
4866
4866
  enumerable: true,
4867
4867
  get: function () {
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_init = require('./init-zb68UvOW.cjs');
2
+ const require_init = require('./init-Cx1-ejLn.cjs');
3
3
  const require_node_require = require('./node-require-BPsB09eC.cjs');
4
4
  let _opentelemetry_resources = require("@opentelemetry/resources");
5
5
  let _opentelemetry_exporter_logs_otlp_http = require("@opentelemetry/exporter-logs-otlp-http");
@@ -1,4 +1,4 @@
1
- import { C as TailSamplingSpanProcessor, r as getLogger } from "./init-rVPOUqng.js";
1
+ import { C as TailSamplingSpanProcessor, r as getLogger } from "./init-BvUtwZNx.js";
2
2
  import { n as safeRequire, t as requireModule } from "./node-require-CkK_xzL-.js";
3
3
  import { detectResources, hostDetector, processDetector, resourceFromAttributes } from "@opentelemetry/resources";
4
4
  import { OTLPLogExporter } from "@opentelemetry/exporter-logs-otlp-http";
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_init = require('./init-zb68UvOW.cjs');
2
+ const require_init = require('./init-Cx1-ejLn.cjs');
3
3
  const require_values = require('./values-AxGpgYBA.cjs');
4
- const require_functional = require('./functional-CjZT7Jur.cjs');
4
+ const require_functional = require('./functional-DptEM9La.cjs');
5
5
  const require_correlated_events = require('./correlated-events-DE_4A3oD.cjs');
6
6
  const require_trace_factory_validation = require('./trace-factory-validation-CHU1WcjK.cjs');
7
7
  let _opentelemetry_api = require("@opentelemetry/api");
package/dist/messaging.js CHANGED
@@ -1,6 +1,6 @@
1
- import { L as createLinkFromHeaders, z as extractLinksFromBatch } from "./init-rVPOUqng.js";
1
+ import { L as createLinkFromHeaders, z as extractLinksFromBatch } from "./init-BvUtwZNx.js";
2
2
  import { _ as readProperty, b as toAttributeValue, c as asScalar, g as nonEmptyString, h as isFunction, s as asRecord, v as resolveValue, y as splitNameOrOptions } from "./values-xBtdXtjA.js";
3
- import { l as withTracing } from "./functional-DHn-xGtR.js";
3
+ import { l as withTracing } from "./functional-C4gGiBou.js";
4
4
  import { t as emitCorrelatedEvent } from "./correlated-events-BfpH5uS-.js";
5
5
  import { t as assertTraceFactory } from "./trace-factory-validation-BjVAinz6.js";
6
6
  import { SpanKind, context, propagation } from "@opentelemetry/api";
package/dist/sampling.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_init = require('./init-zb68UvOW.cjs');
2
+ const require_init = require('./init-Cx1-ejLn.cjs');
3
3
 
4
4
  exports.AUTOTEL_DEBUG_BAGGAGE_KEY = require_init.AUTOTEL_DEBUG_BAGGAGE_KEY;
5
5
  exports.AUTOTEL_SAMPLING_RATE = require_init.AUTOTEL_SAMPLING_RATE;
package/dist/sampling.js CHANGED
@@ -1,3 +1,3 @@
1
- import { A as CompositeSampler, B as hashUnitInterval, D as AUTOTEL_SAMPLING_TAIL_KEEP, E as AUTOTEL_SAMPLING_TAIL_EVALUATED, F as RandomSampler, H as markForceKept, I as UserIdSampler, L as createLinkFromHeaders, M as FeatureFlagSampler, N as KeyTargetRateSampler, O as AdaptiveSampler, P as NeverSampler, R as debugCaptureRequested, T as AUTOTEL_SAMPLING_RATE, U as resolveSamplingPreset, V as isForceKept, W as samplingPresets, j as DeterministicSampler, k as AlwaysSampler, w as AUTOTEL_DEBUG_BAGGAGE_KEY, z as extractLinksFromBatch } from "./init-rVPOUqng.js";
1
+ import { A as CompositeSampler, B as hashUnitInterval, D as AUTOTEL_SAMPLING_TAIL_KEEP, E as AUTOTEL_SAMPLING_TAIL_EVALUATED, F as RandomSampler, H as markForceKept, I as UserIdSampler, L as createLinkFromHeaders, M as FeatureFlagSampler, N as KeyTargetRateSampler, O as AdaptiveSampler, P as NeverSampler, R as debugCaptureRequested, T as AUTOTEL_SAMPLING_RATE, U as resolveSamplingPreset, V as isForceKept, W as samplingPresets, j as DeterministicSampler, k as AlwaysSampler, w as AUTOTEL_DEBUG_BAGGAGE_KEY, z as extractLinksFromBatch } from "./init-BvUtwZNx.js";
2
2
 
3
3
  export { AUTOTEL_DEBUG_BAGGAGE_KEY, AUTOTEL_SAMPLING_RATE, AUTOTEL_SAMPLING_TAIL_EVALUATED, AUTOTEL_SAMPLING_TAIL_KEEP, AdaptiveSampler, AlwaysSampler, CompositeSampler, DeterministicSampler, FeatureFlagSampler, KeyTargetRateSampler, NeverSampler, RandomSampler, UserIdSampler, createLinkFromHeaders, debugCaptureRequested, extractLinksFromBatch, hashUnitInterval, isForceKept, markForceKept, resolveSamplingPreset, samplingPresets };
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_values = require('./values-AxGpgYBA.cjs');
3
- const require_functional = require('./functional-CjZT7Jur.cjs');
3
+ const require_functional = require('./functional-DptEM9La.cjs');
4
4
  const require_trace_factory_validation = require('./trace-factory-validation-CHU1WcjK.cjs');
5
5
  let _opentelemetry_api = require("@opentelemetry/api");
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { b as toAttributeValue, g as nonEmptyString, s as asRecord } from "./values-xBtdXtjA.js";
2
- import { l as withTracing } from "./functional-DHn-xGtR.js";
2
+ import { l as withTracing } from "./functional-C4gGiBou.js";
3
3
  import { t as assertTraceFactory } from "./trace-factory-validation-BjVAinz6.js";
4
4
  import { SpanKind } from "@opentelemetry/api";
5
5
 
@@ -1,4 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_init = require('./init-zb68UvOW.cjs');
2
+ const require_init = require('./init-Cx1-ejLn.cjs');
3
3
 
4
4
  exports.TailSamplingSpanProcessor = require_init.TailSamplingSpanProcessor;
@@ -1,3 +1,3 @@
1
- import { C as TailSamplingSpanProcessor } from "./init-rVPOUqng.js";
1
+ import { C as TailSamplingSpanProcessor } from "./init-BvUtwZNx.js";
2
2
 
3
3
  export { TailSamplingSpanProcessor };
package/dist/webhook.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_structured_error = require('./structured-error-DynjWTTu.cjs');
3
- const require_functional = require('./functional-CjZT7Jur.cjs');
3
+ const require_functional = require('./functional-DptEM9La.cjs');
4
4
  const require_correlated_events = require('./correlated-events-DE_4A3oD.cjs');
5
5
  let _opentelemetry_api = require("@opentelemetry/api");
6
6
 
package/dist/webhook.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { r as recordStructuredError } from "./structured-error-Y9y-1Pae.js";
2
- import { l as withTracing } from "./functional-DHn-xGtR.js";
2
+ import { l as withTracing } from "./functional-C4gGiBou.js";
3
3
  import { t as emitCorrelatedEvent } from "./correlated-events-BfpH5uS-.js";
4
4
  import { SpanKind, trace } from "@opentelemetry/api";
5
5
 
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_values = require('./values-AxGpgYBA.cjs');
3
- const require_functional = require('./functional-CjZT7Jur.cjs');
3
+ const require_functional = require('./functional-DptEM9La.cjs');
4
4
  const require_correlated_events = require('./correlated-events-DE_4A3oD.cjs');
5
5
  const require_business_baggage = require('./business-baggage.cjs');
6
6
  let _opentelemetry_api = require("@opentelemetry/api");
@@ -1,5 +1,5 @@
1
1
  import { h as isFunction, x as toError } from "./values-xBtdXtjA.js";
2
- import { l as withTracing } from "./functional-DHn-xGtR.js";
2
+ import { l as withTracing } from "./functional-C4gGiBou.js";
3
3
  import { t as emitCorrelatedEvent } from "./correlated-events-BfpH5uS-.js";
4
4
  import { createSafeBaggageSchema } from "./business-baggage.js";
5
5
  import { SpanKind, context, propagation } from "@opentelemetry/api";
package/dist/workflow.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.cjs');
3
3
  const require_values = require('./values-AxGpgYBA.cjs');
4
- const require_functional = require('./functional-CjZT7Jur.cjs');
4
+ const require_functional = require('./functional-DptEM9La.cjs');
5
5
  const require_trace_helpers = require('./trace-helpers.cjs');
6
6
  const require_correlated_events = require('./correlated-events-DE_4A3oD.cjs');
7
7
  const require_trace_factory_validation = require('./trace-factory-validation-CHU1WcjK.cjs');
package/dist/workflow.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { b as toAttributeValue, g as nonEmptyString, h as isFunction, l as asString, s as asRecord, x as toError } from "./values-xBtdXtjA.js";
2
- import { l as withTracing } from "./functional-DHn-xGtR.js";
2
+ import { l as withTracing } from "./functional-C4gGiBou.js";
3
3
  import { getActiveSpan } from "./trace-helpers.js";
4
4
  import { t as emitCorrelatedEvent } from "./correlated-events-BfpH5uS-.js";
5
5
  import { t as assertTraceFactory } from "./trace-factory-validation-BjVAinz6.js";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_init = require('./init-zb68UvOW.cjs');
2
+ const require_init = require('./init-Cx1-ejLn.cjs');
3
3
 
4
4
  exports.hasYamlConfig = require_init.hasYamlConfig;
5
5
  exports.loadYamlConfig = require_init.loadYamlConfig;
@@ -1,5 +1,5 @@
1
1
  import { g as SamplingPreset } from "./sampling-Dud4XU2m.cjs";
2
- import { a as AutotelConfig, o as OtlpSignal } from "./init-BtYaU5n9.cjs";
2
+ import { a as AutotelConfig, o as OtlpSignal } from "./init-CHanKvOq.cjs";
3
3
  //#region src/yaml-config.d.ts
4
4
  /** A value as a YAML document carries it: scalars, sequences, mappings. */
5
5
  export type YamlValue = string | number | boolean | null | YamlValue[] | YamlMapping;
@@ -1,5 +1,5 @@
1
1
  import { g as SamplingPreset } from "./sampling-B_8orhSB.js";
2
- import { a as AutotelConfig, o as OtlpSignal } from "./init-DUIFqRRS.js";
2
+ import { a as AutotelConfig, o as OtlpSignal } from "./init-Biyby8Br.js";
3
3
  //#region src/yaml-config.d.ts
4
4
  /** A value as a YAML document carries it: scalars, sequences, mappings. */
5
5
  export type YamlValue = string | number | boolean | null | YamlValue[] | YamlMapping;
@@ -1,3 +1,3 @@
1
- import { _ as loadYamlConfig, g as hasYamlConfig, v as loadYamlConfigFromFile } from "./init-rVPOUqng.js";
1
+ import { _ as loadYamlConfig, g as hasYamlConfig, v as loadYamlConfigFromFile } from "./init-BvUtwZNx.js";
2
2
 
3
3
  export { hasYamlConfig, loadYamlConfig, loadYamlConfigFromFile };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autotel",
3
- "version": "7.10.0",
3
+ "version": "7.10.1",
4
4
  "description": "Write Once, Observe Anywhere",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",