autotel 7.7.1 → 7.9.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 (111) hide show
  1. package/dist/analysis.cjs +0 -1
  2. package/dist/{attribute-redacting-processor-CvBE0z1p.d.ts → attribute-redacting-processor-rkV_WL-k.d.ts} +2 -2
  3. package/dist/attribute-redacting-processor.cjs +1 -1
  4. package/dist/attribute-redacting-processor.d.ts +1 -1
  5. package/dist/{attributes-De9Fx0b4.js → attributes-CuGx6cOI.js} +21 -11
  6. package/dist/{attributes-DkptT2Ck.cjs → attributes-Ii3jDPsW.cjs} +23 -13
  7. package/dist/attributes.cjs +1 -1
  8. package/dist/attributes.d.ts +1 -1
  9. package/dist/attributes.js +1 -1
  10. package/dist/auto.cjs +2 -2
  11. package/dist/auto.js +1 -1
  12. package/dist/business-baggage.cjs +1 -1
  13. package/dist/{canonical-log-line-processor-Bvgb1lE4.cjs → canonical-log-line-processor-BU03jJeA.cjs} +1 -1
  14. package/dist/{canonical-log-line-processor-Yq4cXcD5.d.ts → canonical-log-line-processor-Bwrt_L4c.d.ts} +1 -1
  15. package/dist/{correlated-events-9RRdfyWR.cjs → correlated-events-DE_4A3oD.cjs} +1 -1
  16. package/dist/correlation-id.cjs +1 -1
  17. package/dist/correlation-id.js +1 -1
  18. package/dist/db.cjs +1 -1
  19. package/dist/decorators.cjs +2 -2
  20. package/dist/decorators.d.cts +1 -1
  21. package/dist/decorators.d.ts +1 -1
  22. package/dist/decorators.js +1 -1
  23. package/dist/diagnostics.cjs +3 -3
  24. package/dist/diagnostics.js +1 -1
  25. package/dist/drain-pipeline.cjs +0 -1
  26. package/dist/enrichers.cjs +0 -1
  27. package/dist/event-testing.cjs +0 -1
  28. package/dist/event.cjs +1 -1
  29. package/dist/event.js +1 -1
  30. package/dist/evidence.cjs +0 -1
  31. package/dist/exception-fingerprint.cjs +1 -1
  32. package/dist/{filtering-span-processor-BpDagWNa.d.ts → filtering-span-processor-vkewzbqB.d.ts} +2 -2
  33. package/dist/filtering-span-processor.cjs +0 -1
  34. package/dist/filtering-span-processor.d.ts +1 -1
  35. package/dist/{functional-S9IJNlBn.js → functional-6QPJDqUW.js} +27 -29
  36. package/dist/{functional-C4mjgtJb.d.cts → functional-DPZTpGh6.d.cts} +2 -2
  37. package/dist/{functional-UIJ0CaTV.cjs → functional-DxHvvWc_.cjs} +19 -21
  38. package/dist/{functional-DN_ztd9C.d.ts → functional-SeRUabkE.d.ts} +2 -2
  39. package/dist/functional.cjs +1 -1
  40. package/dist/functional.d.cts +1 -1
  41. package/dist/functional.d.ts +1 -1
  42. package/dist/functional.js +1 -1
  43. package/dist/http.cjs +2 -2
  44. package/dist/http.js +1 -1
  45. package/dist/{index-o_6YjZhV.d.ts → index-B9aRLp6c.d.ts} +1 -1
  46. package/dist/index.cjs +10 -10
  47. package/dist/index.d.cts +3 -3
  48. package/dist/index.d.ts +10 -10
  49. package/dist/index.js +3 -3
  50. package/dist/{init-Dyq6WtsO.js → init-C-qfxo_u.js} +262 -36
  51. package/dist/{init-WwjD-kQu.d.cts → init-COfMwKbc.d.cts} +38 -10
  52. package/dist/{init-CKSMbJUG.d.ts → init-CnoRlJqS.d.ts} +43 -15
  53. package/dist/{init-BYXDCfRL.cjs → init-W_klPrYk.cjs} +277 -39
  54. package/dist/instrumentation.cjs +9 -8
  55. package/dist/instrumentation.js +8 -7
  56. package/dist/{logger-CSdZkxbh.cjs → logger-DLjHQAus.cjs} +1 -1
  57. package/dist/logger.cjs +1 -1
  58. package/dist/messaging-adapters.cjs +1 -1
  59. package/dist/messaging-testing.cjs +0 -1
  60. package/dist/messaging.cjs +8 -7
  61. package/dist/messaging.js +5 -4
  62. package/dist/metric-testing.cjs +0 -1
  63. package/dist/{node-require-B_IVapV3.cjs → node-require-BPsB09eC.cjs} +2 -2
  64. package/dist/parse-error.cjs +1 -1
  65. package/dist/{policy-C4QcZnqv.d.ts → policy-DNw_0qUq.d.ts} +1 -1
  66. package/dist/policy.cjs +0 -0
  67. package/dist/policy.d.ts +1 -1
  68. package/dist/processors.cjs +1 -1
  69. package/dist/processors.d.ts +1 -1
  70. package/dist/register.cjs +1 -1
  71. package/dist/{registry-DIoklBz5.cjs → registry-B3ZJmUtU.cjs} +0 -1
  72. package/dist/{rolldown-runtime-C_NdSu1c.cjs → rolldown-runtime-C24Yb2bl.cjs} +1 -2
  73. package/dist/{sampling-DBng4Foa.d.ts → sampling-CZi7OM9u.d.ts} +13 -13
  74. package/dist/{sampling-Er217Mge.d.cts → sampling-DENUjT_8.d.cts} +13 -13
  75. package/dist/sampling.cjs +1 -1
  76. package/dist/sampling.d.cts +1 -1
  77. package/dist/sampling.d.ts +1 -1
  78. package/dist/sampling.js +1 -1
  79. package/dist/security-schema.cjs +0 -1
  80. package/dist/semantic-conventions.cjs +1 -1
  81. package/dist/semantic-helpers.cjs +3 -3
  82. package/dist/semantic-helpers.js +1 -1
  83. package/dist/{span-name-normalizer-CN1-8C76.d.ts → span-name-normalizer-DHcg1bSP.d.ts} +2 -2
  84. package/dist/span-name-normalizer.cjs +0 -1
  85. package/dist/span-name-normalizer.d.ts +1 -1
  86. package/dist/{stable-hash-C9F6xjzx.cjs → stable-hash-sLi1o4jj.cjs} +2 -2
  87. package/dist/{structured-error-BAXhglRE.cjs → structured-error-DynjWTTu.cjs} +1 -1
  88. package/dist/tail-sampling-processor.cjs +1 -1
  89. package/dist/tail-sampling-processor.d.ts +2 -2
  90. package/dist/tail-sampling-processor.js +1 -1
  91. package/dist/test-span-collector.cjs +1 -1
  92. package/dist/testing.cjs +3 -3
  93. package/dist/testing.d.ts +1 -1
  94. package/dist/testing.js +1 -1
  95. package/dist/{trace-factory-validation-Dc8epn87.cjs → trace-factory-validation-CHU1WcjK.cjs} +0 -1
  96. package/dist/trace-helpers.cjs +2 -2
  97. package/dist/tracer-provider.cjs +1 -1
  98. package/dist/validate.cjs +3 -3
  99. package/dist/validation-attributes.cjs +0 -1
  100. package/dist/{values-tm4bi0FF.cjs → values-AxGpgYBA.cjs} +0 -1
  101. package/dist/webhook.cjs +16 -13
  102. package/dist/webhook.js +14 -11
  103. package/dist/workflow-distributed.cjs +4 -6
  104. package/dist/workflow-distributed.js +2 -4
  105. package/dist/workflow.cjs +7 -6
  106. package/dist/workflow.js +3 -2
  107. package/dist/yaml-config.cjs +1 -1
  108. package/dist/yaml-config.d.cts +2 -2
  109. package/dist/yaml-config.d.ts +2 -2
  110. package/dist/yaml-config.js +1 -1
  111. package/package.json +2 -1
