autotel-cloudflare 2.18.18 → 2.19.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/dist/actors.d.ts +54 -89
- package/dist/actors.d.ts.map +1 -0
- package/dist/actors.js +990 -986
- package/dist/actors.js.map +1 -1
- package/dist/agents.d.ts +102 -128
- package/dist/agents.d.ts.map +1 -0
- package/dist/agents.js +275 -259
- package/dist/agents.js.map +1 -1
- package/dist/bindings-C10RI6Il.js +975 -0
- package/dist/bindings-C10RI6Il.js.map +1 -0
- package/dist/bindings-xEZcXo5r.d.ts +149 -0
- package/dist/bindings-xEZcXo5r.d.ts.map +1 -0
- package/dist/bindings.d.ts +2 -139
- package/dist/bindings.js +3 -4
- package/dist/common-DiWH6nmG.js +63 -0
- package/dist/common-DiWH6nmG.js.map +1 -0
- package/dist/events.d.ts +1 -1
- package/dist/events.js +3 -3
- package/dist/execution-logger-BxmgP8jF.js +65 -0
- package/dist/execution-logger-BxmgP8jF.js.map +1 -0
- package/dist/{logger-Cm_73k3-.d.ts → execution-logger-tgQmJeeU.d.ts} +9 -7
- package/dist/execution-logger-tgQmJeeU.d.ts.map +1 -0
- package/dist/handlers-CMg9l_T-.js +378 -0
- package/dist/handlers-CMg9l_T-.js.map +1 -0
- package/dist/handlers-C_VojUeA.d.ts +96 -0
- package/dist/handlers-C_VojUeA.d.ts.map +1 -0
- package/dist/handlers.d.ts +2 -112
- package/dist/handlers.js +3 -4
- package/dist/index.d.ts +20 -99
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +644 -600
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +3 -3
- package/dist/logger.js +5 -4
- package/dist/parse-error.d.ts +2 -1
- package/dist/parse-error.js +3 -3
- package/dist/sampling.d.ts +1 -4
- package/dist/sampling.js +3 -3
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +3 -3
- package/package.json +6 -6
- package/src/bindings/ai.test.ts +1 -1
- package/src/bindings/ai.ts +3 -1
- package/dist/bindings.js.map +0 -1
- package/dist/chunk-KAUHT25H.js +0 -1084
- package/dist/chunk-KAUHT25H.js.map +0 -1
- package/dist/chunk-MIDMNKDC.js +0 -333
- package/dist/chunk-MIDMNKDC.js.map +0 -1
- package/dist/chunk-O4IYKWPJ.js +0 -55
- package/dist/chunk-O4IYKWPJ.js.map +0 -1
- package/dist/chunk-RVVMMPWN.js +0 -63
- package/dist/chunk-RVVMMPWN.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/handlers.js.map +0 -1
- package/dist/logger.js.map +0 -1
- package/dist/parse-error.js.map +0 -1
- package/dist/sampling.js.map +0 -1
- package/dist/testing.js.map +0 -1
package/dist/handlers.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=handlers.js.map
|
|
1
|
+
import { n as instrumentDO, t as instrumentWorkflow } from "./handlers-CMg9l_T-.js";
|
|
2
|
+
|
|
3
|
+
export { instrumentDO, instrumentWorkflow };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,32 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export { ExecutionLogSnapshot, ExecutionLogger, ExecutionLoggerOptions } from 'autotel-edge/logger';
|
|
7
|
-
export { instrumentDO, instrumentWorkflow } from './handlers.js';
|
|
8
|
-
export { instrumentAI, instrumentAnalyticsEngine, instrumentBindings, instrumentBrowserRendering, instrumentD1, instrumentHyperdrive, instrumentImages, instrumentKV, instrumentQueueProducer, instrumentR2, instrumentRateLimiter, instrumentServiceBinding, instrumentVectorize } from './bindings.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Handler instrumentation for Cloudflare Workers
|
|
12
|
-
*
|
|
13
|
-
* Note: This file uses Cloudflare Workers types (ExportedHandler, Request, Response, etc.)
|
|
14
|
-
* which are globally available via @cloudflare/workers-types when listed in tsconfig.json.
|
|
15
|
-
* These types are devDependencies only - they're not runtime dependencies.
|
|
16
|
-
* At runtime, Cloudflare Workers runtime provides the actual implementations.
|
|
17
|
-
*
|
|
18
|
-
* Provides automatic OpenTelemetry tracing for:
|
|
19
|
-
* - HTTP handlers (fetch)
|
|
20
|
-
* - Scheduled/cron handlers
|
|
21
|
-
* - Queue handlers (with message tracking)
|
|
22
|
-
* - Email handlers
|
|
23
|
-
* - Auto-instrumentation of Cloudflare bindings (KV, R2, D1, Service Bindings)
|
|
24
|
-
* - Global fetch and cache instrumentation
|
|
25
|
-
* - Post-processor support for span customization
|
|
26
|
-
* - Tail sampling support
|
|
27
|
-
* - Cold start tracking
|
|
28
|
-
*/
|
|
1
|
+
import { a as instrumentQueueProducer, c as instrumentAI, d as instrumentKV, f as instrumentR2, i as instrumentAnalyticsEngine, l as instrumentBindings, n as instrumentRateLimiter, o as instrumentHyperdrive, p as instrumentServiceBinding, r as instrumentImages, s as instrumentVectorize, t as instrumentBrowserRendering, u as instrumentD1 } from "./bindings-xEZcXo5r.js";
|
|
2
|
+
import { n as instrumentDO, t as instrumentWorkflow } from "./handlers-C_VojUeA.js";
|
|
3
|
+
import { a as createWorkersLogger, c as getRequestLogger, i as WorkersLoggerOptions, l as getWorkflowLogger, n as ExecutionLogger, o as getActorLogger, r as ExecutionLoggerOptions, s as getQueueLogger, t as ExecutionLogSnapshot } from "./execution-logger-tgQmJeeU.js";
|
|
4
|
+
import { ConfigurationOption } from "autotel-edge";
|
|
5
|
+
export * from "autotel-edge";
|
|
29
6
|
|
|
7
|
+
//#region src/wrappers/instrument.d.ts
|
|
30
8
|
/**
|
|
31
9
|
* Instrument a Cloudflare Workers handler
|
|
32
10
|
*
|
|
@@ -50,27 +28,8 @@ export { instrumentAI, instrumentAnalyticsEngine, instrumentBindings, instrument
|
|
|
50
28
|
* ```
|
|
51
29
|
*/
|
|
52
30
|
declare function instrument<E, Q = any, C = any>(handler: ExportedHandler<E, Q, C>, config: ConfigurationOption): ExportedHandler<E, Q, C>;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
* workers-honeycomb-logger style wrapper API
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```typescript
|
|
59
|
-
* import { wrapModule } from 'autotel-cloudflare'
|
|
60
|
-
*
|
|
61
|
-
* const handler = {
|
|
62
|
-
* async fetch(req, env, ctx) {
|
|
63
|
-
* return new Response('Hello')
|
|
64
|
-
* }
|
|
65
|
-
* }
|
|
66
|
-
*
|
|
67
|
-
* export default wrapModule(
|
|
68
|
-
* { service: { name: 'my-worker' } },
|
|
69
|
-
* handler
|
|
70
|
-
* )
|
|
71
|
-
* ```
|
|
72
|
-
*/
|
|
73
|
-
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/wrappers/wrap-module.d.ts
|
|
74
33
|
/**
|
|
75
34
|
* Wrap a Cloudflare Workers module-style handler
|
|
76
35
|
* Alternative API style inspired by workers-honeycomb-logger
|
|
@@ -80,24 +39,8 @@ declare function instrument<E, Q = any, C = any>(handler: ExportedHandler<E, Q,
|
|
|
80
39
|
* @returns Instrumented handler
|
|
81
40
|
*/
|
|
82
41
|
declare function wrapModule<E, Q = any, C = any>(config: ConfigurationOption, handler: ExportedHandler<E, Q, C>): ExportedHandler<E, Q, C>;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
* Durable Object wrapper
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```typescript
|
|
89
|
-
* import { wrapDurableObject } from 'autotel-cloudflare'
|
|
90
|
-
*
|
|
91
|
-
* class Counter implements DurableObject {
|
|
92
|
-
* async fetch(request: Request) {
|
|
93
|
-
* return new Response('count')
|
|
94
|
-
* }
|
|
95
|
-
* }
|
|
96
|
-
*
|
|
97
|
-
* export default wrapDurableObject({ service: { name: 'counter-do' } }, Counter)
|
|
98
|
-
* ```
|
|
99
|
-
*/
|
|
100
|
-
|
|
42
|
+
//#endregion
|
|
43
|
+
//#region src/wrappers/wrap-do.d.ts
|
|
101
44
|
/**
|
|
102
45
|
* Wrap a Durable Object class with instrumentation
|
|
103
46
|
* Alternative API style inspired by workers-honeycomb-logger
|
|
@@ -107,33 +50,8 @@ declare function wrapModule<E, Q = any, C = any>(config: ConfigurationOption, ha
|
|
|
107
50
|
* @returns Instrumented Durable Object class
|
|
108
51
|
*/
|
|
109
52
|
declare function wrapDurableObject<T extends DurableObject>(config: ConfigurationOption, doClass: new (state: DurableObjectState, env: any) => T): new (state: DurableObjectState, env: any) => T;
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
* Ergonomic wrapper for Cloudflare Workers `fetch` handlers.
|
|
113
|
-
*
|
|
114
|
-
* `defineWorkerFetch` instruments the handler the same way `instrument()` does
|
|
115
|
-
* (so span exports already flush via `ctx.waitUntil`), and additionally injects
|
|
116
|
-
* a request-scoped `ExecutionLogger` as the fourth argument — pre-populated
|
|
117
|
-
* with method, path, cf-ray and `request.cf` context.
|
|
118
|
-
*
|
|
119
|
-
* Use this instead of `wrapModule` / `instrument` when your handler wants the
|
|
120
|
-
* logger handed in directly rather than reaching for `getRequestLogger()`.
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
* ```ts
|
|
124
|
-
* import { defineWorkerFetch } from 'autotel-cloudflare'
|
|
125
|
-
*
|
|
126
|
-
* export default defineWorkerFetch(
|
|
127
|
-
* { service: { name: 'my-worker' } },
|
|
128
|
-
* async (request, env, ctx, log) => {
|
|
129
|
-
* log.set({ route: '/health' })
|
|
130
|
-
* log.emitNow({ status: 200 })
|
|
131
|
-
* return new Response('ok')
|
|
132
|
-
* },
|
|
133
|
-
* )
|
|
134
|
-
* ```
|
|
135
|
-
*/
|
|
136
|
-
|
|
53
|
+
//#endregion
|
|
54
|
+
//#region src/wrappers/define-worker-fetch.d.ts
|
|
137
55
|
type DefineWorkerFetchOptions = WorkersLoggerOptions;
|
|
138
56
|
type WorkerFetchHandler<E> = (request: Request, env: E, ctx: ExecutionContext, log: ExecutionLogger) => Response | Promise<Response>;
|
|
139
57
|
/**
|
|
@@ -142,9 +60,10 @@ type WorkerFetchHandler<E> = (request: Request, env: E, ctx: ExecutionContext, l
|
|
|
142
60
|
* - the handler receives a request-scoped logger as its fourth argument
|
|
143
61
|
*/
|
|
144
62
|
declare function defineWorkerFetch<E = unknown>(config: ConfigurationOption, handler: WorkerFetchHandler<E>, loggerOptions?: DefineWorkerFetchOptions): {
|
|
145
|
-
|
|
63
|
+
fetch: (request: Request, env: E, ctx: ExecutionContext) => Promise<Response>;
|
|
146
64
|
};
|
|
147
|
-
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/global/fetch.d.ts
|
|
148
67
|
/**
|
|
149
68
|
* Global fetch() instrumentation for autotel-edge
|
|
150
69
|
*
|
|
@@ -163,7 +82,8 @@ declare function defineWorkerFetch<E = unknown>(config: ConfigurationOption, han
|
|
|
163
82
|
* `instrumentation.instrumentGlobalFetch: true` (default).
|
|
164
83
|
*/
|
|
165
84
|
declare function instrumentGlobalFetch(): void;
|
|
166
|
-
|
|
85
|
+
//#endregion
|
|
86
|
+
//#region src/global/cache.d.ts
|
|
167
87
|
/**
|
|
168
88
|
* Global Cache API instrumentation for Cloudflare Workers
|
|
169
89
|
*
|
|
@@ -181,5 +101,6 @@ declare function instrumentGlobalFetch(): void;
|
|
|
181
101
|
* `instrumentation.instrumentGlobalCache: true` (default).
|
|
182
102
|
*/
|
|
183
103
|
declare function instrumentGlobalCache(): void;
|
|
184
|
-
|
|
185
|
-
export { type DefineWorkerFetchOptions, type WorkerFetchHandler, WorkersLoggerOptions, defineWorkerFetch, instrument, instrumentGlobalCache, instrumentGlobalFetch, wrapDurableObject, wrapModule };
|
|
104
|
+
//#endregion
|
|
105
|
+
export { type DefineWorkerFetchOptions, type ExecutionLogSnapshot, type ExecutionLogger, type ExecutionLoggerOptions, type WorkerFetchHandler, type WorkersLoggerOptions, createWorkersLogger, defineWorkerFetch, getActorLogger, getQueueLogger, getRequestLogger, getWorkflowLogger, instrument, instrumentAI, instrumentAnalyticsEngine, instrumentBindings, instrumentBrowserRendering, instrumentD1, instrumentDO, instrumentGlobalCache, instrumentGlobalFetch, instrumentHyperdrive, instrumentImages, instrumentKV, instrumentQueueProducer, instrumentR2, instrumentRateLimiter, instrumentServiceBinding, instrumentVectorize, instrumentWorkflow, wrapDurableObject, wrapModule };
|
|
106
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/wrappers/instrument.ts","../src/wrappers/wrap-module.ts","../src/wrappers/wrap-do.ts","../src/wrappers/define-worker-fetch.ts","../src/global/fetch.ts","../src/global/cache.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0qB0B;;;;AC3oB1B;iBDwoBgB,UAAA,sBACd,OAAA,EAAS,eAAA,CAAgB,CAAA,EAAG,CAAA,EAAG,CAAA,GAC/B,MAAA,EAAQ,mBAAA,GACP,eAAA,CAAgB,CAAA,EAAG,CAAA,EAAG,CAAA;;;;;;;;;;;iBC3oBT,UAAA,sBACd,MAAA,EAAQ,mBAAA,EACR,OAAA,EAAS,eAAA,CAAgB,CAAA,EAAG,CAAA,EAAG,CAAA,IAC9B,eAAA,CAAgB,CAAA,EAAG,CAAA,EAAG,CAAA;;;;;;;;;;;iBCNT,iBAAA,WAA4B,aAAA,EAC1C,MAAA,EAAQ,mBAAA,EACR,OAAA,OAAc,KAAA,EAAO,kBAAA,EAAoB,GAAA,UAAa,CAAA,QAChD,KAAA,EAAO,kBAAA,EAAoB,GAAA,UAAa,CAAA;;;KCDpC,wBAAA,GAA2B,oBAAoB;AAAA,KAE/C,kBAAA,OACV,OAAA,EAAS,OAAA,EACT,GAAA,EAAK,CAAA,EACL,GAAA,EAAK,gBAAA,EACL,GAAA,EAAK,eAAA,KACF,QAAA,GAAW,OAAA,CAAQ,QAAA;;;;;;iBAOR,iBAAA,cACd,MAAA,EAAQ,mBAAA,EACR,OAAA,EAAS,kBAAA,CAAmB,CAAA,GAC5B,aAAA,GAAe,wBAAA;EACZ,KAAA,GAAQ,OAAA,EAAS,OAAA,EAAS,GAAA,EAAK,CAAA,EAAG,GAAA,EAAK,gBAAA,KAAqB,OAAA,CAAQ,QAAA;AAAA;;;;;;;;;;;AHunBzE;;;;;;;;;iBI9mBgB,qBAAA;;;;;;;;;;;AJ8mBhB;;;;;;;;AAAA,iBKzhBgB,qBAAA"}
|