autotel 7.10.1 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (126) hide show
  1. package/README.md +38 -32
  2. package/dist/{attribute-redacting-processor-rkV_WL-k.d.ts → attribute-redacting-processor-BrrdojmP.d.ts} +5 -1
  3. package/dist/{attribute-redacting-processor-CvBE0z1p.d.cts → attribute-redacting-processor-Cq7K8Okp.d.cts} +5 -1
  4. package/dist/attribute-redacting-processor.cjs +18 -8
  5. package/dist/attribute-redacting-processor.d.cts +1 -1
  6. package/dist/attribute-redacting-processor.d.ts +1 -1
  7. package/dist/attribute-redacting-processor.js +18 -8
  8. package/dist/{attributes-Ii3jDPsW.cjs → attributes-BqgJl9qA.cjs} +1 -1
  9. package/dist/{attributes-CuGx6cOI.js → attributes-BtwTkuX7.js} +1 -1
  10. package/dist/attributes.cjs +1 -1
  11. package/dist/attributes.js +1 -1
  12. package/dist/auto.cjs +1 -1
  13. package/dist/auto.js +1 -1
  14. package/dist/business-baggage.cjs +1 -1
  15. package/dist/business-baggage.js +1 -1
  16. package/dist/{canonical-log-line-processor-DDGzm-wi.d.ts → canonical-log-line-processor-BaFqHO5l.d.ts} +1 -2
  17. package/dist/{canonical-log-line-processor-DLeAQjgb.d.cts → canonical-log-line-processor-C-RdV5af.d.cts} +1 -2
  18. package/dist/{canonical-log-line-processor-BU03jJeA.cjs → canonical-log-line-processor-DScNq1g8.cjs} +1 -2
  19. package/dist/{canonical-log-line-processor-BQ6NeZAk.js → canonical-log-line-processor-naZRETyk.js} +1 -2
  20. package/dist/{channel-D0eaVqn3.cjs → channel-3MV-4Aqv.cjs} +1 -1
  21. package/dist/{channel-BobQKsZd.js → channel-BNFp4Sfq.js} +1 -1
  22. package/dist/config.d.cts +1 -1
  23. package/dist/config.d.ts +1 -1
  24. package/dist/{correlated-events-BfpH5uS-.js → correlated-events-CZFe6Z1P.js} +1 -1
  25. package/dist/{correlated-events-DE_4A3oD.cjs → correlated-events-wCrXVUby.cjs} +1 -1
  26. package/dist/correlation-id.cjs +1 -1
  27. package/dist/correlation-id.js +1 -1
  28. package/dist/db.cjs +1 -1
  29. package/dist/db.js +1 -1
  30. package/dist/decorators.cjs +2 -2
  31. package/dist/decorators.d.cts +1 -1
  32. package/dist/decorators.d.ts +1 -1
  33. package/dist/decorators.js +2 -2
  34. package/dist/diagnostics.cjs +3 -3
  35. package/dist/diagnostics.js +3 -3
  36. package/dist/event.cjs +1 -1
  37. package/dist/event.d.cts +1 -1
  38. package/dist/event.d.ts +1 -1
  39. package/dist/event.js +1 -1
  40. package/dist/exception-fingerprint.cjs +1 -1
  41. package/dist/exception-fingerprint.js +1 -1
  42. package/dist/{functional-C4gGiBou.js → functional-7uwlAIJd.js} +4 -4
  43. package/dist/{functional-j8Joyrwd.d.cts → functional-CN_cqIX8.d.cts} +9 -2
  44. package/dist/{functional-DptEM9La.cjs → functional-DCfOaKoM.cjs} +4 -4
  45. package/dist/{functional-CbcInXMJ.d.ts → functional-IGZ-Urlq.d.ts} +9 -2
  46. package/dist/functional.cjs +1 -1
  47. package/dist/functional.d.cts +1 -1
  48. package/dist/functional.d.ts +1 -1
  49. package/dist/functional.js +1 -1
  50. package/dist/http.cjs +2 -2
  51. package/dist/http.js +2 -2
  52. package/dist/index.cjs +9 -8
  53. package/dist/index.d.cts +31 -7
  54. package/dist/index.d.ts +31 -7
  55. package/dist/index.js +9 -9
  56. package/dist/{init-Biyby8Br.d.ts → init-BYq2sUXg.d.ts} +26 -31
  57. package/dist/{init-BvUtwZNx.js → init-D4TpmUIg.js} +142 -27
  58. package/dist/{init-Cx1-ejLn.cjs → init-DlJvp1WH.cjs} +147 -26
  59. package/dist/{init-CHanKvOq.d.cts → init-axM4kgR4.d.cts} +26 -31
  60. package/dist/instrumentation.cjs +2 -2
  61. package/dist/instrumentation.js +2 -2
  62. package/dist/{logger-B2VPcBgZ.js → logger-4VXLbqWx.js} +11 -19
  63. package/dist/{logger-DLjHQAus.cjs → logger-CWFxTLtR.cjs} +11 -19
  64. package/dist/{logger-C9UT1aZ_.d.cts → logger-b0qgWFy7.d.cts} +10 -18
  65. package/dist/{logger-C9UT1aZ_.d.ts → logger-b0qgWFy7.d.ts} +10 -18
  66. package/dist/logger.cjs +1 -1
  67. package/dist/logger.d.cts +1 -1
  68. package/dist/logger.d.ts +1 -1
  69. package/dist/logger.js +1 -1
  70. package/dist/messaging-adapters.cjs +1 -1
  71. package/dist/messaging-adapters.js +1 -1
  72. package/dist/messaging.cjs +4 -4
  73. package/dist/messaging.js +4 -4
  74. package/dist/metric.d.cts +1 -1
  75. package/dist/metric.d.ts +1 -1
  76. package/dist/{node-require-BPsB09eC.cjs → node-require-BotQNkYw.cjs} +1 -1
  77. package/dist/{node-require-CkK_xzL-.js → node-require-CY0YUdvZ.js} +1 -1
  78. package/dist/parse-error.cjs +1 -1
  79. package/dist/parse-error.js +1 -1
  80. package/dist/policy.cjs +0 -0
  81. package/dist/policy.js +0 -0
  82. package/dist/processors.cjs +1 -1
  83. package/dist/processors.d.cts +1 -1
  84. package/dist/processors.d.ts +1 -1
  85. package/dist/processors.js +1 -1
  86. package/dist/register.cjs +1 -0
  87. package/dist/register.js +1 -0
  88. package/dist/{sampling-Dud4XU2m.d.cts → sampling-CLJmXMw0.d.cts} +1 -1
  89. package/dist/{sampling-B_8orhSB.d.ts → sampling-DBlX8Nv5.d.ts} +1 -1
  90. package/dist/sampling.cjs +1 -1
  91. package/dist/sampling.d.cts +1 -1
  92. package/dist/sampling.d.ts +1 -1
  93. package/dist/sampling.js +1 -1
  94. package/dist/semantic-helpers.cjs +2 -2
  95. package/dist/semantic-helpers.js +2 -2
  96. package/dist/{stable-hash-sLi1o4jj.cjs → stable-hash-58iP5-N-.cjs} +1 -1
  97. package/dist/{stable-hash-AOUgw1DW.js → stable-hash-DVEU2MqW.js} +1 -1
  98. package/dist/{structured-error-DynjWTTu.cjs → structured-error-Ci8s_M6u.cjs} +6 -6
  99. package/dist/{structured-error-Y9y-1Pae.js → structured-error-UEtlg9Uu.js} +6 -6
  100. package/dist/tail-sampling-processor.cjs +1 -1
  101. package/dist/tail-sampling-processor.js +1 -1
  102. package/dist/test-span-collector.cjs +1 -1
  103. package/dist/test-span-collector.js +1 -1
  104. package/dist/testing.cjs +11 -1
  105. package/dist/testing.d.cts +1 -1
  106. package/dist/testing.d.ts +1 -1
  107. package/dist/testing.js +12 -2
  108. package/dist/trace-helpers.cjs +2 -2
  109. package/dist/trace-helpers.js +2 -2
  110. package/dist/tracer-provider.cjs +1 -1
  111. package/dist/tracer-provider.js +1 -1
  112. package/dist/validate.cjs +3 -3
  113. package/dist/validate.js +3 -3
  114. package/dist/{values-AxGpgYBA.cjs → values-9A6nOyZm.cjs} +69 -3
  115. package/dist/{values-xBtdXtjA.js → values-Dm0yEC5p.js} +58 -4
  116. package/dist/webhook.cjs +3 -3
  117. package/dist/webhook.js +3 -3
  118. package/dist/workflow-distributed.cjs +3 -3
  119. package/dist/workflow-distributed.js +3 -3
  120. package/dist/workflow.cjs +3 -3
  121. package/dist/workflow.js +3 -3
  122. package/dist/yaml-config.cjs +1 -1
  123. package/dist/yaml-config.d.cts +2 -2
  124. package/dist/yaml-config.d.ts +2 -2
  125. package/dist/yaml-config.js +1 -1
  126. package/package.json +1 -1
