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.
- package/README.md +38 -32
- package/dist/{attribute-redacting-processor-rkV_WL-k.d.ts → attribute-redacting-processor-BrrdojmP.d.ts} +5 -1
- package/dist/{attribute-redacting-processor-CvBE0z1p.d.cts → attribute-redacting-processor-Cq7K8Okp.d.cts} +5 -1
- package/dist/attribute-redacting-processor.cjs +18 -8
- package/dist/attribute-redacting-processor.d.cts +1 -1
- package/dist/attribute-redacting-processor.d.ts +1 -1
- package/dist/attribute-redacting-processor.js +18 -8
- package/dist/{attributes-Ii3jDPsW.cjs → attributes-BqgJl9qA.cjs} +1 -1
- package/dist/{attributes-CuGx6cOI.js → attributes-BtwTkuX7.js} +1 -1
- package/dist/attributes.cjs +1 -1
- package/dist/attributes.js +1 -1
- package/dist/auto.cjs +1 -1
- package/dist/auto.js +1 -1
- package/dist/business-baggage.cjs +1 -1
- package/dist/business-baggage.js +1 -1
- package/dist/{canonical-log-line-processor-DDGzm-wi.d.ts → canonical-log-line-processor-BaFqHO5l.d.ts} +1 -2
- package/dist/{canonical-log-line-processor-DLeAQjgb.d.cts → canonical-log-line-processor-C-RdV5af.d.cts} +1 -2
- package/dist/{canonical-log-line-processor-BU03jJeA.cjs → canonical-log-line-processor-DScNq1g8.cjs} +1 -2
- package/dist/{canonical-log-line-processor-BQ6NeZAk.js → canonical-log-line-processor-naZRETyk.js} +1 -2
- package/dist/{channel-D0eaVqn3.cjs → channel-3MV-4Aqv.cjs} +1 -1
- package/dist/{channel-BobQKsZd.js → channel-BNFp4Sfq.js} +1 -1
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/{correlated-events-BfpH5uS-.js → correlated-events-CZFe6Z1P.js} +1 -1
- package/dist/{correlated-events-DE_4A3oD.cjs → correlated-events-wCrXVUby.cjs} +1 -1
- package/dist/correlation-id.cjs +1 -1
- package/dist/correlation-id.js +1 -1
- package/dist/db.cjs +1 -1
- package/dist/db.js +1 -1
- package/dist/decorators.cjs +2 -2
- package/dist/decorators.d.cts +1 -1
- package/dist/decorators.d.ts +1 -1
- package/dist/decorators.js +2 -2
- package/dist/diagnostics.cjs +3 -3
- package/dist/diagnostics.js +3 -3
- package/dist/event.cjs +1 -1
- package/dist/event.d.cts +1 -1
- package/dist/event.d.ts +1 -1
- package/dist/event.js +1 -1
- package/dist/exception-fingerprint.cjs +1 -1
- package/dist/exception-fingerprint.js +1 -1
- package/dist/{functional-C4gGiBou.js → functional-7uwlAIJd.js} +4 -4
- package/dist/{functional-j8Joyrwd.d.cts → functional-CN_cqIX8.d.cts} +9 -2
- package/dist/{functional-DptEM9La.cjs → functional-DCfOaKoM.cjs} +4 -4
- package/dist/{functional-CbcInXMJ.d.ts → functional-IGZ-Urlq.d.ts} +9 -2
- package/dist/functional.cjs +1 -1
- package/dist/functional.d.cts +1 -1
- package/dist/functional.d.ts +1 -1
- package/dist/functional.js +1 -1
- package/dist/http.cjs +2 -2
- package/dist/http.js +2 -2
- package/dist/index.cjs +9 -8
- package/dist/index.d.cts +31 -7
- package/dist/index.d.ts +31 -7
- package/dist/index.js +9 -9
- package/dist/{init-Biyby8Br.d.ts → init-BYq2sUXg.d.ts} +26 -31
- package/dist/{init-BvUtwZNx.js → init-D4TpmUIg.js} +142 -27
- package/dist/{init-Cx1-ejLn.cjs → init-DlJvp1WH.cjs} +147 -26
- package/dist/{init-CHanKvOq.d.cts → init-axM4kgR4.d.cts} +26 -31
- package/dist/instrumentation.cjs +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{logger-B2VPcBgZ.js → logger-4VXLbqWx.js} +11 -19
- package/dist/{logger-DLjHQAus.cjs → logger-CWFxTLtR.cjs} +11 -19
- package/dist/{logger-C9UT1aZ_.d.cts → logger-b0qgWFy7.d.cts} +10 -18
- package/dist/{logger-C9UT1aZ_.d.ts → logger-b0qgWFy7.d.ts} +10 -18
- package/dist/logger.cjs +1 -1
- package/dist/logger.d.cts +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +1 -1
- package/dist/messaging-adapters.cjs +1 -1
- package/dist/messaging-adapters.js +1 -1
- package/dist/messaging.cjs +4 -4
- package/dist/messaging.js +4 -4
- package/dist/metric.d.cts +1 -1
- package/dist/metric.d.ts +1 -1
- package/dist/{node-require-BPsB09eC.cjs → node-require-BotQNkYw.cjs} +1 -1
- package/dist/{node-require-CkK_xzL-.js → node-require-CY0YUdvZ.js} +1 -1
- package/dist/parse-error.cjs +1 -1
- package/dist/parse-error.js +1 -1
- package/dist/policy.cjs +0 -0
- package/dist/policy.js +0 -0
- package/dist/processors.cjs +1 -1
- package/dist/processors.d.cts +1 -1
- package/dist/processors.d.ts +1 -1
- package/dist/processors.js +1 -1
- package/dist/register.cjs +1 -0
- package/dist/register.js +1 -0
- package/dist/{sampling-Dud4XU2m.d.cts → sampling-CLJmXMw0.d.cts} +1 -1
- package/dist/{sampling-B_8orhSB.d.ts → sampling-DBlX8Nv5.d.ts} +1 -1
- package/dist/sampling.cjs +1 -1
- package/dist/sampling.d.cts +1 -1
- package/dist/sampling.d.ts +1 -1
- package/dist/sampling.js +1 -1
- package/dist/semantic-helpers.cjs +2 -2
- package/dist/semantic-helpers.js +2 -2
- package/dist/{stable-hash-sLi1o4jj.cjs → stable-hash-58iP5-N-.cjs} +1 -1
- package/dist/{stable-hash-AOUgw1DW.js → stable-hash-DVEU2MqW.js} +1 -1
- package/dist/{structured-error-DynjWTTu.cjs → structured-error-Ci8s_M6u.cjs} +6 -6
- package/dist/{structured-error-Y9y-1Pae.js → structured-error-UEtlg9Uu.js} +6 -6
- package/dist/tail-sampling-processor.cjs +1 -1
- package/dist/tail-sampling-processor.js +1 -1
- package/dist/test-span-collector.cjs +1 -1
- package/dist/test-span-collector.js +1 -1
- package/dist/testing.cjs +11 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +12 -2
- package/dist/trace-helpers.cjs +2 -2
- package/dist/trace-helpers.js +2 -2
- package/dist/tracer-provider.cjs +1 -1
- package/dist/tracer-provider.js +1 -1
- package/dist/validate.cjs +3 -3
- package/dist/validate.js +3 -3
- package/dist/{values-AxGpgYBA.cjs → values-9A6nOyZm.cjs} +69 -3
- package/dist/{values-xBtdXtjA.js → values-Dm0yEC5p.js} +58 -4
- package/dist/webhook.cjs +3 -3
- package/dist/webhook.js +3 -3
- package/dist/workflow-distributed.cjs +3 -3
- package/dist/workflow-distributed.js +3 -3
- package/dist/workflow.cjs +3 -3
- package/dist/workflow.js +3 -3
- package/dist/yaml-config.cjs +1 -1
- package/dist/yaml-config.d.cts +2 -2
- package/dist/yaml-config.d.ts +2 -2
- package/dist/yaml-config.js +1 -1
- 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
|
-
|
|
1637
|
-
import
|
|
1638
|
-
|
|
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
|
-
|
|
1647
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1710
|
+
// telemetry.ts, imported first
|
|
1698
1711
|
import { init } from 'autotel';
|
|
1712
|
+
init({ service: 'user-service', autoInstrumentations: ['bunyan'], logs: true });
|
|
1699
1713
|
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
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
|
-
|
|
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
|
-
/**
|
|
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
|
-
/**
|
|
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-
|
|
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
|
-
|
|
257
|
-
|
|
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-
|
|
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-
|
|
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 {
|
|
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
|
-
|
|
256
|
-
|
|
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-
|
|
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-
|
|
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";
|
package/dist/attributes.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_attributes = require('./attributes-
|
|
2
|
+
const require_attributes = require('./attributes-BqgJl9qA.cjs');
|
|
3
3
|
|
|
4
4
|
exports.attrs = require_attributes.attrs;
|
|
5
5
|
exports.autoRedactPII = require_attributes.autoRedactPII;
|
package/dist/attributes.js
CHANGED
|
@@ -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-
|
|
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-
|
|
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,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_values = require('./values-
|
|
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
|
package/dist/business-baggage.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as describeValue, i as asNumber, l as asString, t as asBoolean } from "./values-
|
|
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-
|
|
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-
|
|
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
|
package/dist/{canonical-log-line-processor-BU03jJeA.cjs → canonical-log-line-processor-DScNq1g8.cjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_values = require('./values-
|
|
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
|
package/dist/{canonical-log-line-processor-BQ6NeZAk.js → canonical-log-line-processor-naZRETyk.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as asNumber, l as asString,
|
|
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
|
package/dist/config.d.cts
CHANGED
package/dist/config.d.ts
CHANGED
package/dist/correlation-id.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_init = require('./init-
|
|
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;
|
package/dist/correlation-id.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
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-
|
|
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 {
|
|
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
|
|
package/dist/decorators.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_init = require('./init-
|
|
3
|
-
const require_values = require('./values-
|
|
2
|
+
const require_init = require('./init-DlJvp1WH.cjs');
|
|
3
|
+
const require_values = require('./values-9A6nOyZm.cjs');
|
|
4
4
|
const require_config = require('./config.cjs');
|
|
5
5
|
let _opentelemetry_api = require("@opentelemetry/api");
|
|
6
6
|
|
package/dist/decorators.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as TraceContext } from "./trace-context-f7Xq0Q2q.cjs";
|
|
2
|
-
import { h as TracingOptions } from "./functional-
|
|
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
|
package/dist/decorators.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as TraceContext } from "./trace-context-CqCblIQE.js";
|
|
2
|
-
import { h as TracingOptions } from "./functional-
|
|
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
|
package/dist/decorators.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
|
package/dist/diagnostics.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_values = require('./values-
|
|
3
|
-
const require_node_require = require('./node-require-
|
|
4
|
-
const require_channel = require('./channel-
|
|
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");
|
package/dist/diagnostics.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { l as asString } from "./values-
|
|
2
|
-
import { n as safeRequire } from "./node-require-
|
|
3
|
-
import { n as subscribeChannel, r as subscribeTracingChannel, t as diagnosticsChannelAvailable } from "./channel-
|
|
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
package/dist/event.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as Logger } from "./logger-
|
|
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-
|
|
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,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_values = require('./values-
|
|
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,8 +1,8 @@
|
|
|
1
|
-
import { D as
|
|
2
|
-
import {
|
|
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-
|
|
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-
|
|
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>): <
|
|
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
|
*
|