package/dist/analysis.cjs CHANGED
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
2
  //#region src/analysis.ts
4
3
  const DEFAULT_MAX_VALUES_PER_FIELD = 50;
5
4
  const DEFAULT_MAX_UNIQUE_RATIO = .5;
@@ -1,5 +1,5 @@
1
- import { ReadableSpan, Span, SpanProcessor } from "@opentelemetry/sdk-trace-base";
2
1
  import { AttributeValue, Context } from "@opentelemetry/api";
2
+ import { ReadableSpan, Span as Span$1, SpanProcessor } from "@opentelemetry/sdk-trace-base";
3
3
  //#region src/attribute-redacting-processor.d.ts
4
4
  /**
5
5
  * Custom redactor function type
@@ -199,7 +199,7 @@ declare class AttributeRedactingProcessor implements SpanProcessor {
199
199
  /**
200
200
  * Pass through onStart unchanged - attributes aren't finalized yet
201
201
  */
202
- onStart(span: Span, parentContext: Context): void;
202
+ onStart(span: Span$1, parentContext: Context): void;
203
203
  /**
204
204
  * Redact attributes and forward to wrapped processor
205
205
  */
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_values = require('./values-tm4bi0FF.cjs');
2
+ const require_values = require('./values-AxGpgYBA.cjs');
3
3
 
4
4
  //#region src/attribute-redacting-processor.ts