package/README.md CHANGED
@@ -1633,20 +1633,28 @@ npm install pino
1633
1633
  npm install @opentelemetry/instrumentation-pino
1634
1634
  ```
1635
1635
 
1636
- ```typescript
1637
- import pino from 'pino';
1638
- import { init, trace, span, withTracing } from 'autotel';
1639
-
1640
- const logger = pino({
1641
- level: process.env.LOG_LEVEL || 'info',
1642
- });
1636
+ The instrumentation patches pino as it loads, so `init()` must run before the
1637
+ logger is created. Keep them in separate modules and import telemetry first.
1638
+ Don't pass the logger to `init()`: that forces you to create it too early.
1643
1639
 
1640
+ ```typescript
1641
+ // telemetry.ts
1642
+ import { init } from 'autotel';
1644
1643
  init({
1645
1644
  service: 'user-service',
1646
- logger,
1647
- autoInstrumentations: ['pino'], // Enable Pino instrumentation for trace context
1645
+ autoInstrumentations: ['http', 'pino'], // only these load
1646
+ logs: true, // export log records via OTLP (off by default)
1648
1647
  });
1649
1648
 
1649
+ // logger.ts
1650
+ import pino from 'pino';
1651
+ export const logger = pino({ level: process.env.LOG_LEVEL || 'info' });
1652
+
1653
+ // index.ts
1654
+ import './telemetry'; // first
1655
+ import { trace } from 'autotel';
1656
+ import { logger } from './logger';
1657
+
1650
1658
  export const createUser = trace(async (data: UserData) => {
1651
1659
  logger.info({ userId: data.id }, 'Creating user');
1652
1660
  try {
@@ -1660,29 +1668,34 @@ export const createUser = trace(async (data: UserData) => {
1660
1668
  });
1661
1669
  ```
