autotel 2.25.5 → 2.26.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 +47 -1
- package/dist/auto.cjs +2 -2
- package/dist/auto.js +1 -1
- package/dist/{chunk-OPTGXEVN.js → chunk-4PTCDOZY.js} +3 -3
- package/dist/{chunk-OPTGXEVN.js.map → chunk-4PTCDOZY.js.map} +1 -1
- package/dist/{chunk-MN6PZ4AN.cjs → chunk-CMADDTHY.cjs} +7 -7
- package/dist/{chunk-MN6PZ4AN.cjs.map → chunk-CMADDTHY.cjs.map} +1 -1
- package/dist/{chunk-CMUM4JQI.js → chunk-DGPUZ6TE.js} +3 -3
- package/dist/{chunk-CMUM4JQI.js.map → chunk-DGPUZ6TE.js.map} +1 -1
- package/dist/{chunk-MNBAXRVG.js → chunk-EXOXDI5A.js} +74 -4
- package/dist/chunk-EXOXDI5A.js.map +1 -0
- package/dist/{chunk-QDREXAD7.js → chunk-GTD3NXOS.js} +3 -3
- package/dist/{chunk-QDREXAD7.js.map → chunk-GTD3NXOS.js.map} +1 -1
- package/dist/{chunk-A5ZUL2RZ.cjs → chunk-II7GFVAF.cjs} +13 -13
- package/dist/{chunk-A5ZUL2RZ.cjs.map → chunk-II7GFVAF.cjs.map} +1 -1
- package/dist/{chunk-I6JPSD4R.cjs → chunk-N344PVE5.cjs} +5 -5
- package/dist/{chunk-I6JPSD4R.cjs.map → chunk-N344PVE5.cjs.map} +1 -1
- package/dist/{chunk-WYP6OOCT.js → chunk-RXFZKLRQ.js} +3 -3
- package/dist/{chunk-WYP6OOCT.js.map → chunk-RXFZKLRQ.js.map} +1 -1
- package/dist/{chunk-EEJGUBWV.cjs → chunk-TS7IHIRW.cjs} +5 -5
- package/dist/{chunk-EEJGUBWV.cjs.map → chunk-TS7IHIRW.cjs.map} +1 -1
- package/dist/{chunk-ITYASFHQ.cjs → chunk-UJJPTSEI.cjs} +74 -3
- package/dist/chunk-UJJPTSEI.cjs.map +1 -0
- package/dist/{chunk-XB2GITM5.js → chunk-WAB4CHBU.js} +3 -3
- package/dist/{chunk-XB2GITM5.js.map → chunk-WAB4CHBU.js.map} +1 -1
- package/dist/{chunk-QQLP4M6W.cjs → chunk-ZJ5GXCOT.cjs} +26 -26
- package/dist/{chunk-QQLP4M6W.cjs.map → chunk-ZJ5GXCOT.cjs.map} +1 -1
- package/dist/decorators.cjs +2 -2
- package/dist/decorators.js +2 -2
- package/dist/event.cjs +5 -5
- package/dist/event.js +2 -2
- package/dist/functional.cjs +9 -9
- package/dist/functional.js +2 -2
- package/dist/index.cjs +42 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -9
- package/dist/index.js.map +1 -1
- package/dist/{init-C_PiC_Su.d.ts → init-FiR_glVc.d.ts} +23 -0
- package/dist/{init-CIzpC5kZ.d.cts → init-QSj7X6zU.d.cts} +23 -0
- package/dist/instrumentation.cjs +8 -8
- package/dist/instrumentation.js +1 -1
- package/dist/messaging.cjs +6 -6
- package/dist/messaging.js +3 -3
- package/dist/semantic-helpers.cjs +7 -7
- package/dist/semantic-helpers.js +3 -3
- package/dist/webhook.cjs +3 -3
- package/dist/webhook.js +2 -2
- package/dist/workflow-distributed.cjs +4 -4
- package/dist/workflow-distributed.js +2 -2
- package/dist/workflow.cjs +7 -7
- package/dist/workflow.js +3 -3
- package/dist/yaml-config.d.cts +1 -1
- package/dist/yaml-config.d.ts +1 -1
- package/package.json +41 -41
- package/src/devtools.ts +60 -0
- package/src/hook.mjs +2 -2
- package/src/init.customization.test.ts +81 -0
- package/src/init.ts +71 -1
- package/src/shutdown.test.ts +35 -1
- package/src/shutdown.ts +3 -1
- package/dist/chunk-ITYASFHQ.cjs.map +0 -1
- package/dist/chunk-MNBAXRVG.js.map +0 -1
package/README.md
CHANGED
|
@@ -146,8 +146,10 @@ Replace `NODE_OPTIONS` and 30+ lines of SDK boilerplate with `init()`, wrap func
|
|
|
146
146
|
|
|
147
147
|
```bash
|
|
148
148
|
npm install autotel
|
|
149
|
+
npm install -D autotel-devtools # optional but recommended for local DX
|
|
149
150
|
# or
|
|
150
151
|
pnpm add autotel
|
|
152
|
+
pnpm add -D autotel-devtools
|
|
151
153
|
```
|
|
152
154
|
|
|
153
155
|
### 2. Initialize once at startup
|
|
@@ -157,7 +159,7 @@ import { init } from 'autotel';
|
|
|
157
159
|
|
|
158
160
|
init({
|
|
159
161
|
service: 'checkout-api',
|
|
160
|
-
|
|
162
|
+
devtools: true,
|
|
161
163
|
});
|
|
162
164
|
```
|
|
163
165
|
|
|
@@ -169,6 +171,29 @@ Defaults:
|
|
|
169
171
|
- Version: auto-detected from `package.json`
|
|
170
172
|
- Events auto-flush when the root span finishes
|
|
171
173
|
|
|
174
|
+
Recommended local workflow:
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
init({
|
|
178
|
+
service: 'checkout-api',
|
|
179
|
+
devtools: true,
|
|
180
|
+
});
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
- `devtools: true` points traces, metrics, and logs at local `autotel-devtools`
|
|
184
|
+
- `devtools: { embedded: true }` tries to start `autotel-devtools` for you
|
|
185
|
+
- when you switch to a hosted backend, replace `devtools` with `endpoint` and optional `headers`
|
|
186
|
+
|
|
187
|
+
Example remote backend config:
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
init({
|
|
191
|
+
service: 'checkout-api',
|
|
192
|
+
endpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
|
|
193
|
+
headers: process.env.OTEL_EXPORTER_OTLP_HEADERS,
|
|
194
|
+
});
|
|
195
|
+
```
|
|
196
|
+
|
|
172
197
|
Sampling presets:
|
|
173
198
|
|
|
174
199
|
- Simple path: `sampling: 'development' | 'errors-only' | 'production' | 'off'`
|
|
@@ -1978,6 +2003,14 @@ OTLP_ENDPOINT=https://otel.mycompany.com node server.js
|
|
|
1978
2003
|
init({
|
|
1979
2004
|
service: string; // required
|
|
1980
2005
|
subscribers?: EventSubscriber[];
|
|
2006
|
+
devtools?: boolean | {
|
|
2007
|
+
enabled?: boolean;
|
|
2008
|
+
endpoint?: string;
|
|
2009
|
+
embedded?: boolean;
|
|
2010
|
+
host?: string;
|
|
2011
|
+
port?: number;
|
|
2012
|
+
verbose?: boolean;
|
|
2013
|
+
};
|
|
1981
2014
|
endpoint?: string;
|
|
1982
2015
|
protocol?: 'http' | 'grpc'; // OTLP protocol (default: 'http')
|
|
1983
2016
|
metrics?: boolean | 'auto';
|
|
@@ -2006,6 +2039,19 @@ init({
|
|
|
2006
2039
|
});
|
|
2007
2040
|
```
|
|
2008
2041
|
|
|
2042
|
+
Local-first recommendation:
|
|
2043
|
+
|
|
2044
|
+
```typescript
|
|
2045
|
+
init({
|
|
2046
|
+
service: 'my-app',
|
|
2047
|
+
devtools: true,
|
|
2048
|
+
});
|
|
2049
|
+
```
|
|
2050
|
+
|
|
2051
|
+
- `devtools: true` routes traces, metrics, and logs to local `autotel-devtools`
|
|
2052
|
+
- `devtools: { embedded: true }` attempts to start `autotel-devtools` automatically
|
|
2053
|
+
- use `endpoint` and `headers` when you are ready to ship telemetry to a hosted backend
|
|
2054
|
+
|
|
2009
2055
|
**Sampling Configuration:**
|
|
2010
2056
|
|
|
2011
2057
|
```typescript
|
package/dist/auto.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkUJJPTSEI_cjs = require('./chunk-UJJPTSEI.cjs');
|
|
4
4
|
var chunkOFPZULMQ_cjs = require('./chunk-OFPZULMQ.cjs');
|
|
5
5
|
require('./chunk-KZEC4CHV.cjs');
|
|
6
6
|
require('./chunk-ZNMBW67B.cjs');
|
|
@@ -23,7 +23,7 @@ module$1.register("import-in-the-middle/hook.mjs", (typeof document === 'undefin
|
|
|
23
23
|
var yamlConfig = chunkOFPZULMQ_cjs.loadYamlConfig();
|
|
24
24
|
var autoInstrumentationsEnv = process.env.AUTOTEL_INTEGRATIONS;
|
|
25
25
|
var autoInstrumentations = autoInstrumentationsEnv === "true" ? true : autoInstrumentationsEnv ? autoInstrumentationsEnv.split(",").map((s) => s.trim()) : yamlConfig?.autoInstrumentations ?? ["http", "express"];
|
|
26
|
-
|
|
26
|
+
chunkUJJPTSEI_cjs.init({
|
|
27
27
|
service: yamlConfig?.service ?? process.env.OTEL_SERVICE_NAME ?? "unknown-service",
|
|
28
28
|
debug: yamlConfig?.debug ?? process.env.AUTOTEL_DEBUG === "true",
|
|
29
29
|
autoInstrumentations
|
package/dist/auto.js
CHANGED
|
@@ -2,7 +2,7 @@ import { setSpanName } from './chunk-B3ZHLLMP.js';
|
|
|
2
2
|
import { validateEvent, runInOperationContext } from './chunk-WD4RP6IV.js';
|
|
3
3
|
import { getOrCreateCorrelationId } from './chunk-S4OFEXLA.js';
|
|
4
4
|
import { createTraceContext, getActiveContextWithBaggage, getContextStorage, enterOrRun } from './chunk-BBBWDIYQ.js';
|
|
5
|
-
import { getValidationConfig, isInitialized, warnIfNotInitialized, getConfig as getConfig$1, getEventsConfig, getLogger, getSdk } from './chunk-
|
|
5
|
+
import { getValidationConfig, isInitialized, warnIfNotInitialized, getConfig as getConfig$1, getEventsConfig, getLogger, getSdk } from './chunk-EXOXDI5A.js';
|
|
6
6
|
import { AlwaysSampler, AUTOTEL_SAMPLING_TAIL_KEEP, AUTOTEL_SAMPLING_TAIL_EVALUATED } from './chunk-VYA6QDNA.js';
|
|
7
7
|
import { getConfig } from './chunk-J5QENANM.js';
|
|
8
8
|
import { trace, SpanStatusCode, context, propagation } from '@opentelemetry/api';
|
|
@@ -1807,5 +1807,5 @@ function withBaggage(options) {
|
|
|
1807
1807
|
}
|
|
1808
1808
|
|
|
1809
1809
|
export { ctx, getEventQueue, instrument, resetEventQueue, span, trace2 as trace, track, withBaggage, withNewContext, withTracing };
|
|
1810
|
-
//# sourceMappingURL=chunk-
|
|
1811
|
-
//# sourceMappingURL=chunk-
|
|
1810
|
+
//# sourceMappingURL=chunk-4PTCDOZY.js.map
|
|
1811
|
+
//# sourceMappingURL=chunk-4PTCDOZY.js.map
|