5
5
  /**
@@ -1,2 +1,2 @@
1
- import { a as AttributeRedactorPreset, c as REDACTOR_PATTERNS, d as builtinPatterns, f as createAttributeRedactor, i as AttributeRedactorFn, l as REDACTOR_PRESETS, m as normalizeAttributeRedactorConfig, n as AttributeRedactingProcessorOptions, o as BuiltinPatternName, p as createRedactedSpan, r as AttributeRedactorConfig, s as MaskFn, t as AttributeRedactingProcessor, u as ValuePatternConfig } from "./attribute-redacting-processor-CvBE0z1p.js";
1
+ import { a as AttributeRedactorPreset, c as REDACTOR_PATTERNS, d as builtinPatterns, f as createAttributeRedactor, i as AttributeRedactorFn, l as REDACTOR_PRESETS, m as normalizeAttributeRedactorConfig, n as AttributeRedactingProcessorOptions, o as BuiltinPatternName, p as createRedactedSpan, r as AttributeRedactorConfig, s as MaskFn, t as AttributeRedactingProcessor, u as ValuePatternConfig } from "./attribute-redacting-processor-rkV_WL-k.js";
2
2
  export { AttributeRedactingProcessor, AttributeRedactingProcessorOptions, AttributeRedactorConfig, AttributeRedactorFn, AttributeRedactorPreset, BuiltinPatternName, MaskFn, REDACTOR_PATTERNS, REDACTOR_PRESETS, ValuePatternConfig, builtinPatterns, createAttributeRedactor, createRedactedSpan, normalizeAttributeRedactorConfig };
@@ -447,8 +447,10 @@ function checkDeprecatedAttribute(key, policy = {}) {
447
447
  const { warnDeprecated = true } = guardrails;
448
448
  if (!warnDeprecated) return null;
449
449
  const replacement = DEPRECATED_ATTRIBUTES.get(key) ?? null;
450
- if (DEPRECATED_ATTRIBUTES.has(key)) if (replacement === null) console.warn(`[autotel/attributes] Attribute "${key}" is deprecated and has no replacement. Remove or find a replacement in OpenTelemetry semantic conventions.`);
451
- else console.warn(`[autotel/attributes] Attribute "${key}" is deprecated. Use "${replacement}" instead.`);
450
+ if (DEPRECATED_ATTRIBUTES.has(key)) {
451
+ if (replacement === null) console.warn(`[autotel/attributes] Attribute "${key}" is deprecated and has no replacement. Remove or find a replacement in OpenTelemetry semantic conventions.`);
452
+ else console.warn(`[autotel/attributes] Attribute "${key}" is deprecated. Use "${replacement}" instead.`);
453
+ }
452
454
  if (deprecatedWarnings[key]) console.warn(`[autotel/attributes] ${deprecatedWarnings[key]}`);
453
455
  return replacement;
454
456
  }
@@ -496,13 +498,16 @@ function safeSetAttributes(span, attrs, policy) {
496
498
  //#endregion
497
499
  //#region src/attributes/attachers.ts
498
500
  function setUser(spanOrContext, data, guardrails) {
499
- safeSetAttributes(spanOrContext, attrs.user.data(data), guardrails);
501
+ const attributes = attrs.user.data(data);
502
+ safeSetAttributes(spanOrContext, attributes, guardrails);
500
503
  }
501
504
  function setSession(spanOrContext, data, guardrails) {
502
- safeSetAttributes(spanOrContext, attrs.session.data(data), guardrails);
505
+ const attributes = attrs.session.data(data);
506
+ safeSetAttributes(spanOrContext, attributes, guardrails);
503
507
  }
504
508
  function setDevice(spanOrContext, data, guardrails) {
505
- safeSetAttributes(spanOrContext, attrs.device.data(data), guardrails);
509
+ const attributes = attrs.device.data(data);
510
+ safeSetAttributes(spanOrContext, attributes, guardrails);
506
511
  }
507
512
  function httpServer(spanOrContext, data, guardrails) {
508
513
  const attributes = attrs.http.server(data);
@@ -510,10 +515,12 @@ function httpServer(spanOrContext, data, guardrails) {
510
515
  safeSetAttributes(spanOrContext, attributes, guardrails);
511
516
  }
512
517
  function httpClient(spanOrContext, data, guardrails) {
513
- safeSetAttributes(spanOrContext, attrs.http.client(data), guardrails);
518
+ const attributes = attrs.http.client(data);
519
+ safeSetAttributes(spanOrContext, attributes, guardrails);
514
520
  }
515
521
  function dbClient(spanOrContext, data, guardrails) {
516
- safeSetAttributes(spanOrContext, attrs.db.client.data(data), guardrails);
522
+ const attributes = attrs.db.client.data(data);
523
+ safeSetAttributes(spanOrContext, attributes, guardrails);
517
524
  }
518
525
  /**
519
526
  * Merge service attributes into a Resource and return a new Resource.
@@ -550,16 +557,19 @@ function identify(spanOrContext, data, guardrails) {
550
557
  function request(spanOrContext, data, guardrails) {
551
558
  const httpAttrs = attrs.http.server(data);
552
559
  const networkAttrs = attrs.network.peerAddress(data.clientIp || "");
553
- safeSetAttributes(spanOrContext, {
560
+ const merged = {
554
561
  ...httpAttrs,
555
562
  ...networkAttrs
556
- }, guardrails);
563
+ };
564
+ safeSetAttributes(spanOrContext, merged, guardrails);
557
565
  }
558
566
  function setError(spanOrContext, data, guardrails) {
559
- safeSetAttributes(spanOrContext, attrs.error.data(data), guardrails);
567
+ const attributes = attrs.error.data(data);
568
+ safeSetAttributes(spanOrContext, attributes, guardrails);
560
569
  }
561
570
  function setException(spanOrContext, data, guardrails) {
562
- safeSetAttributes(spanOrContext, attrs.exception.data(data), guardrails);
571
+ const attributes = attrs.exception.data(data);
572
+ safeSetAttributes(spanOrContext, attributes, guardrails);
563
573
  }
564
574
 
565
575
  //#endregion
@@ -1,6 +1,6 @@
1
- const require_values = require('./values-tm4bi0FF.cjs');
1
+ const require_values = require('./values-AxGpgYBA.cjs');
2
2
  const require_attribute_redacting_processor = require('./attribute-redacting-processor.cjs');
3
- const require_registry = require('./registry-DIoklBz5.cjs');
3
+ const require_registry = require('./registry-B3ZJmUtU.cjs');
4
4
  let _opentelemetry_resources = require("@opentelemetry/resources");
5
5
 
6
6
  //#region src/attributes/builders.ts
@@ -447,8 +447,10 @@ function checkDeprecatedAttribute(key, policy = {}) {
447
447
  const { warnDeprecated = true } = guardrails;
448
448
  if (!warnDeprecated) return null;
449
449
  const replacement = DEPRECATED_ATTRIBUTES.get(key) ?? null;
450
- if (DEPRECATED_ATTRIBUTES.has(key)) if (replacement === null) console.warn(`[autotel/attributes] Attribute "${key}" is deprecated and has no replacement. Remove or find a replacement in OpenTelemetry semantic conventions.`);
451
- else console.warn(`[autotel/attributes] Attribute "${key}" is deprecated. Use "${replacement}" instead.`);
450
+ if (DEPRECATED_ATTRIBUTES.has(key)) {
451
+ if (replacement === null) console.warn(`[autotel/attributes] Attribute "${key}" is deprecated and has no replacement. Remove or find a replacement in OpenTelemetry semantic conventions.`);
452
+ else console.warn(`[autotel/attributes] Attribute "${key}" is deprecated. Use "${replacement}" instead.`);
453
+ }
452
454
  if (deprecatedWarnings[key]) console.warn(`[autotel/attributes] ${deprecatedWarnings[key]}`);
453
455
  return replacement;
454
456
  }
@@ -496,13 +498,16 @@ function safeSetAttributes(span, attrs, policy) {
496
498
  //#endregion
497
499
  //#region src/attributes/attachers.ts
498
500
  function setUser(spanOrContext, data, guardrails) {
499
- safeSetAttributes(spanOrContext, attrs.user.data(data), guardrails);
501
+ const attributes = attrs.user.data(data);
502
+ safeSetAttributes(spanOrContext, attributes, guardrails);
500
503
  }
501
504
  function setSession(spanOrContext, data, guardrails) {
502
- safeSetAttributes(spanOrContext, attrs.session.data(data), guardrails);
505
+ const attributes = attrs.session.data(data);
506
+ safeSetAttributes(spanOrContext, attributes, guardrails);
503
507
  }
504
508
  function setDevice(spanOrContext, data, guardrails) {
505
- safeSetAttributes(spanOrContext, attrs.device.data(data), guardrails);
509
+ const attributes = attrs.device.data(data);
510
+ safeSetAttributes(spanOrContext, attributes, guardrails);
506
511
  }
507
512
  function httpServer(spanOrContext, data, guardrails) {
508
513
  const attributes = attrs.http.server(data);
@@ -510,10 +515,12 @@ function httpServer(spanOrContext, data, guardrails) {
510
515
  safeSetAttributes(spanOrContext, attributes, guardrails);
511
516
  }
512
517
  function httpClient(spanOrContext, data, guardrails) {
513
- safeSetAttributes(spanOrContext, attrs.http.client(data), guardrails);
518
+ const attributes = attrs.http.client(data);
519
+ safeSetAttributes(spanOrContext, attributes, guardrails);
514
520
  }
515
521
  function dbClient(spanOrContext, data, guardrails) {
516
- safeSetAttributes(spanOrContext, attrs.db.client.data(data), guardrails);
522
+ const attributes = attrs.db.client.data(data);
523
+ safeSetAttributes(spanOrContext, attributes, guardrails);
517
524
  }
518
525
  /**
519
526
  * Merge service attributes into a Resource and return a new Resource.
@@ -550,16 +557,19 @@ function identify(spanOrContext, data, guardrails) {
550
557
  function request(spanOrContext, data, guardrails) {
551
558
  const httpAttrs = attrs.http.server(data);
552
559
  const networkAttrs = attrs.network.peerAddress(data.clientIp || "");
553
- safeSetAttributes(spanOrContext, {
560
+ const merged = {
554
561
  ...httpAttrs,
555
562
  ...networkAttrs
556
- }, guardrails);
563
+ };
564
+ safeSetAttributes(spanOrContext, merged, guardrails);
557
565
  }
558
566
  function setError(spanOrContext, data, guardrails) {
559
- safeSetAttributes(spanOrContext, attrs.error.data(data), guardrails);
567
+ const attributes = attrs.error.data(data);
568
+ safeSetAttributes(spanOrContext, attributes, guardrails);
560
569
  }
561
570
  function setException(spanOrContext, data, guardrails) {
562
- safeSetAttributes(spanOrContext, attrs.exception.data(data), guardrails);
571
+ const attributes = attrs.exception.data(data);
572
+ safeSetAttributes(spanOrContext, attributes, guardrails);
563
573
  }
564
574
 
565
575
  //#endregion
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_attributes = require('./attributes-DkptT2Ck.cjs');
2
+ const require_attributes = require('./attributes-Ii3jDPsW.cjs');
3
3
 
4
4
  exports.attrs = require_attributes.attrs;
5
5
  exports.autoRedactPII = require_attributes.autoRedactPII;
@@ -1,2 +1,2 @@
1
- import { A as ExceptionAttrs, B as PeerAttrs, C as CloudAttrs, D as DeploymentAttrs, E as DBAttrs, F as HTTPServerAttrs, G as SessionAttrs, H as RPCAttrs, I as K8sAttrs, J as URLAttrs, K as TLSAttrs, L as MessagingAttrs, M as FeatureFlagAttrs, N as GraphQLAttrs, O as DeviceAttrs, P as HTTPClientAttrs, R as NetworkAttrs, S as ClientAttrs, T as ContainerAttrs, U as ServerAddressAttrs, V as ProcessAttrs, W as ServiceAttrs, Y as UserAttrs, _ as autoRedactPII, a as httpClient, b as validateAttribute, c as mergeServiceResource, d as setError, f as setException, g as AttributePolicy, h as AttributeGuardrails, i as dbClient, j as FaaSAttrs, k as ErrorAttrs, l as request, m as setUser, n as safeSetAttributes, o as httpServer, p as setSession, q as ThreadAttrs, r as transaction, s as identify, t as mergeAttrs, u as setDevice, v as checkDeprecatedAttribute, w as CodeAttrs, x as attrs, y as defaultGuardrails, z as OTelAttrs } from "./index-o_6YjZhV.js";
1
+ import { A as ExceptionAttrs, B as PeerAttrs, C as CloudAttrs, D as DeploymentAttrs, E as DBAttrs, F as HTTPServerAttrs, G as SessionAttrs, H as RPCAttrs, I as K8sAttrs, J as URLAttrs, K as TLSAttrs, L as MessagingAttrs, M as FeatureFlagAttrs, N as GraphQLAttrs, O as DeviceAttrs, P as HTTPClientAttrs, R as NetworkAttrs, S as ClientAttrs, T as ContainerAttrs, U as ServerAddressAttrs, V as ProcessAttrs, W as ServiceAttrs, Y as UserAttrs, _ as autoRedactPII, a as httpClient, b as validateAttribute, c as mergeServiceResource, d as setError, f as setException, g as AttributePolicy, h as AttributeGuardrails, i as dbClient, j as FaaSAttrs, k as ErrorAttrs, l as request, m as setUser, n as safeSetAttributes, o as httpServer, p as setSession, q as ThreadAttrs, r as transaction, s as identify, t as mergeAttrs, u as setDevice, v as checkDeprecatedAttribute, w as CodeAttrs, x as attrs, y as defaultGuardrails, z as OTelAttrs } from "./index-B9aRLp6c.js";
2
2
  export { type AttributeGuardrails, type AttributePolicy, type ClientAttrs, type CloudAttrs, type CodeAttrs, type ContainerAttrs, type DBAttrs, type DeploymentAttrs, type DeviceAttrs, type ErrorAttrs, type ExceptionAttrs, type FaaSAttrs, type FeatureFlagAttrs, type GraphQLAttrs, type HTTPClientAttrs, type HTTPServerAttrs, type K8sAttrs, type MessagingAttrs, type NetworkAttrs, type OTelAttrs, type PeerAttrs, type ProcessAttrs, type RPCAttrs, type ServerAddressAttrs, type ServiceAttrs, type SessionAttrs, type TLSAttrs, type ThreadAttrs, type URLAttrs, type UserAttrs, attrs, autoRedactPII, checkDeprecatedAttribute, dbClient, defaultGuardrails, httpClient, httpServer, identify, mergeAttrs, mergeServiceResource, request, safeSetAttributes, setDevice, setError, setException, setSession, setUser, transaction, validateAttribute };
@@ -1,3 +1,3 @@
1
- import { _ as defaultGuardrails, a as identify, c as setDevice, d as setSession, f as setUser, g as checkDeprecatedAttribute, h as autoRedactPII, i as httpServer, l as setError, m as safeSetAttributes, n as dbClient, o as mergeServiceResource, p as mergeAttrs, r as httpClient, s as request, t as transaction, u as setException, v as validateAttribute, y as attrs } from "./attributes-De9Fx0b4.js";
1
+ import { _ as defaultGuardrails, a as identify, c as setDevice, d as setSession, f as setUser, g as checkDeprecatedAttribute, h as autoRedactPII, i as httpServer, l as setError, m as safeSetAttributes, n as dbClient, o as mergeServiceResource, p as mergeAttrs, r as httpClient, s as request, t as transaction, u as setException, v as validateAttribute, y as attrs } from "./attributes-CuGx6cOI.js";
2
2
 
3
3
  export { attrs, autoRedactPII, checkDeprecatedAttribute, dbClient, defaultGuardrails, httpClient, httpServer, identify, mergeAttrs, mergeServiceResource, request, safeSetAttributes, setDevice, setError, setException, setSession, setUser, transaction, validateAttribute };
package/dist/auto.cjs CHANGED
@@ -1,5 +1,5 @@
1
- const require_rolldown_runtime = require('./rolldown-runtime-C_NdSu1c.cjs');
2
- const require_init = require('./init-BYXDCfRL.cjs');
1
+ const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.cjs');
2
+ const require_init = require('./init-W_klPrYk.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-Dyq6WtsO.js";
1
+ import { _ as loadYamlConfig, a as init } from "./init-C-qfxo_u.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_values = require('./values-tm4bi0FF.cjs');
2
+ const require_values = require('./values-AxGpgYBA.cjs');
3
3
  let _opentelemetry_api = require("@opentelemetry/api");
4
4
 
5
5
  //#region src/business-baggage.ts
@@ -1,4 +1,4 @@
1
- const require_values = require('./values-tm4bi0FF.cjs');
1
+ const require_values = require('./values-AxGpgYBA.cjs');
2
2
  let _opentelemetry_api_logs = require("@opentelemetry/api-logs");
3
3
 
4
4
  //#region src/pretty-log-formatter.ts
@@ -1,7 +1,7 @@
1
1
  import { t as UnknownRecord } from "./values-CeMH-mYG.js";
2
2
  import { s as Logger } from "./logger-S1Fgl0g3.js";
3
- import { ReadableSpan, SpanProcessor } from "@opentelemetry/sdk-trace-base";
4
3
  import { AttributeValue } from "@opentelemetry/api";
4
+ import { ReadableSpan, SpanProcessor } from "@opentelemetry/sdk-trace-base";
5
5
  //#region src/processors/canonical-log-line-processor.d.ts
6
6
  /**
7
7
  * Function to redact sensitive attribute values
@@ -1,4 +1,4 @@
1
- const require_values = require('./values-tm4bi0FF.cjs');
1
+ const require_values = require('./values-AxGpgYBA.cjs');
2
2
 
3
3
  //#region src/correlated-events.ts
4
4
  function sanitizeEventKey(input) {
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_init = require('./init-BYXDCfRL.cjs');
2
+ const require_init = require('./init-W_klPrYk.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 getCorrelationStorage, Q as getCorrelationId, X as CORRELATION_ID_BAGGAGE_KEY, Z as generateCorrelationId, et as getOrCreateCorrelationId, nt as setCorrelationId, rt as setCorrelationIdInBaggage, tt as runWithCorrelationId } from "./init-Dyq6WtsO.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-C-qfxo_u.js";
2
2
 
3
3
  export { CORRELATION_ID_BAGGAGE_KEY, generateCorrelationId, getCorrelationId, getCorrelationStorage, getOrCreateCorrelationId, runWithCorrelationId, setCorrelationId, setCorrelationIdInBaggage };
package/dist/db.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_values = require('./values-tm4bi0FF.cjs');
2
+ const require_values = require('./values-AxGpgYBA.cjs');
3
3
  const require_config = require('./config.cjs');
4
4
  let _opentelemetry_api = require("@opentelemetry/api");
5
5
 
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_values = require('./values-tm4bi0FF.cjs');
2
+ const require_init = require('./init-W_klPrYk.cjs');
3
+ const require_values = require('./values-AxGpgYBA.cjs');
3
4
  const require_config = require('./config.cjs');
4
- const require_init = require('./init-BYXDCfRL.cjs');
5
5
  let _opentelemetry_api = require("@opentelemetry/api");
6
6
 
7
7
  //#region src/decorators.ts
@@ -1,5 +1,5 @@
1
1
  import { n as TraceContext } from "./trace-context-f7Xq0Q2q.cjs";
2
- import { h as TracingOptions } from "./functional-C4mjgtJb.cjs";
2
+ import { h as TracingOptions } from "./functional-DPZTpGh6.cjs";
3
3
  //#region src/decorators.d.ts
4
4
  /**
5
5
  * Options for @Trace method decorator
@@ -1,5 +1,5 @@
1
1
  import { n as TraceContext } from "./trace-context-CqCblIQE.js";
2
- import { h as TracingOptions } from "./functional-DN_ztd9C.js";
2
+ import { h as TracingOptions } from "./functional-SeRUabkE.js";
3
3
  //#region src/decorators.d.ts
4
4
  /**
5
5
  * Options for @Trace method decorator
@@ -1,6 +1,6 @@
1
+ import { G as createTraceContext } from "./init-C-qfxo_u.js";
1
2
  import { y as splitNameOrOptions } from "./values-xBtdXtjA.js";
2
3
  import { getConfig } from "./config.js";
3
- import { U as createTraceContext } from "./init-Dyq6WtsO.js";
4
4
  import { SpanStatusCode } from "@opentelemetry/api";
5
5
 
6
6
  //#region src/decorators.ts
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_values = require('./values-tm4bi0FF.cjs');
3
- const require_node_require = require('./node-require-B_IVapV3.cjs');
4
- let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conventions");
2
+ const require_values = require('./values-AxGpgYBA.cjs');
3
+ const require_node_require = require('./node-require-BPsB09eC.cjs');
5
4
  let _opentelemetry_api = require("@opentelemetry/api");
6
5
  let _opentelemetry_api_logs = require("@opentelemetry/api-logs");
6
+ let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conventions");
7
7
 
8
8
  //#region src/diagnostics/channel.ts
9
9
  /**
@@ -1,8 +1,8 @@
1
1
  import { l as asString } from "./values-xBtdXtjA.js";
2
2
  import { n as safeRequire } from "./node-require-CkK_xzL-.js";
3
- import { ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_NETWORK_PROTOCOL_VERSION, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_URL_FULL, ATTR_URL_PATH, ATTR_URL_SCHEME, ATTR_USER_AGENT_ORIGINAL } from "@opentelemetry/semantic-conventions";
4
3
  import { SpanKind, SpanStatusCode, context, defaultTextMapGetter, defaultTextMapSetter, propagation, trace } from "@opentelemetry/api";
5
4
  import { SeverityNumber, logs } from "@opentelemetry/api-logs";
5
+ import { ATTR_HTTP_REQUEST_METHOD, ATTR_HTTP_RESPONSE_STATUS_CODE, ATTR_NETWORK_PROTOCOL_VERSION, ATTR_SERVER_ADDRESS, ATTR_SERVER_PORT, ATTR_URL_FULL, ATTR_URL_PATH, ATTR_URL_SCHEME, ATTR_USER_AGENT_ORIGINAL } from "@opentelemetry/semantic-conventions";
6
6
 
7
7
  //#region src/diagnostics/channel.ts
8
8
  /**
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
2
  //#region src/drain-pipeline.ts
4
3
  function wait(ms) {
5
4
  return new Promise((resolve) => {
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
2
  //#region src/enrichers.ts
4
3
  function get(headers, key) {
5
4
  const lower = key.toLowerCase();
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
2
  //#region src/event-testing.ts
4
3
  /**
5
4
  * Create an in-memory events collector for testing
package/dist/event.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_init = require('./init-BYXDCfRL.cjs');
2
+ const require_init = require('./init-W_klPrYk.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-Dyq6WtsO.js";
1
+ import { d as Event, f as getEvents, p as resetEvents } from "./init-C-qfxo_u.js";
2
2
 
3
3
  export { Event, getEvents, resetEvents };
package/dist/evidence.cjs CHANGED
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
2
  //#region src/evidence.ts
4
3
  /** Prefix for per-field evidence labels. */