1662
1670
 
1671
+ **ESM:** pino's entry module is loaded by `import`, which only the OTel loader
1672
+ hook can patch. Start node with `--import autotel/register` (autotel warns at
1673
+ startup if it's missing, or if pino was loaded before `init()`).
1674
+
1663
1675
  ### Using Winston
1664
1676
 
1665
- **Note:** While `@opentelemetry/auto-instrumentations-node` includes Winston instrumentation, you must install `@opentelemetry/instrumentation-winston` separately for trace context injection to work.
1677
+ **Note:** While `@opentelemetry/auto-instrumentations-node` includes Winston instrumentation, you must install `@opentelemetry/instrumentation-winston` separately for trace context injection to work. With `logs: true`, Winston records only reach OTLP if `@opentelemetry/winston-transport` is installed too.
1666
1678
 
1667
1679
  ```bash
1668
- npm install winston @opentelemetry/instrumentation-winston
1680
+ npm install winston @opentelemetry/instrumentation-winston @opentelemetry/winston-transport
1669
1681
  ```
1670
1682
 
1671
1683
  ```typescript
1672
- import winston from 'winston';
1684
+ // telemetry.ts, imported first
1673
1685
  import { init } from 'autotel';
1686
+ init({
1687
+ service: 'user-service',
1688
+ autoInstrumentations: ['winston'],
1689
+ logs: true,
1690
+ });
1674
1691
 
1675
- const logger = winston.createLogger({
1692
+ // logger.ts
1693
+ import winston from 'winston';
1694
+ export const logger = winston.createLogger({
1676
1695
  level: 'info',
1677
1696
  format: winston.format.json(),
1678
1697
  transports: [new winston.transports.Console()],
1679
1698
  });
1680
-
1681
- init({
1682
- service: 'user-service',
1683
- logger,
1684
- autoInstrumentations: ['winston'], // Enable Winston instrumentation for trace context
1685
- });
1686
1699
  ```
1687
1700
 
1688
1701
  ### Using Bunyan (or other loggers)
@@ -1694,16 +1707,13 @@ npm install bunyan @opentelemetry/instrumentation-bunyan
1694
1707
  ```
1695
1708
 
1696
1709
  ```typescript
1697
- import bunyan from 'bunyan';
1710
+ // telemetry.ts, imported first
1698
1711
  import { init } from 'autotel';
1712
+ init({ service: 'user-service', autoInstrumentations: ['bunyan'], logs: true });
1699
1713
 
1700
- const logger = bunyan.createLogger({ name: 'user-service' });
1701
-
1702
- init({
1703
- service: 'user-service',
1704
- logger,
1705
- autoInstrumentations: ['bunyan'], // Enable Bunyan instrumentation for trace context
1706
- });
1714
+ // logger.ts
1715
+ import bunyan from 'bunyan';
1716
+ export const logger = bunyan.createLogger({ name: 'user-service' });
1707
1717
  ```
1708
1718
 
1709
1719
  **Note:** For manual instrumentation configuration, you can also use:
@@ -1713,7 +1723,6 @@ import { BunyanInstrumentation } from '@opentelemetry/instrumentation-bunyan';
1713
1723
 
1714
1724
  init({
1715
1725
  service: 'user-service',
1716
- logger,
1717
1726
  instrumentations: [new BunyanInstrumentation()], // Manual instrumentation with custom config
1718
1727
  });
1719
1728
  ```
@@ -1742,16 +1751,13 @@ init({
1742
1751
 
1743
1752
  ```typescript
1744
1753
  import { init, trace, span, withTracing, setUser, httpServer } from 'autotel';
1745
- import pino from 'pino';
1746
1754
 
1747
- const logger = pino();
1748
1755
  init({
1749
1756
  service: 'checkout-api',
1750
- logger,
1751
1757
  canonicalLogLines: {
1752
1758
  enabled: true,
1753
1759
  rootSpansOnly: true, // One canonical log line per request
1754
- logger, // Use Pino for canonical log lines
1760
+ pretty: true, // Also print each line to the console
1755
1761
  },
1756
1762
  });
1757
1763
 
@@ -34,7 +34,11 @@ type BuiltinPatternName = keyof typeof builtinPatterns;
34
34
  * Attribute redactor configuration
35
35
  */
36
36
  interface AttributeRedactorConfig {
37
- /** Patterns to match against attribute keys (redacts entire value if key matches) */
37
+ /**
38
+ * Patterns to match against attribute keys (redacts entire value if key matches).
39
+ * Each is tested against the full key and against its last dot segment, so
40
+ * `/^password$/i` matches `password` and `user.password`.
41
+ */
38
42
  keyPatterns?: RegExp[];
39
43
  /** Patterns to match against attribute values (redacts matched portion) */
40
44
  valuePatterns?: ValuePatternConfig[];
@@ -34,7 +34,11 @@ type BuiltinPatternName = keyof typeof builtinPatterns;
34
34
  * Attribute redactor configuration
35
35
  */
36
36
  interface AttributeRedactorConfig {
37
- /** Patterns to match against attribute keys (redacts entire value if key matches) */
37
+ /**
38
+ * Patterns to match against attribute keys (redacts entire value if key matches).
39
+ * Each is tested against the full key and against its last dot segment, so
40
+ * `/^password$/i` matches `password` and `user.password`.
41
+ */
38
42
  keyPatterns?: RegExp[];
39
43
  /** Patterns to match against attribute values (redacts matched portion) */
40
44
  valuePatterns?: ValuePatternConfig[];
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_values = require('./values-AxGpgYBA.cjs');
2
+ const require_values = require('./values-9A6nOyZm.cjs');
3
3
 
4
4
  //#region src/attribute-redacting-processor.ts
5
5
  /**
@@ -240,6 +240,21 @@ function resolveConfig(config) {
240
240
  return resolvedConfig;
241
241
  }
242
242
  /**
243
+ * A key pattern matches the full attribute key or its last dot segment, so an
244
+ * anchored name pattern (`^password$`) also catches `user.password` and
245
+ * `http.request.header.authorization`. Only the last segment: `auth.method`
246
+ * names metadata about auth, not a credential.
247
+ */
248
+ function keyIsSensitive(key, keyPatterns) {
249
+ const lastSegment = key.slice(key.lastIndexOf(".") + 1);
250
+ return keyPatterns.some((pattern) => {
251
+ pattern.lastIndex = 0;
252
+ if (pattern.test(key)) return true;
253
+ pattern.lastIndex = 0;
254
+ return lastSegment !== key && pattern.test(lastSegment);
255
+ });
256
+ }
257
+ /**
243
258
  * Create a redactor function from config
244
259
  */
245
260
  function createRedactorFromConfig(config) {
@@ -253,13 +268,8 @@ function createRedactorFromConfig(config) {
253
268
  const maskers = valuePatterns.filter((vp) => vp.mask).map((vp) => [cloneRegex(vp.pattern), vp.mask]);
254
269
  return (key, value) => {
255
270
  const text = require_values.asString(value);
256
- if (text !== void 0) {
257
- for (const pattern of keyPatterns) {
258
- pattern.lastIndex = 0;
259
- if (pattern.test(key)) return defaultReplacement;
260
- }
261
- if (pathSet.has(key)) return defaultReplacement;
262
- }
271
+ const isStringArray = Array.isArray(value) && value.every((item) => require_values.asString(item) !== void 0);
272
+ if ((text !== void 0 || isStringArray) && (keyIsSensitive(key, keyPatterns) || pathSet.has(key))) return Array.isArray(value) ? value.map(() => defaultReplacement) : defaultReplacement;
263
273
  if (text === void 0) {
264
274
  if (Array.isArray(value)) return value.map((item) => {
265
275
  const itemText = require_values.asString(item);
@@ -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.cjs";
1
+ import { a as AttributeRedactorPreset, c as REDACTOR_PATTERNS, d as builtinPatterns, f as createAttributeRedactor, i as AttributeRedactorFn, l as REDACTOR_PRESETS, m as normalizeAttributeRedactorConfig, n as AttributeRedactingProcessorOptions, o as BuiltinPatternName, p as createRedactedSpan, r as AttributeRedactorConfig, s as MaskFn, t as AttributeRedactingProcessor, u as ValuePatternConfig } from "./attribute-redacting-processor-Cq7K8Okp.cjs";
2
2
  export { AttributeRedactingProcessor, AttributeRedactingProcessorOptions, AttributeRedactorConfig, AttributeRedactorFn, AttributeRedactorPreset, BuiltinPatternName, MaskFn, REDACTOR_PATTERNS, REDACTOR_PRESETS, ValuePatternConfig, builtinPatterns, createAttributeRedactor, createRedactedSpan, normalizeAttributeRedactorConfig };
@@ -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-rkV_WL-k.js";
1
+ import { a as AttributeRedactorPreset, c as REDACTOR_PATTERNS, d as builtinPatterns, f as createAttributeRedactor, i as AttributeRedactorFn, l as REDACTOR_PRESETS, m as normalizeAttributeRedactorConfig, n as AttributeRedactingProcessorOptions, o as BuiltinPatternName, p as createRedactedSpan, r as AttributeRedactorConfig, s as MaskFn, t as AttributeRedactingProcessor, u as ValuePatternConfig } from "./attribute-redacting-processor-BrrdojmP.js";
2
2
  export { AttributeRedactingProcessor, AttributeRedactingProcessorOptions, AttributeRedactorConfig, AttributeRedactorFn, AttributeRedactorPreset, BuiltinPatternName, MaskFn, REDACTOR_PATTERNS, REDACTOR_PRESETS, ValuePatternConfig, builtinPatterns, createAttributeRedactor, createRedactedSpan, normalizeAttributeRedactorConfig };
@@ -1,4 +1,4 @@
1
- import { _ as readProperty, h as isFunction, l as asString, s as asRecord, t as asBoolean } from "./values-xBtdXtjA.js";
1
+ import { g as isFunction, l as asString, s as asRecord, t as asBoolean, v as readProperty } from "./values-Dm0yEC5p.js";
2
2
 
3
3
  //#region src/attribute-redacting-processor.ts
4
4
  /**
@@ -239,6 +239,21 @@ function resolveConfig(config) {
239
239
  return resolvedConfig;
240
240
  }
241
241
  /**
242
+ * A key pattern matches the full attribute key or its last dot segment, so an
243
+ * anchored name pattern (`^password$`) also catches `user.password` and
244
+ * `http.request.header.authorization`. Only the last segment: `auth.method`
245
+ * names metadata about auth, not a credential.
246
+ */
247
+ function keyIsSensitive(key, keyPatterns) {
248
+ const lastSegment = key.slice(key.lastIndexOf(".") + 1);
249
+ return keyPatterns.some((pattern) => {
250
+ pattern.lastIndex = 0;
251
+ if (pattern.test(key)) return true;
252
+ pattern.lastIndex = 0;
253
+ return lastSegment !== key && pattern.test(lastSegment);
254
+ });
255
+ }
256
+ /**
242
257
  * Create a redactor function from config
243
258
  */
244
259
  function createRedactorFromConfig(config) {
@@ -252,13 +267,8 @@ function createRedactorFromConfig(config) {
252
267
  const maskers = valuePatterns.filter((vp) => vp.mask).map((vp) => [cloneRegex(vp.pattern), vp.mask]);
253
268
  return (key, value) => {
254
269
  const text = asString(value);
255
- if (text !== void 0) {
256
- for (const pattern of keyPatterns) {
257
- pattern.lastIndex = 0;
258
- if (pattern.test(key)) return defaultReplacement;
259
- }
260
- if (pathSet.has(key)) return defaultReplacement;
261
- }
270
+ const isStringArray = Array.isArray(value) && value.every((item) => asString(item) !== void 0);
271
+ if ((text !== void 0 || isStringArray) && (keyIsSensitive(key, keyPatterns) || pathSet.has(key))) return Array.isArray(value) ? value.map(() => defaultReplacement) : defaultReplacement;
262
272
  if (text === void 0) {
263
273
  if (Array.isArray(value)) return value.map((item) => {
264
274
  const itemText = asString(item);
@@ -1,4 +1,4 @@
1
- const require_values = require('./values-AxGpgYBA.cjs');
1
+ const require_values = require('./values-9A6nOyZm.cjs');
2
2
  const require_attribute_redacting_processor = require('./attribute-redacting-processor.cjs');
3
3
  const require_registry = require('./registry-B3ZJmUtU.cjs');
4
4
  let _opentelemetry_resources = require("@opentelemetry/resources");
@@ -1,4 +1,4 @@
1
- import { l as asString } from "./values-xBtdXtjA.js";
1
+ import { l as asString } from "./values-Dm0yEC5p.js";
2
2
  import { REDACTOR_PATTERNS } from "./attribute-redacting-processor.js";
3
3
  import { C as URLAttributes, S as ThreadAttributes, _ as RPCAttributes, a as DeviceAttributes, b as SessionAttributes, c as FaaSAttributes, d as HTTPAttributes, f as K8sAttributes, g as ProcessAttributes, h as OTelAttributes, i as DBAttributes, l as FeatureFlagAttributes, m as NetworkAttributes, n as CodeAttributes, o as ErrorAttributes, p as MessagingAttributes, r as ContainerAttributes, s as ExceptionAttributes, t as CloudAttributes, u as GraphQLAttributes, v as ServerAddressAttributes, w as UserAttributes, x as TLSAttributes, y as ServiceAttributes } from "./registry-Cy4JjIB-.js";
4
4
  import { resourceFromAttributes } from "@opentelemetry/resources";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_attributes = require('./attributes-Ii3jDPsW.cjs');
2
+ const require_attributes = require('./attributes-BqgJl9qA.cjs');
3
3
 
4
4
  exports.attrs = require_attributes.attrs;
5
5
  exports.autoRedactPII = require_attributes.autoRedactPII;
@@ -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-CuGx6cOI.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-BtwTkuX7.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
1
  const require_rolldown_runtime = require('./rolldown-runtime-C24Yb2bl.cjs');
2
- const require_init = require('./init-Cx1-ejLn.cjs');
2
+ const require_init = require('./init-DlJvp1WH.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-BvUtwZNx.js";
1
+ import { _ as loadYamlConfig, a as init } from "./init-D4TpmUIg.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-AxGpgYBA.cjs');
2
+ const require_values = require('./values-9A6nOyZm.cjs');
3
3
  let _opentelemetry_api = require("@opentelemetry/api");
4
4
 
5
5
  //#region src/business-baggage.ts
@@ -1,4 +1,4 @@
1
- import { f as describeValue, i as asNumber, l as asString, t as asBoolean } from "./values-xBtdXtjA.js";
1
+ import { f as describeValue, i as asNumber, l as asString, t as asBoolean } from "./values-Dm0yEC5p.js";
2
2
  import { context, propagation } from "@opentelemetry/api";
3
3
 
4
4
  //#region src/business-baggage.ts
@@ -1,5 +1,5 @@
1
1
  import { t as UnknownRecord } from "./values-CeMH-mYG.js";
2
- import { s as Logger } from "./logger-C9UT1aZ_.js";
2
+ import { s as Logger } from "./logger-b0qgWFy7.js";
3
3
  import { AttributeValue } from "@opentelemetry/api";
4
4
  import { ReadableSpan, SpanProcessor } from "@opentelemetry/sdk-trace-base";
5
5
  //#region src/processors/canonical-log-line-processor.d.ts
@@ -105,7 +105,6 @@ interface CanonicalLogLineOptions {
105
105
  * const logger = pino();
106
106
  * init({
107
107
  * service: 'my-app',
108
- * logger,
109
108
  * canonicalLogLines: {
110
109
  * enabled: true,
111
110
  * logger, // Use Pino for canonical log lines
@@ -1,5 +1,5 @@
1
1
  import { t as UnknownRecord } from "./values-CeMH-mYG.cjs";
2
- import { s as Logger } from "./logger-C9UT1aZ_.cjs";
2
+ import { s as Logger } from "./logger-b0qgWFy7.cjs";
3
3
  import { ReadableSpan, SpanProcessor } from "@opentelemetry/sdk-trace-base";
4
4
  import { AttributeValue } from "@opentelemetry/api";
5
5
  //#region src/processors/canonical-log-line-processor.d.ts
@@ -105,7 +105,6 @@ interface CanonicalLogLineOptions {
105
105
  * const logger = pino();
106
106
  * init({
107
107
  * service: 'my-app',
108
- * logger,
109
108
  * canonicalLogLines: {
110
109
  * enabled: true,
111
110
  * logger, // Use Pino for canonical log lines
@@ -1,4 +1,4 @@
1
- const require_values = require('./values-AxGpgYBA.cjs');
1
+ const require_values = require('./values-9A6nOyZm.cjs');
2
2
  let _opentelemetry_api_logs = require("@opentelemetry/api-logs");
3
3
 
4
4
  //#region src/pretty-log-formatter.ts
@@ -209,7 +209,6 @@ const SEVERITY_NUMBERS = /* @__PURE__ */ new Map([
209
209
  * const logger = pino();
210
210
  * init({
211
211
  * service: 'my-app',
212
- * logger,
213
212
  * canonicalLogLines: {
214
213
  * enabled: true,
215
214
  * logger, // Use Pino for canonical log lines
@@ -1,4 +1,4 @@
1
- import { i as asNumber, l as asString, p as hasProcess, s as asRecord, t as asBoolean, x as toError } from "./values-xBtdXtjA.js";
1
+ import { C as toError, i as asNumber, l as asString, m as hasProcess, s as asRecord, t as asBoolean } from "./values-Dm0yEC5p.js";
2
2
  import { SeverityNumber, logs } from "@opentelemetry/api-logs";
3
3
 
4
4
  //#region src/pretty-log-formatter.ts
@@ -209,7 +209,6 @@ const SEVERITY_NUMBERS = /* @__PURE__ */ new Map([
209
209
  * const logger = pino();
210
210
  * init({
211
211
  * service: 'my-app',
212
- * logger,
213
212
  * canonicalLogLines: {
214
213
  * enabled: true,
215
214
  * logger, // Use Pino for canonical log lines
@@ -1,4 +1,4 @@
1
- const require_node_require = require('./node-require-BPsB09eC.cjs');
1
+ const require_node_require = require('./node-require-BotQNkYw.cjs');
2
2
 
3
3
  //#region src/diagnostics/channel.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { n as safeRequire } from "./node-require-CkK_xzL-.js";
1
+ import { n as safeRequire } from "./node-require-CY0YUdvZ.js";
2
2
 
3
3
  //#region src/diagnostics/channel.ts
4
4
  /**
package/dist/config.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as ILogger } from "./logger-C9UT1aZ_.cjs";
1
+ import { t as ILogger } from "./logger-b0qgWFy7.cjs";
2
2
  import { Meter, Tracer } from "@opentelemetry/api";
3
3
  //#region src/config.d.ts
4
4
  export declare const FEATURE_FLAGS: {
package/dist/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as ILogger } from "./logger-C9UT1aZ_.js";
1
+ import { t as ILogger } from "./logger-b0qgWFy7.js";
2
2
  import { Meter, Tracer } from "@opentelemetry/api";
3
3
  //#region src/config.d.ts
4
4
  export declare const FEATURE_FLAGS: {
@@ -1,4 +1,4 @@
1
- import { h as isFunction } from "./values-xBtdXtjA.js";
1
+ import { g as isFunction } from "./values-Dm0yEC5p.js";
2
2
 
3
3
  //#region src/correlated-events.ts
4
4
  function sanitizeEventKey(input) {
@@ -1,4 +1,4 @@
1
- const require_values = require('./values-AxGpgYBA.cjs');
1
+ const require_values = require('./values-9A6nOyZm.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-Cx1-ejLn.cjs');
2
+ const require_init = require('./init-DlJvp1WH.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-BvUtwZNx.js";
1
+ import { $ as CORRELATION_ID_BAGGAGE_KEY, at as setCorrelationId, et as generateCorrelationId, it as runWithCorrelationId, nt as getCorrelationStorage, ot as setCorrelationIdInBaggage, rt as getOrCreateCorrelationId, tt as getCorrelationId } from "./init-D4TpmUIg.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-AxGpgYBA.cjs');
2
+ const require_values = require('./values-9A6nOyZm.cjs');
3
3
  const require_config = require('./config.cjs');
4
4
  let _opentelemetry_api = require("@opentelemetry/api");
5
5
 
package/dist/db.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as readProperty, h as isFunction, l as asString, r as asFunction, s as asRecord } from "./values-xBtdXtjA.js";
1
+ import { g as isFunction, l as asString, r as asFunction, s as asRecord, v as readProperty } from "./values-Dm0yEC5p.js";
2
2
  import { getConfig } from "./config.js";
3
3
  import { SpanStatusCode } from "@opentelemetry/api";
4
4
 
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_init = require('./init-Cx1-ejLn.cjs');
3
- const require_values = require('./values-AxGpgYBA.cjs');
2
+ const require_init = require('./init-DlJvp1WH.cjs');
3
+ const require_values = require('./values-9A6nOyZm.cjs');
4
4
  const require_config = require('./config.cjs');
5
5
  let _opentelemetry_api = require("@opentelemetry/api");
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { n as TraceContext } from "./trace-context-f7Xq0Q2q.cjs";
2
- import { h as TracingOptions } from "./functional-j8Joyrwd.cjs";
2
+ import { h as TracingOptions } from "./functional-CN_cqIX8.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-CbcInXMJ.js";
2
+ import { h as TracingOptions } from "./functional-IGZ-Urlq.js";
3
3
  //#region src/decorators.d.ts
4
4
  /**
5
5
  * Options for @Trace method decorator
@@ -1,5 +1,5 @@
1
- import { G as createTraceContext } from "./init-BvUtwZNx.js";
2
- import { y as splitNameOrOptions } from "./values-xBtdXtjA.js";
1
+ import { K as createTraceContext } from "./init-D4TpmUIg.js";
2
+ import { b as splitNameOrOptions } from "./values-Dm0yEC5p.js";
3
3
  import { getConfig } from "./config.js";
4
4
  import { SpanStatusCode } from "@opentelemetry/api";
5
5
 
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_values = require('./values-AxGpgYBA.cjs');
3
- const require_node_require = require('./node-require-BPsB09eC.cjs');
4
- const require_channel = require('./channel-D0eaVqn3.cjs');
2
+ const require_values = require('./values-9A6nOyZm.cjs');
3
+ const require_node_require = require('./node-require-BotQNkYw.cjs');
4
+ const require_channel = require('./channel-3MV-4Aqv.cjs');
5
5
  let _opentelemetry_api = require("@opentelemetry/api");
6
6
  let _opentelemetry_api_logs = require("@opentelemetry/api-logs");
7
7
  let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conventions");
@@ -1,6 +1,6 @@
1
- import { l as asString } from "./values-xBtdXtjA.js";
2
- import { n as safeRequire } from "./node-require-CkK_xzL-.js";
3
- import { n as subscribeChannel, r as subscribeTracingChannel, t as diagnosticsChannelAvailable } from "./channel-BobQKsZd.js";
1
+ import { l as asString } from "./values-Dm0yEC5p.js";
2
+ import { n as safeRequire } from "./node-require-CY0YUdvZ.js";
3
+ import { n as subscribeChannel, r as subscribeTracingChannel, t as diagnosticsChannelAvailable } from "./channel-BNFp4Sfq.js";
4
4
  import { SpanKind, SpanStatusCode, context, defaultTextMapGetter, defaultTextMapSetter, propagation, trace } from "@opentelemetry/api";
5
5
  import { SeverityNumber, logs } from "@opentelemetry/api-logs";
6
6
  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";
package/dist/event.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_init = require('./init-Cx1-ejLn.cjs');
2
+ const require_init = require('./init-DlJvp1WH.cjs');
3
3
 
4
4
  exports.Event = require_init.Event;
5
5
  exports.getEvents = require_init.getEvents;
package/dist/event.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { s as Logger } from "./logger-C9UT1aZ_.cjs";
1
+ import { s as Logger } from "./logger-b0qgWFy7.cjs";
2
2
  import { c as FunnelStatus, i as EventAttributesInput, l as OutcomeStatus, o as EventSubscriber, r as EventAttributes } from "./event-subscriber-DMACQA-1.cjs";
3
3
  import { t as EventCollector } from "./event-testing-CBtnJXE5.cjs";
4
4
  //#region src/event.d.ts
package/dist/event.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { s as Logger } from "./logger-C9UT1aZ_.js";
1
+ import { s as Logger } from "./logger-b0qgWFy7.js";
2
2
  import { c as FunnelStatus, i as EventAttributesInput, l as OutcomeStatus, o as EventSubscriber, r as EventAttributes } from "./event-subscriber-DMACQA-1.js";
3
3
  import { t as EventCollector } from "./event-testing-CkPgV3Ii.js";
4
4
  //#region src/event.d.ts
package/dist/event.js CHANGED
@@ -1,3 +1,3 @@
1
- import { d as Event, f as getEvents, p as resetEvents } from "./init-BvUtwZNx.js";
1
+ import { d as Event, f as getEvents, p as resetEvents } from "./init-D4TpmUIg.js";
2
2
 
3
3
  export { Event, getEvents, resetEvents };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_values = require('./values-AxGpgYBA.cjs');
2
+ const require_values = require('./values-9A6nOyZm.cjs');
3
3
 
4
4
  //#region src/exception-fingerprint.ts
5
5
  /** Attribute the fingerprint is written to. */
@@ -1,4 +1,4 @@
1
- import { g as nonEmptyString } from "./values-xBtdXtjA.js";
1
+ import { _ as nonEmptyString } from "./values-Dm0yEC5p.js";
2
2
 
3
3
  //#region src/exception-fingerprint.ts
4
4
  /** Attribute the fingerprint is written to. */
@@ -1,8 +1,8 @@
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
- import { l as asString, m as isDevelopment } from "./values-xBtdXtjA.js";
1
+ import { A as AlwaysSampler, D as AUTOTEL_SAMPLING_TAIL_EVALUATED, E as AUTOTEL_SAMPLING_RATE, H as isForceKept, J as explicitSpanStatus, K as createTraceContext, O as AUTOTEL_SAMPLING_TAIL_KEEP, S as rememberRequestAttributes, X as getContextStorage, Y as getActiveContextWithBaggage, Z as getEventQueue, h as runInOperationContext, i as getSdk, n as getConfiguredSampler, t as getConfig, x as getRequestSpanIn, z as debugCaptureRequested } from "./init-D4TpmUIg.js";
2
+ import { h as isDevelopment, l as asString } from "./values-Dm0yEC5p.js";
3
3
  import { getForceFlushableProvider } from "./tracer-provider.js";
4
4
  import { getConfig as getConfig$1 } from "./config.js";
5
- import { a as flattenToAttributes } from "./structured-error-Y9y-1Pae.js";
5
+ import { a as flattenToAttributes } from "./structured-error-UEtlg9Uu.js";
6
6
  import { evidenceAttribute } from "./evidence.js";
7
7
  import { setSpanName } from "./trace-helpers.js";
8
8
  import { SpanStatusCode, context, propagation, trace } from "@opentelemetry/api";
@@ -734,7 +734,7 @@ const trace$1 = Object.assign(traceImpl, { run });
734
734
  * ```
735
735
  */
736
736
  function withTracing(options = {}) {
737
- return (fnFactory) => wrapFactoryWithTracing(fnFactory, options);
737
+ return ((fnFactory) => wrapFactoryWithTracing(fnFactory, options));
738
738
  }
739
739
  function instrument(options) {
740
740
  if (!options || typeof options !== "object") throw new TypeError("instrument: expected { key, fn } or { functions: { name: fn } }");
@@ -1,5 +1,5 @@
1
1
  import { n as TraceContext } from "./trace-context-f7Xq0Q2q.cjs";
2
- import { m as Sampler$1 } from "./sampling-Dud4XU2m.cjs";
2
+ import { m as Sampler$1 } from "./sampling-CLJmXMw0.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>;
@@ -250,6 +250,13 @@ declare function run<TReturn>(options: TracingOptions<[], TReturn>, operation: (
250
250
  declare const trace$1: typeof traceImpl & {
251
251
  run: typeof run;
252
252
  };
253
+ /** `T` when it has no awaitable member; otherwise `never`, so the match fails. */
254
+ type NotThenable<T> = T extends PromiseLike<unknown> ? never : T;
255
+ interface TracingWrapper<TCfgArgs extends unknown[], TCfgReturn> {
256
+ <TArgs extends TCfgArgs, TReturn extends TCfgReturn>(fnFactory: (ctx: TraceContext) => (...args: TArgs) => PromiseLike<TReturn>): (...args: TArgs) => Promise<TReturn>;
257
+ <TArgs extends TCfgArgs, TReturn extends TCfgReturn>(fnFactory: (ctx: TraceContext) => (...args: TArgs) => NotThenable<TReturn>): (...args: TArgs) => TReturn;
258
+ <TArgs extends TCfgArgs, TReturn extends TCfgReturn>(fnFactory: (ctx: TraceContext) => (...args: TArgs) => TReturn | PromiseLike<TReturn>): WrappedFunction<TArgs, TReturn>;
259
+ }
253
260
  /**
254
261
  * Approach 2: withTracing() - Middleware-style composable wrapper
255
262
  *
@@ -283,7 +290,7 @@ declare const trace$1: typeof traceImpl & {
283
290
  * )(ctx => async (data) => { })
284
291
  * ```
285
292
  */
286
- declare function withTracing<TCfgArgs extends unknown[] = unknown[], TCfgReturn = unknown>(options?: TracingOptions<TCfgArgs, TCfgReturn>): <TArgs extends TCfgArgs, TReturn extends TCfgReturn>(fnFactory: (ctx: TraceContext) => (...args: TArgs) => TReturn | PromiseLike<TReturn>) => WrappedFunction<TArgs, TReturn>;
293
+ declare function withTracing<TCfgArgs extends unknown[] = unknown[], TCfgReturn = unknown>(options?: TracingOptions<TCfgArgs, TCfgReturn>): TracingWrapper<TCfgArgs, TCfgReturn>;
287
294
  /**
288
295
  * Approach 3: instrument() - Batch auto-instrumentation
289
296
  *