autotel-cloudflare 18.0.0 → 18.2.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 +40 -0
- package/dist/actors.d.ts +7 -7
- package/dist/agents.d.ts +103 -103
- package/dist/{handlers-4X_6aEtg.js → handlers-7NFDRZT2.js} +89 -12
- package/dist/{handlers-BRfAgfP7.d.ts → handlers-CEAD5hVy.d.ts} +3 -1
- package/dist/handlers.d.ts +2 -2
- package/dist/handlers.js +2 -2
- package/dist/index.d.ts +8 -8
- package/dist/index.js +14 -7
- package/dist/native-tracing-Dgw_-i8X.js +67 -0
- package/dist/native.js +1 -1
- package/dist/tail.d.ts +110 -0
- package/dist/tail.js +249 -0
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +0 -2
- package/package.json +18 -14
- package/dist/native-tracing-D0EyAtsF.js +0 -32
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autotel-cloudflare",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.2.0",
|
|
4
4
|
"description": "The #1 OpenTelemetry package for Cloudflare Workers - complete bindings coverage, native CF OTel integration, advanced sampling",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -47,6 +47,10 @@
|
|
|
47
47
|
"types": "./dist/native.d.ts",
|
|
48
48
|
"import": "./dist/native.js"
|
|
49
49
|
},
|
|
50
|
+
"./tail": {
|
|
51
|
+
"types": "./dist/tail.d.ts",
|
|
52
|
+
"import": "./dist/tail.js"
|
|
53
|
+
},
|
|
50
54
|
"./parse-error": {
|
|
51
55
|
"types": "./dist/parse-error.d.ts",
|
|
52
56
|
"import": "./dist/parse-error.js"
|
|
@@ -80,9 +84,9 @@
|
|
|
80
84
|
"@opentelemetry/resources": "^2.11.0"
|
|
81
85
|
},
|
|
82
86
|
"peerDependencies": {
|
|
83
|
-
"@cloudflare/workers-types": "^5.
|
|
84
|
-
"autotel-edge": "
|
|
85
|
-
"autotel-genai": "0.15.
|
|
87
|
+
"@cloudflare/workers-types": "^5.20260928.1",
|
|
88
|
+
"autotel-edge": "6.1.0",
|
|
89
|
+
"autotel-genai": "0.15.2"
|
|
86
90
|
},
|
|
87
91
|
"peerDependenciesMeta": {
|
|
88
92
|
"autotel-edge": {
|
|
@@ -93,16 +97,16 @@
|
|
|
93
97
|
}
|
|
94
98
|
},
|
|
95
99
|
"devDependencies": {
|
|
96
|
-
"@cloudflare/workers-types": "^5.
|
|
100
|
+
"@cloudflare/workers-types": "^5.20260928.1",
|
|
97
101
|
"@opentelemetry/context-async-hooks": "^2.11.0",
|
|
98
|
-
"@types/node": "^26.
|
|
99
|
-
"autotel-edge": "
|
|
100
|
-
"autotel-genai": "0.15.
|
|
102
|
+
"@types/node": "^26.6.3",
|
|
103
|
+
"autotel-edge": "6.1.0",
|
|
104
|
+
"autotel-genai": "0.15.2",
|
|
101
105
|
"rimraf": "^6.1.3",
|
|
102
|
-
"tsdown": "^0.
|
|
103
|
-
"typescript": "^
|
|
104
|
-
"vitest": "^
|
|
105
|
-
"vitest-mock-extended": "^5.1.
|
|
106
|
+
"tsdown": "^0.23.0",
|
|
107
|
+
"typescript": "^7.0.2",
|
|
108
|
+
"vitest": "^5.0.2",
|
|
109
|
+
"vitest-mock-extended": "^5.1.1"
|
|
106
110
|
},
|
|
107
111
|
"repository": {
|
|
108
112
|
"type": "git",
|
|
@@ -116,8 +120,8 @@
|
|
|
116
120
|
"scripts": {
|
|
117
121
|
"build": "tsdown",
|
|
118
122
|
"dev": "tsdown --watch",
|
|
119
|
-
"lint": "
|
|
120
|
-
"lint:fix": "
|
|
123
|
+
"lint": "oxlint -c oxlint.json --disable-nested-config src",
|
|
124
|
+
"lint:fix": "pnpm lint --fix",
|
|
121
125
|
"type-check": "tsc --noEmit",
|
|
122
126
|
"test": "vitest run",
|
|
123
127
|
"test:watch": "vitest",
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
//#region src/native/native-tracing.ts
|
|
2
|
-
function readTracing(carrier) {
|
|
3
|
-
const tracing = carrier?.tracing;
|
|
4
|
-
return typeof tracing?.enterSpan === "function" ? tracing : void 0;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Returns `true` when Cloudflare native custom-span tracing is available on the
|
|
8
|
-
* given ExecutionContext (i.e. tracing is enabled for this Worker).
|
|
9
|
-
*/
|
|
10
|
-
function isNativeTracingAvailable(ctx) {
|
|
11
|
-
return readTracing(ctx) !== void 0;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Wrap Cloudflare's `ctx.tracing` as an autotel {@link NativeTracer}, or return
|
|
15
|
-
* `null` when native tracing is unavailable on this context.
|
|
16
|
-
*
|
|
17
|
-
* @param correlationId Optional per-request id (e.g. the `cf-ray` header)
|
|
18
|
-
* surfaced as `ctx.correlationId` and a `correlation.id` span attribute, so
|
|
19
|
-
* logs, custom spans, and the Cloudflare dashboard share one queryable key
|
|
20
|
-
* today — before Cloudflare exposes in-code trace/span ids.
|
|
21
|
-
*/
|
|
22
|
-
function getNativeTracerFromCtx(ctx, correlationId) {
|
|
23
|
-
const tracing = readTracing(ctx);
|
|
24
|
-
if (!tracing) return null;
|
|
25
|
-
return {
|
|
26
|
-
correlationId,
|
|
27
|
-
enterSpan: (name, callback) => tracing.enterSpan(name, callback)
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
//#endregion
|
|
32
|
-
export { isNativeTracingAvailable as n, getNativeTracerFromCtx as t };
|