5
4
  const EVIDENCE_ATTR_PREFIX = "autotel.evidence.";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_values = require('./values-tm4bi0FF.cjs');
2
+ const require_values = require('./values-AxGpgYBA.cjs');
3
3
 
4
4
  //#region src/exception-fingerprint.ts
5
5
  /** Attribute the fingerprint is written to. */
@@ -1,5 +1,5 @@
1
- import { ReadableSpan, Span, SpanProcessor } from "@opentelemetry/sdk-trace-base";
2
1
  import { Context } from "@opentelemetry/api";
2
+ import { ReadableSpan, Span as Span$1, SpanProcessor } from "@opentelemetry/sdk-trace-base";
3
3
  //#region src/filtering-span-processor.d.ts
4
4
  /**
5
5
  * Predicate function for filtering spans
@@ -44,7 +44,7 @@ declare class FilteringSpanProcessor implements SpanProcessor {
44
44
  /**
45
45
  * Pass through onStart - we need spans to start so child spans work
46
46
  */
47
- onStart(span: Span, parentContext: Context): void;
47
+ onStart(span: Span$1, parentContext: Context): void;
48
48
  /**
49
49
  * Apply filter predicate on span end
50
50
  * If filter returns false, span is dropped (not forwarded)
@@ -1,5 +1,4 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
2
  //#region src/filtering-span-processor.ts
4
3
  /**
5
4
  * Span processor that filters spans based on a predicate function.
@@ -1,2 +1,2 @@
1
- import { n as FilteringSpanProcessorOptions, r as SpanFilterPredicate, t as FilteringSpanProcessor } from "./filtering-span-processor-BpDagWNa.js";
1
+ import { n as FilteringSpanProcessorOptions, r as SpanFilterPredicate, t as FilteringSpanProcessor } from "./filtering-span-processor-vkewzbqB.js";
2
2
  export { FilteringSpanProcessor, FilteringSpanProcessorOptions, SpanFilterPredicate };
@@ -1,10 +1,11 @@
1
- import { _ as readProperty, h as isFunction, l as asString, m as isDevelopment } from "./values-xBtdXtjA.js";
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-C-qfxo_u.js";
2
+ import { l as asString, m as isDevelopment } from "./values-xBtdXtjA.js";
2
3
  import { getForceFlushableProvider } from "./tracer-provider.js";
3
- import { getConfig } from "./config.js";
4
- import { C as AUTOTEL_SAMPLING_RATE, D as AlwaysSampler, G as getActiveContextWithBaggage, I as debugCaptureRequested, J as getEventQueue, K as getContextStorage, T as AUTOTEL_SAMPLING_TAIL_KEEP, U as createTraceContext, h as runInOperationContext, i as getSdk, n as getConfiguredSampler, q as hasExplicitSpanStatus, t as getConfig$1, w as AUTOTEL_SAMPLING_TAIL_EVALUATED, z as isForceKept } from "./init-Dyq6WtsO.js";
4
+ import { getConfig as getConfig$1 } from "./config.js";
5
+ import { a as flattenToAttributes } from "./structured-error-Y9y-1Pae.js";
5
6
  import { evidenceAttribute } from "./evidence.js";
6
7
  import { setSpanName } from "./trace-helpers.js";
7
- import { SpanStatusCode, context, createContextKey, propagation, trace } from "@opentelemetry/api";
8
+ import { SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
8
9
  import * as nodeFs from "node:fs";
9
10
  import * as nodeUrl from "node:url";
10
11
 
@@ -205,7 +206,7 @@ function getSpanName(options, fn, variableName) {
205
206
  const fnName = variableName || inferFunctionName(fn) || "anonymous";
206
207
  if (options.serviceName) return `${options.serviceName}.${fnName}`;
207
208
  if (fnName !== "anonymous") return fnName;
208
- const initConfig = getConfig$1();
209
+ const initConfig = getConfig();
209
210
  if (isDevelopment() && !unknownSpanNameWarningEmitted && initConfig?.logger?.warn) {
210
211
  unknownSpanNameWarningEmitted = true;
211
212
  initConfig.logger.warn({}, "[autotel] Span name resolved to \"unknown\". Use instrument({ key: \"operation.name\", fn }) for a reusable named wrapper.");
@@ -324,7 +325,7 @@ function finalizeThrownSpan(error, isError, finalizeContext) {
324
325
  span.end();
325
326
  }
326
327
  function createRootTelemetryFlusher(options, isRootSpan) {
327
- const initConfig = getConfig$1();
328
+ const initConfig = getConfig();
328
329
  const shouldFlush = options.flushOnRootSpanEnd ?? initConfig?.flushOnRootSpanEnd ?? true;
329
330
  const shouldFlushSpans = initConfig?.forceFlushOnShutdown ?? false;
330
331
  return async () => {
@@ -334,7 +335,7 @@ function createRootTelemetryFlusher(options, isRootSpan) {
334
335
  if (queue && queue.size() > 0) await queue.flush();
335
336
  if (shouldFlushSpans) await getForceFlushableProvider(getSdk())?.forceFlush();
336
337
  } catch (error) {
337
- getConfig$1()?.logger?.error?.({ err: error instanceof Error ? error : void 0 }, `[autotel] Auto-flush failed${error instanceof Error ? "" : `: ${String(error)}`}`);
338
+ getConfig()?.logger?.error?.({ err: error instanceof Error ? error : void 0 }, `[autotel] Auto-flush failed${error instanceof Error ? "" : `: ${String(error)}`}`);
338
339
  }
339
340
  };
340
341
  }
@@ -346,7 +347,7 @@ function runWithTraceContextStorage(fn) {
346
347
  /** Used when neither the wrapper nor `init()` chose a sampler. */
347
348
  const FALLBACK_SAMPLER = new AlwaysSampler();
348
349
  function wrapWithTracingSync(fnFactory, options, variableName) {
349
- const { meter } = getConfig();
350
+ const { meter } = getConfig$1();
350
351
  const resolveSampler = () => options.sampler ?? getConfiguredSampler() ?? FALLBACK_SAMPLER;
351
352
  const spanName = getSpanName(options, fnFactory, variableName);
352
353
  const callCounter = options.withMetrics ? meter.createCounter(`${spanName}.calls`, {
@@ -376,7 +377,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
376
377
  const spanOptions = {};
377
378
  if (options.startNewRoot) spanOptions.root = true;
378
379
  if (options.spanKind !== void 0) spanOptions.kind = options.spanKind;
379
- const { tracer } = getConfig();
380
+ const { tracer } = getConfig$1();
380
381
  return tracer.startActiveSpan(spanName, spanOptions, getActiveContextWithBaggage(), (span) => runInOperationContext(spanName, () => runWithTraceContextStorage(() => {
381
382
  let shouldKeepSpan = true;
382
383
  setSpanName(span, spanName);
@@ -645,22 +646,6 @@ function createCtxProxy(resolve) {
645
646
  }
646
647
  const ctx = createCtxProxy(getCtxValue);
647
648
  /**
648
- * The key `@opentelemetry/core` publishes RPC metadata under. `createContextKey`
649
- * is `Symbol.for`, so this reads exactly what `instrumentation-http` (and every
650
- * framework instrumentation that renames the route) wrote, without taking a
651
- * dependency on core.
652
- */
653
- const RPC_METADATA_KEY = createContextKey("OpenTelemetry SDK Context Key RPC_METADATA");
654
- /**
655
- * The span the current request is being recorded on, or the active span when
656
- * there is no request - a queue consumer or a cron job has none, and an
657
- * attribute belongs somewhere real rather than nowhere.
658
- */
659
- function getRequestSpan() {
660
- const requestSpan = readProperty(context.active().getValue(RPC_METADATA_KEY), "span");
661
- return isFunction(readProperty(requestSpan, "spanContext")) ? requestSpan : trace.getActiveSpan();
662
- }
663
- /**
664
649
  * The ambient {@link ctx}, aimed at the **request** span rather than at
665
650
  * whatever span the calling code happens to be inside.
666
651
  *
@@ -683,8 +668,21 @@ function getRequestSpan() {
683
668
  * ```
684
669
  */
685
670
  const requestCtx = createCtxProxy(() => {
686
- const span = getRequestSpan();
687
- return span ? createTraceContext(span) : null;
671
+ const span = getRequestSpanIn() ?? trace.getActiveSpan();
672
+ if (!span) return null;
673
+ return {
674
+ ...createTraceContext(span),
675
+ setAttribute: (key, value) => {
676
+ const attrs = flattenToAttributes({ [key]: value });
677
+ span.setAttributes(attrs);
678
+ rememberRequestAttributes(span, attrs);
679
+ },
680
+ setAttributes: (attrs) => {
681
+ const flattened = flattenToAttributes(attrs);
682
+ span.setAttributes(flattened);
683
+ rememberRequestAttributes(span, flattened);
684
+ }
685
+ };
688
686
  });
689
687
  function traceImpl(fnOrNameOrOptions, maybeFn) {
690
688
  if (typeof fnOrNameOrOptions === "function") return wrapPlainWithTracing(fnOrNameOrOptions, {});
@@ -770,7 +768,7 @@ function instrument(options) {
770
768
  }
771
769
  function span(nameOrOptions, fn) {
772
770
  const options = typeof nameOrOptions === "string" ? { name: nameOrOptions } : nameOrOptions;
773
- const tracer = getConfig().tracer;
771
+ const tracer = getConfig$1().tracer;
774
772
  const { name, attributes, spanKind } = options;
775
773
  const executeSpan = (span) => {
776
774
  return runInOperationContext(name, () => {
@@ -838,7 +836,7 @@ function span(nameOrOptions, fn) {
838
836
  */
839
837
  async function withNewContext(options) {
840
838
  const { fn } = options;
841
- return getConfig().tracer.startActiveSpan("root", { root: true }, async (span) => {
839
+ return getConfig$1().tracer.startActiveSpan("root", { root: true }, async (span) => {
842
840
  try {
843
841
  const result = await fn();
844
842
  span.setStatus({ code: SpanStatusCode.OK });
@@ -1,5 +1,5 @@
1
1
  import { n as TraceContext } from "./trace-context-f7Xq0Q2q.cjs";
2
- import { m as Sampler } from "./sampling-Er217Mge.cjs";
2
+ import { m as Sampler$1 } from "./sampling-DENUjT_8.cjs";
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>;
@@ -28,7 +28,7 @@ interface TracingOptions<TArgs extends unknown[] = unknown[], TReturn = unknown>
28
28
  * Sampling strategy.
29
29
  * @default AlwaysSampler
30
30
  */
31
- sampler?: Sampler;
31
+ sampler?: Sampler$1;
32
32
  /**
33
33
  * Enable call and duration metrics.
34
34
  * @default false