@sentry/cloudflare 10.48.0 → 10.49.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/build/cjs/client.js.map +1 -1
- package/build/cjs/durableobject.js +13 -5
- package/build/cjs/durableobject.js.map +1 -1
- package/build/cjs/index.js +1 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/instrumentations/instrumentDurableObjectNamespace.js +56 -0
- package/build/cjs/instrumentations/instrumentDurableObjectNamespace.js.map +1 -0
- package/build/cjs/instrumentations/instrumentDurableObjectStorage.js +38 -3
- package/build/cjs/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
- package/build/cjs/instrumentations/worker/instrumentEmail.js +3 -2
- package/build/cjs/instrumentations/worker/instrumentEmail.js.map +1 -1
- package/build/cjs/instrumentations/worker/instrumentEnv.js +83 -0
- package/build/cjs/instrumentations/worker/instrumentEnv.js.map +1 -0
- package/build/cjs/instrumentations/worker/instrumentFetch.js +3 -2
- package/build/cjs/instrumentations/worker/instrumentFetch.js.map +1 -1
- package/build/cjs/instrumentations/worker/instrumentFetcher.js +38 -0
- package/build/cjs/instrumentations/worker/instrumentFetcher.js.map +1 -0
- package/build/cjs/instrumentations/worker/instrumentQueue.js +3 -2
- package/build/cjs/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/cjs/instrumentations/worker/instrumentScheduled.js +3 -2
- package/build/cjs/instrumentations/worker/instrumentScheduled.js.map +1 -1
- package/build/cjs/instrumentations/worker/instrumentTail.js +3 -2
- package/build/cjs/instrumentations/worker/instrumentTail.js.map +1 -1
- package/build/cjs/integrations/tracing/vercelai.js +2 -1
- package/build/cjs/integrations/tracing/vercelai.js.map +1 -1
- package/build/cjs/sdk.js +6 -1
- package/build/cjs/sdk.js.map +1 -1
- package/build/cjs/utils/instrumentContext.js +2 -1
- package/build/cjs/utils/instrumentContext.js.map +1 -1
- package/build/cjs/utils/isBinding.js +32 -0
- package/build/cjs/utils/isBinding.js.map +1 -0
- package/build/cjs/utils/rpcOptions.js +84 -0
- package/build/cjs/utils/rpcOptions.js.map +1 -0
- package/build/cjs/utils/traceLinks.js +78 -0
- package/build/cjs/utils/traceLinks.js.map +1 -0
- package/build/cjs/workflows.js +3 -2
- package/build/cjs/workflows.js.map +1 -1
- package/build/cjs/wrapMethodWithSentry.js +90 -45
- package/build/cjs/wrapMethodWithSentry.js.map +1 -1
- package/build/esm/client.js.map +1 -1
- package/build/esm/durableobject.js +13 -5
- package/build/esm/durableobject.js.map +1 -1
- package/build/esm/index.js +1 -1
- package/build/esm/instrumentations/instrumentDurableObjectNamespace.js +54 -0
- package/build/esm/instrumentations/instrumentDurableObjectNamespace.js.map +1 -0
- package/build/esm/instrumentations/instrumentDurableObjectStorage.js +39 -4
- package/build/esm/instrumentations/instrumentDurableObjectStorage.js.map +1 -1
- package/build/esm/instrumentations/worker/instrumentEmail.js +3 -2
- package/build/esm/instrumentations/worker/instrumentEmail.js.map +1 -1
- package/build/esm/instrumentations/worker/instrumentEnv.js +81 -0
- package/build/esm/instrumentations/worker/instrumentEnv.js.map +1 -0
- package/build/esm/instrumentations/worker/instrumentFetch.js +3 -2
- package/build/esm/instrumentations/worker/instrumentFetch.js.map +1 -1
- package/build/esm/instrumentations/worker/instrumentFetcher.js +36 -0
- package/build/esm/instrumentations/worker/instrumentFetcher.js.map +1 -0
- package/build/esm/instrumentations/worker/instrumentQueue.js +3 -2
- package/build/esm/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/esm/instrumentations/worker/instrumentScheduled.js +3 -2
- package/build/esm/instrumentations/worker/instrumentScheduled.js.map +1 -1
- package/build/esm/instrumentations/worker/instrumentTail.js +3 -2
- package/build/esm/instrumentations/worker/instrumentTail.js.map +1 -1
- package/build/esm/integrations/tracing/vercelai.js +2 -1
- package/build/esm/integrations/tracing/vercelai.js.map +1 -1
- package/build/esm/package.json +1 -1
- package/build/esm/sdk.js +7 -2
- package/build/esm/sdk.js.map +1 -1
- package/build/esm/utils/instrumentContext.js +2 -1
- package/build/esm/utils/instrumentContext.js.map +1 -1
- package/build/esm/utils/isBinding.js +29 -0
- package/build/esm/utils/isBinding.js.map +1 -0
- package/build/esm/utils/rpcOptions.js +81 -0
- package/build/esm/utils/rpcOptions.js.map +1 -0
- package/build/esm/utils/traceLinks.js +73 -0
- package/build/esm/utils/traceLinks.js.map +1 -0
- package/build/esm/workflows.js +3 -2
- package/build/esm/workflows.js.map +1 -1
- package/build/esm/wrapMethodWithSentry.js +91 -46
- package/build/esm/wrapMethodWithSentry.js.map +1 -1
- package/build/types/client.d.ts +39 -10
- package/build/types/client.d.ts.map +1 -1
- package/build/types/durableobject.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/instrumentations/instrumentDurableObjectNamespace.d.ts +12 -0
- package/build/types/instrumentations/instrumentDurableObjectNamespace.d.ts.map +1 -0
- package/build/types/instrumentations/instrumentDurableObjectStorage.d.ts +8 -1
- package/build/types/instrumentations/instrumentDurableObjectStorage.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentEmail.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentEnv.d.ts +16 -0
- package/build/types/instrumentations/worker/instrumentEnv.d.ts.map +1 -0
- package/build/types/instrumentations/worker/instrumentFetch.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentFetcher.d.ts +10 -0
- package/build/types/instrumentations/worker/instrumentFetcher.d.ts.map +1 -0
- package/build/types/instrumentations/worker/instrumentQueue.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentScheduled.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentTail.d.ts.map +1 -1
- package/build/types/integrations/tracing/vercelai.d.ts +9 -1
- package/build/types/integrations/tracing/vercelai.d.ts.map +1 -1
- package/build/types/sdk.d.ts.map +1 -1
- package/build/types/utils/instrumentContext.d.ts.map +1 -1
- package/build/types/utils/isBinding.d.ts +49 -0
- package/build/types/utils/isBinding.d.ts.map +1 -0
- package/build/types/utils/rpcOptions.d.ts +24 -0
- package/build/types/utils/rpcOptions.d.ts.map +1 -0
- package/build/types/utils/traceLinks.d.ts +27 -0
- package/build/types/utils/traceLinks.d.ts.map +1 -0
- package/build/types/workflows.d.ts.map +1 -1
- package/build/types/wrapMethodWithSentry.d.ts +19 -2
- package/build/types/wrapMethodWithSentry.d.ts.map +1 -1
- package/build/types-ts3.8/client.d.ts +39 -10
- package/build/types-ts3.8/index.d.ts +1 -1
- package/build/types-ts3.8/instrumentations/instrumentDurableObjectNamespace.d.ts +12 -0
- package/build/types-ts3.8/instrumentations/instrumentDurableObjectStorage.d.ts +8 -1
- package/build/types-ts3.8/instrumentations/worker/instrumentEnv.d.ts +16 -0
- package/build/types-ts3.8/instrumentations/worker/instrumentFetcher.d.ts +10 -0
- package/build/types-ts3.8/integrations/tracing/vercelai.d.ts +9 -1
- package/build/types-ts3.8/utils/isBinding.d.ts +49 -0
- package/build/types-ts3.8/utils/rpcOptions.d.ts +24 -0
- package/build/types-ts3.8/utils/traceLinks.d.ts +27 -0
- package/build/types-ts3.8/wrapMethodWithSentry.d.ts +19 -2
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,uBAAuB,EACvB,OAAO,EACP,aAAa,EACb,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,MAAM,EACN,kCAAkC,EAClC,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,KAAK,EACL,eAAe,EACf,WAAW,EACX,KAAK,EACL,SAAS,EACT,aAAa,EACb,SAAS,EACT,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,EACL,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,yBAAyB,EACzB,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,cAAc,EACd,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,2BAA2B,EAE3B,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAC5B,gCAAgC,EAChC,gCAAgC,EAChC,qCAAqC,EACrC,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,8BAA8B,EAC9B,6BAA6B,EAC7B,uBAAuB,EACvB,qBAAqB,EACrB,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,MAAM,CAAC;AAE9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,OAAO,EACP,KAAK,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,uBAAuB,EACvB,OAAO,EACP,aAAa,EACb,IAAI,EACJ,UAAU,EACV,UAAU,EACV,MAAM,EACN,IAAI,EACJ,MAAM,EACN,kCAAkC,EAClC,cAAc,GACf,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAElD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,eAAe,EACf,KAAK,EACL,eAAe,EACf,WAAW,EACX,KAAK,EACL,SAAS,EACT,aAAa,EACb,SAAS,EACT,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,EACL,WAAW,EACX,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,yBAAyB,EACzB,aAAa,EACb,SAAS,EACT,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,cAAc,EACd,aAAa,EACb,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,eAAe,EACf,aAAa,EACb,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,aAAa,EACb,2BAA2B,EAE3B,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAC5B,gCAAgC,EAChC,gCAAgC,EAChC,qCAAqC,EACrC,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,8BAA8B,EAC9B,6BAA6B,EAC7B,uBAAuB,EACvB,qBAAqB,EACrB,MAAM,EACN,OAAO,EACP,gBAAgB,EAChB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,MAAM,CAAC;AAE9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,wCAAwC,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DurableObjectNamespace } from '@cloudflare/workers-types';
|
|
2
|
+
/**
|
|
3
|
+
* Instruments a DurableObjectNamespace binding to create spans for DO interactions.
|
|
4
|
+
*
|
|
5
|
+
* Wraps:
|
|
6
|
+
* - `namespace.get(id)` / `namespace.getByName(name)` with a span + instruments returned stub
|
|
7
|
+
* - `namespace.idFromName(name)` / `namespace.idFromString(id)` / `namespace.newUniqueId()` with breadcrumbs
|
|
8
|
+
*
|
|
9
|
+
* @param namespace - The DurableObjectNamespace to instrument
|
|
10
|
+
*/
|
|
11
|
+
export declare function instrumentDurableObjectNamespace(namespace: DurableObjectNamespace): DurableObjectNamespace;
|
|
12
|
+
//# sourceMappingURL=instrumentDurableObjectNamespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentDurableObjectNamespace.d.ts","sourceRoot":"","sources":["../../../src/instrumentations/instrumentDurableObjectNamespace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAqB,MAAM,2BAA2B,CAAC;AAG3F;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAAC,SAAS,EAAE,sBAAsB,GAAG,sBAAsB,CAoB1G"}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import type { DurableObjectStorage } from '@cloudflare/workers-types';
|
|
2
|
+
type WaitUntil = (promise: Promise<unknown>) => void;
|
|
2
3
|
/**
|
|
3
4
|
* Instruments DurableObjectStorage methods with Sentry spans.
|
|
4
5
|
*
|
|
5
6
|
* Wraps the following async methods:
|
|
6
7
|
* - get, put, delete, list (KV API)
|
|
8
|
+
* - setAlarm, getAlarm, deleteAlarm (Alarm API)
|
|
9
|
+
*
|
|
10
|
+
* When setAlarm is called, it also stores the current span context so that when
|
|
11
|
+
* the alarm fires later, it can link back to the trace that called setAlarm.
|
|
7
12
|
*
|
|
8
13
|
* @param storage - The DurableObjectStorage instance to instrument
|
|
14
|
+
* @param waitUntil - Optional waitUntil function to defer span context storage
|
|
9
15
|
* @returns An instrumented DurableObjectStorage instance
|
|
10
16
|
*/
|
|
11
|
-
export declare function instrumentDurableObjectStorage(storage: DurableObjectStorage): DurableObjectStorage;
|
|
17
|
+
export declare function instrumentDurableObjectStorage(storage: DurableObjectStorage, waitUntil?: WaitUntil): DurableObjectStorage;
|
|
18
|
+
export {};
|
|
12
19
|
//# sourceMappingURL=instrumentDurableObjectStorage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentDurableObjectStorage.d.ts","sourceRoot":"","sources":["../../../src/instrumentations/instrumentDurableObjectStorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"instrumentDurableObjectStorage.d.ts","sourceRoot":"","sources":["../../../src/instrumentations/instrumentDurableObjectStorage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAQtE,KAAK,SAAS,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;AAErD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,oBAAoB,EAC7B,SAAS,CAAC,EAAE,SAAS,GACpB,oBAAoB,CAgEtB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentEmail.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentEmail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,KAAK,EAAE,GAAG,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQ/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"instrumentEmail.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentEmail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,KAAK,EAAE,GAAG,IAAI,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQ/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAkDtD;;GAEG;AAEH,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACrF,OAAO,EAAE,CAAC,EACV,eAAe,EAAE,CAAC,GAAG,EAAE,OAAO,aAAa,KAAK,iBAAiB,GAAG,SAAS,GAC5E,IAAI,CAoBN"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CloudflareOptions } from '../../client';
|
|
2
|
+
/**
|
|
3
|
+
* Wraps the Cloudflare `env` object in a Proxy that detects binding types
|
|
4
|
+
* on property access and returns instrumented versions.
|
|
5
|
+
*
|
|
6
|
+
* Currently detects:
|
|
7
|
+
* - DurableObjectNamespace (via `idFromName` duck-typing)
|
|
8
|
+
* - Service bindings / JSRPC proxies (wraps `fetch` for trace propagation)
|
|
9
|
+
*
|
|
10
|
+
* Extensible for future binding types (KV, D1, Queue, etc.).
|
|
11
|
+
*
|
|
12
|
+
* @param env - The Cloudflare env object to instrument
|
|
13
|
+
* @param options - Optional CloudflareOptions to control RPC trace propagation
|
|
14
|
+
*/
|
|
15
|
+
export declare function instrumentEnv<Env extends Record<string, unknown>>(env: Env, options?: CloudflareOptions): Env;
|
|
16
|
+
//# sourceMappingURL=instrumentEnv.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentEnv.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentEnv.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAYtD;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,GAAG,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,GAAG,CAqD7G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentFetch.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentFetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,GAAG,IAAI,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"instrumentFetch.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentFetch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,GAAG,IAAI,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAOtD;;GAEG;AAEH,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACrF,OAAO,EAAE,CAAC,EACV,eAAe,EAAE,CAAC,GAAG,EAAE,OAAO,aAAa,KAAK,iBAAiB,GAAG,SAAS,GAC5E,IAAI,CAoBN;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,CAAC,SAAS,gBAAgB,EACxE,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,gBAAgB,GACxB,IAAI,CAaN"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Fetcher } from '@cloudflare/workers-types';
|
|
2
|
+
/**
|
|
3
|
+
* Wraps a fetch-like function to create a span and propagate trace headers
|
|
4
|
+
* (`sentry-trace` and `baggage`) on the outgoing request.
|
|
5
|
+
*
|
|
6
|
+
* Useful for instrumenting Cloudflare bindings that expose a `fetch` method
|
|
7
|
+
* (e.g. Durable Object stubs, Service bindings).
|
|
8
|
+
*/
|
|
9
|
+
export declare function instrumentFetcher(fetchFn: Fetcher['fetch']): Fetcher['fetch'];
|
|
10
|
+
//# sourceMappingURL=instrumentFetcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentFetcher.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentFetcher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAGzD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAuB7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentQueue.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentQueue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,2BAA2B,CAAC;AAC/E,OAAO,KAAK,EAAE,GAAG,IAAI,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AASjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"instrumentQueue.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentQueue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAgB,MAAM,2BAA2B,CAAC;AAC/E,OAAO,KAAK,EAAE,GAAG,IAAI,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AASjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAuDtD;;GAEG;AAEH,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACrF,OAAO,EAAE,CAAC,EACV,eAAe,EAAE,CAAC,GAAG,EAAE,OAAO,aAAa,KAAK,iBAAiB,GAAG,SAAS,GAC5E,IAAI,CAoBN;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,CAAC,SAAS,gBAAgB,EACxE,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,gBAAgB,GACxB,IAAI,CAaN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentScheduled.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentScheduled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAuB,MAAM,2BAA2B,CAAC;AACtF,OAAO,KAAK,EAAE,GAAG,IAAI,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAQjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"instrumentScheduled.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentScheduled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAuB,MAAM,2BAA2B,CAAC;AACtF,OAAO,KAAK,EAAE,GAAG,IAAI,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAQjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAiDtD;;GAEG;AAEH,wBAAgB,kCAAkC,CAAC,CAAC,SAAS,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACzF,OAAO,EAAE,CAAC,EACV,eAAe,EAAE,CAAC,GAAG,EAAE,OAAO,aAAa,KAAK,iBAAiB,GAAG,SAAS,GAC5E,IAAI,CAoBN;AAED;;GAEG;AACH,wBAAgB,mCAAmC,CAAC,CAAC,SAAS,gBAAgB,EAC5E,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,gBAAgB,GACxB,IAAI,CAaN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentTail.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentTail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAa,MAAM,2BAA2B,CAAC;AAC5E,OAAO,KAAK,EAAE,GAAG,IAAI,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"instrumentTail.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentTail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAa,MAAM,2BAA2B,CAAC;AAC5E,OAAO,KAAK,EAAE,GAAG,IAAI,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAiCtD;;GAEG;AAEH,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EACpF,OAAO,EAAE,CAAC,EACV,eAAe,EAAE,CAAC,GAAG,EAAE,OAAO,aAAa,KAAK,iBAAiB,GAAG,SAAS,GAC5E,IAAI,CAoBN;AAED;;GAEG;AACH,wBAAgB,8BAA8B,CAAC,CAAC,SAAS,gBAAgB,EACvE,QAAQ,EAAE,CAAC,EACX,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,gBAAgB,GACxB,IAAI,CAWN"}
|
|
@@ -7,6 +7,13 @@
|
|
|
7
7
|
* Therefore, we cannot automatically patch setting `experimental_telemetry: { isEnabled: true }`
|
|
8
8
|
* and users have to manually set this to get spans.
|
|
9
9
|
*/
|
|
10
|
+
interface VercelAiOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Enable or disable truncation of recorded input messages.
|
|
13
|
+
* Defaults to `true`.
|
|
14
|
+
*/
|
|
15
|
+
enableTruncation?: boolean;
|
|
16
|
+
}
|
|
10
17
|
/**
|
|
11
18
|
* Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.
|
|
12
19
|
* This integration is not enabled by default, you need to manually add it.
|
|
@@ -33,5 +40,6 @@
|
|
|
33
40
|
* experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },
|
|
34
41
|
* });
|
|
35
42
|
*/
|
|
36
|
-
export declare const vercelAIIntegration: () => import("@sentry/core").Integration;
|
|
43
|
+
export declare const vercelAIIntegration: (options?: VercelAiOptions | undefined) => import("@sentry/core").Integration;
|
|
44
|
+
export {};
|
|
37
45
|
//# sourceMappingURL=vercelai.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vercelai.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/vercelai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"vercelai.d.ts","sourceRoot":"","sources":["../../../../src/integrations/tracing/vercelai.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,UAAU,eAAe;IACvB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAYD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,mBAAmB,+EAA0C,CAAC"}
|
package/build/types/sdk.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../src/sdk.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAchD,OAAO,KAAK,EAA2B,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAQ5C,2DAA2D;AAC3D,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,WAAW,EAAE,CAkBhF;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,CAiC7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instrumentContext.d.ts","sourceRoot":"","sources":["../../../src/utils/instrumentContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAA6B,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGtH,KAAK,WAAW,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAGzD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"instrumentContext.d.ts","sourceRoot":"","sources":["../../../src/utils/instrumentContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAA6B,KAAK,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGtH,KAAK,WAAW,GAAG,gBAAgB,GAAG,kBAAkB,CAAC;AAGzD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAgDlE"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapted from https://github.com/evanderkoogh/otel-cf-workers/blob/effeb549f0a4ed1c55ea0c4f0d8e8e37e5494fb3/src/instrumentation/env.ts
|
|
3
|
+
*
|
|
4
|
+
* BSD 3-Clause License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2023, Erwin van der Koogh
|
|
7
|
+
*
|
|
8
|
+
* Redistribution and use in source and binary forms, with or without
|
|
9
|
+
* modification, are permitted provided that the following conditions are met:
|
|
10
|
+
*
|
|
11
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
12
|
+
* list of conditions and the following disclaimer.
|
|
13
|
+
*
|
|
14
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
15
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
16
|
+
* and/or other materials provided with the distribution.
|
|
17
|
+
*
|
|
18
|
+
* 3. Neither the name of the copyright holder nor the names of its
|
|
19
|
+
* contributors may be used to endorse or promote products derived from
|
|
20
|
+
* this software without specific prior written permission.
|
|
21
|
+
*
|
|
22
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
23
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
24
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
25
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
26
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
27
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
28
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
29
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
30
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
31
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
32
|
+
*/
|
|
33
|
+
import type { DurableObjectNamespace } from '@cloudflare/workers-types';
|
|
34
|
+
/**
|
|
35
|
+
* Checks if a value is a JSRPC proxy (service binding).
|
|
36
|
+
*
|
|
37
|
+
* JSRPC proxies return a truthy value for ANY property access, including
|
|
38
|
+
* properties that don't exist. This makes other duck-type checks unreliable
|
|
39
|
+
* unless we exclude JSRPC first.
|
|
40
|
+
*
|
|
41
|
+
* Must be checked before other binding type checks.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isJSRPC(item: unknown): item is Service;
|
|
44
|
+
/**
|
|
45
|
+
* Duck-type check for DurableObjectNamespace bindings.
|
|
46
|
+
* DurableObjectNamespace has `idFromName`, `idFromString`, `get`, `newUniqueId`.
|
|
47
|
+
*/
|
|
48
|
+
export declare function isDurableObjectNamespace(item: unknown): item is DurableObjectNamespace;
|
|
49
|
+
//# sourceMappingURL=isBinding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isBinding.d.ts","sourceRoot":"","sources":["../../../src/utils/isBinding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,OAAO,CAMtD;AAID;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,sBAAsB,CAEtF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CloudflareOptions } from '../client';
|
|
2
|
+
/**
|
|
3
|
+
* Gets the effective RPC propagation setting, handling deprecation of `instrumentPrototypeMethods`.
|
|
4
|
+
*
|
|
5
|
+
* Priority:
|
|
6
|
+
* 1. If `enableRpcTracePropagation` is set, use it (ignore `instrumentPrototypeMethods`)
|
|
7
|
+
* 2. If only `instrumentPrototypeMethods` is set, use it with deprecation warning (converted to boolean)
|
|
8
|
+
* 3. If neither is set, return `false`
|
|
9
|
+
*
|
|
10
|
+
* @returns The effective setting for RPC trace propagation
|
|
11
|
+
*/
|
|
12
|
+
export declare function getEffectiveRpcPropagation(options: CloudflareOptions): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Gets the method filter for prototype method instrumentation.
|
|
15
|
+
*
|
|
16
|
+
* Returns:
|
|
17
|
+
* - `null` if no instrumentation should occur
|
|
18
|
+
* - `true` if all methods should be instrumented
|
|
19
|
+
* - `string[]` if only specific methods should be instrumented (deprecated behavior)
|
|
20
|
+
*
|
|
21
|
+
* @returns The method filter or null if no instrumentation
|
|
22
|
+
*/
|
|
23
|
+
export declare function getPrototypeMethodFilter(options: CloudflareOptions): boolean | string[];
|
|
24
|
+
//# sourceMappingURL=rpcOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rpcOptions.d.ts","sourceRoot":"","sources":["../../../src/utils/rpcOptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGnD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CA8B9E;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,GAAG,MAAM,EAAE,CAsBvF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DurableObjectStorage } from '@cloudflare/workers-types';
|
|
2
|
+
import type { SpanLink } from '@sentry/core';
|
|
3
|
+
/** Stored span context for creating span links */
|
|
4
|
+
export interface StoredSpanContext {
|
|
5
|
+
traceId: string;
|
|
6
|
+
spanId: string;
|
|
7
|
+
sampled: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Gets the storage key for a specific method's trace link.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getTraceLinkKey(methodName: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Stores the current span context in Durable Object storage for trace linking.
|
|
15
|
+
* Uses the original uninstrumented storage to avoid creating spans for internal operations.
|
|
16
|
+
* Errors are silently ignored to prevent internal storage failures from propagating to user code.
|
|
17
|
+
*/
|
|
18
|
+
export declare function storeSpanContext(originalStorage: DurableObjectStorage, methodName: string): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves a stored span context from Durable Object storage.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getStoredSpanContext(originalStorage: DurableObjectStorage, methodName: string): Promise<StoredSpanContext | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* Builds span links from a stored span context.
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildSpanLinks(storedContext: StoredSpanContext): SpanLink[];
|
|
27
|
+
//# sourceMappingURL=traceLinks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traceLinks.d.ts","sourceRoot":"","sources":["../../../src/utils/traceLinks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAO7C,kDAAkD;AAClD,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,eAAe,EAAE,oBAAoB,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgB/G;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,oBAAoB,EACrC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAMxC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,aAAa,EAAE,iBAAiB,GAAG,QAAQ,EAAE,CAa3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/workflows.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,kBAAkB,EAOnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/workflows.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,kBAAkB,EAOnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AASlD;;GAEG;AACH,wBAAsB,kCAAkC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAS5F;AAiGD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAC1C,CAAC,EAAE,mBAAmB;AACtB,CAAC,EAAE,eAAe;AAClB,CAAC,SAAS,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,0BAA0B;AAC9D,CAAC,SAAS,KAAK,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,EAClD,eAAe,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,iBAAiB,EAAE,aAAa,EAAE,CAAC,GAAG,CAAC,CA2CrE"}
|
|
@@ -1,14 +1,31 @@
|
|
|
1
|
+
import type { DurableObjectStorage } from '@cloudflare/workers-types';
|
|
1
2
|
import type { CloudflareOptions } from './client';
|
|
3
|
+
/** Extended DurableObjectState with originalStorage exposed by instrumentContext */
|
|
4
|
+
interface InstrumentedDurableObjectState extends DurableObjectState {
|
|
5
|
+
originalStorage?: DurableObjectStorage;
|
|
6
|
+
}
|
|
2
7
|
type MethodWrapperOptions = {
|
|
3
8
|
spanName?: string;
|
|
4
9
|
spanOp?: string;
|
|
5
10
|
options: CloudflareOptions;
|
|
6
|
-
context: ExecutionContext |
|
|
11
|
+
context: ExecutionContext | InstrumentedDurableObjectState;
|
|
12
|
+
/**
|
|
13
|
+
* If true, starts a fresh trace instead of inheriting from a parent trace.
|
|
14
|
+
* Useful for scheduled/independent invocations like alarms.
|
|
15
|
+
*
|
|
16
|
+
* If true, it also stores the current span context and links to the previous invocation's span.
|
|
17
|
+
* Uses Durable Object storage to persist the link. The link is set asynchronously via `span.addLinks()`
|
|
18
|
+
* in a `waitUntil` to avoid blocking.
|
|
19
|
+
*
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
startNewTrace?: boolean;
|
|
7
23
|
};
|
|
8
24
|
export type UncheckedMethod = (...args: any[]) => any;
|
|
9
25
|
type OriginalMethod = UncheckedMethod;
|
|
10
26
|
/**
|
|
11
|
-
* Wraps a method with Sentry tracing.
|
|
27
|
+
* Wraps a method with Sentry error tracking and optional tracing.
|
|
28
|
+
* Supports starting new traces and linking to previous invocations via Durable Object storage.
|
|
12
29
|
*
|
|
13
30
|
* @param wrapperOptions - The options for the wrapper.
|
|
14
31
|
* @param handler - The method to wrap.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapMethodWithSentry.d.ts","sourceRoot":"","sources":["../../src/wrapMethodWithSentry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wrapMethodWithSentry.d.ts","sourceRoot":"","sources":["../../src/wrapMethodWithSentry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAatE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAMlD,oFAAoF;AACpF,UAAU,8BAA+B,SAAQ,kBAAkB;IACjE,eAAe,CAAC,EAAE,oBAAoB,CAAC;CACxC;AAED,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,gBAAgB,GAAG,8BAA8B,CAAC;IAC3D;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAGF,MAAM,MAAM,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AACtD,KAAK,cAAc,GAAG,eAAe,CAAC;AAEtC;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,cAAc,EAC3D,cAAc,EAAE,oBAAoB,EACpC,OAAO,EAAE,CAAC,EACV,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,EAC3C,MAAM,CAAC,EAAE,IAAI,GACZ,CAAC,CAsKH"}
|
|
@@ -65,26 +65,55 @@ interface BaseCloudflareOptions {
|
|
|
65
65
|
*/
|
|
66
66
|
skipOpenTelemetrySetup?: boolean;
|
|
67
67
|
/**
|
|
68
|
-
* Enable
|
|
68
|
+
* Enable trace propagation for RPC calls between Workers, Durable Objects, and Service Bindings.
|
|
69
69
|
*
|
|
70
|
-
* When
|
|
71
|
-
*
|
|
70
|
+
* When enabled, trace context (sentry-trace + baggage) is propagated across:
|
|
71
|
+
* - `stub.fetch()` calls to Durable Objects (via HTTP headers)
|
|
72
|
+
* - Service binding `fetch()` calls (via HTTP headers)
|
|
73
|
+
* - RPC method calls to Durable Objects (via trailing argument)
|
|
72
74
|
*
|
|
73
|
-
* When
|
|
75
|
+
* When enabled on the **receiver side** (DurableObject), the SDK will also:
|
|
76
|
+
* - Extract and continue traces from incoming RPC calls
|
|
77
|
+
* - Create spans for each RPC method invocation
|
|
78
|
+
* - Capture errors thrown by RPC methods
|
|
74
79
|
*
|
|
75
|
-
* This
|
|
76
|
-
* Only enable this if you need automatic instrumentation of prototype methods.
|
|
80
|
+
* **Important:** This option should be enabled on **both sides** for full trace propagation.
|
|
77
81
|
*
|
|
78
82
|
* @default false
|
|
79
83
|
* @example
|
|
80
84
|
* ```ts
|
|
81
|
-
* //
|
|
82
|
-
*
|
|
85
|
+
* // Worker side (caller)
|
|
86
|
+
* export default Sentry.withSentry(
|
|
87
|
+
* (env) => ({
|
|
88
|
+
* dsn: env.SENTRY_DSN,
|
|
89
|
+
* enableRpcTracePropagation: true,
|
|
90
|
+
* }),
|
|
91
|
+
* handler,
|
|
92
|
+
* );
|
|
83
93
|
*
|
|
84
|
-
* //
|
|
85
|
-
*
|
|
94
|
+
* // Durable Object side (receiver)
|
|
95
|
+
* export const MyDO = Sentry.instrumentDurableObjectWithSentry(
|
|
96
|
+
* (env) => ({
|
|
97
|
+
* dsn: env.SENTRY_DSN,
|
|
98
|
+
* enableRpcTracePropagation: true,
|
|
99
|
+
* }),
|
|
100
|
+
* MyDOBase,
|
|
101
|
+
* );
|
|
86
102
|
* ```
|
|
87
103
|
*/
|
|
104
|
+
enableRpcTracePropagation?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* @deprecated Use `enableRpcTracePropagation` instead. This option will be removed in a future major version.
|
|
107
|
+
*
|
|
108
|
+
* Enable instrumentation of prototype methods for DurableObjects.
|
|
109
|
+
*
|
|
110
|
+
* When `true`, the SDK will wrap all methods on the DurableObject prototype chain
|
|
111
|
+
* to automatically create spans and capture errors for RPC method calls.
|
|
112
|
+
*
|
|
113
|
+
* When an array of strings is provided, only the specified method names will be instrumented.
|
|
114
|
+
*
|
|
115
|
+
* @default false
|
|
116
|
+
*/
|
|
88
117
|
instrumentPrototypeMethods?: boolean | string[];
|
|
89
118
|
}
|
|
90
119
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Breadcrumb, BreadcrumbHint, PolymorphicRequest, RequestEventData, SdkInfo, Event, EventHint, ErrorEvent, Exception, FeatureFlagsIntegration, Session, SeverityLevel, Span, StackFrame, Stacktrace, Thread, User, Metric, ExclusiveEventHintOrCaptureContext, CaptureContext, } from '@sentry/core';
|
|
2
2
|
export { CloudflareOptions } from './client';
|
|
3
|
-
export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureFeedback, close, createTransport, lastEventId, flush, getClient, isInitialized, isEnabled, getCurrentScope, getGlobalScope, getIsolationScope, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, setConversationId, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, captureCheckIn, withMonitor, setMeasurement, getActiveSpan, getRootSpan, getTraceData, getTraceMetaTags, startSpan, startInactiveSpan, startSpanManual, startNewTrace, suppressTracing, withActiveSpan, getSpanDescendants, continueTrace, functionToStringIntegration, inboundFiltersIntegration, instrumentOpenAiClient, instrumentGoogleGenAIClient, instrumentAnthropicAiClient, eventFiltersIntegration, linkedErrorsIntegration, requestDataIntegration, extraErrorDataIntegration, dedupeIntegration, rewriteFramesIntegration, captureConsoleIntegration, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, instrumentPostgresJsSql, zodErrorsIntegration, consoleIntegration, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, trpcMiddleware, spanToJSON, spanToTraceHeader, spanToBaggageHeader, updateSpanName, wrapMcpServerWithSentry, consoleLoggingIntegration, createConsolaReporter, createLangChainCallbackHandler, instrumentLangChainEmbeddings, featureFlagsIntegration, growthbookIntegration, logger, metrics, withStreamedSpan, instrumentLangGraph, } from '@sentry/core';
|
|
3
|
+
export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, captureFeedback, close, createTransport, lastEventId, flush, getClient, isInitialized, isEnabled, getCurrentScope, getGlobalScope, getIsolationScope, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, setConversationId, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, captureCheckIn, withMonitor, setMeasurement, getActiveSpan, getRootSpan, getTraceData, getTraceMetaTags, startSpan, startInactiveSpan, startSpanManual, startNewTrace, suppressTracing, withActiveSpan, getSpanDescendants, continueTrace, functionToStringIntegration, inboundFiltersIntegration, instrumentOpenAiClient, instrumentGoogleGenAIClient, instrumentAnthropicAiClient, eventFiltersIntegration, linkedErrorsIntegration, requestDataIntegration, extraErrorDataIntegration, dedupeIntegration, rewriteFramesIntegration, captureConsoleIntegration, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, instrumentPostgresJsSql, zodErrorsIntegration, consoleIntegration, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, trpcMiddleware, spanToJSON, spanToTraceHeader, spanToBaggageHeader, updateSpanName, wrapMcpServerWithSentry, consoleLoggingIntegration, createConsolaReporter, createLangChainCallbackHandler, instrumentLangChainEmbeddings, featureFlagsIntegration, growthbookIntegration, logger, metrics, withStreamedSpan, spanStreamingIntegration, instrumentLangGraph, } from '@sentry/core';
|
|
4
4
|
export { withSentry } from './withSentry';
|
|
5
5
|
export { instrumentDurableObjectWithSentry } from './durableobject';
|
|
6
6
|
export { sentryPagesPlugin } from './pages-plugin';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DurableObjectNamespace } from '@cloudflare/workers-types';
|
|
2
|
+
/**
|
|
3
|
+
* Instruments a DurableObjectNamespace binding to create spans for DO interactions.
|
|
4
|
+
*
|
|
5
|
+
* Wraps:
|
|
6
|
+
* - `namespace.get(id)` / `namespace.getByName(name)` with a span + instruments returned stub
|
|
7
|
+
* - `namespace.idFromName(name)` / `namespace.idFromString(id)` / `namespace.newUniqueId()` with breadcrumbs
|
|
8
|
+
*
|
|
9
|
+
* @param namespace - The DurableObjectNamespace to instrument
|
|
10
|
+
*/
|
|
11
|
+
export declare function instrumentDurableObjectNamespace(namespace: DurableObjectNamespace): DurableObjectNamespace;
|
|
12
|
+
//# sourceMappingURL=instrumentDurableObjectNamespace.d.ts.map
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { DurableObjectStorage } from '@cloudflare/workers-types';
|
|
2
|
+
type WaitUntil = (promise: Promise<unknown>) => void;
|
|
2
3
|
/**
|
|
3
4
|
* Instruments DurableObjectStorage methods with Sentry spans.
|
|
4
5
|
*
|
|
5
6
|
* Wraps the following async methods:
|
|
6
7
|
* - get, put, delete, list (KV API)
|
|
8
|
+
* - setAlarm, getAlarm, deleteAlarm (Alarm API)
|
|
9
|
+
*
|
|
10
|
+
* When setAlarm is called, it also stores the current span context so that when
|
|
11
|
+
* the alarm fires later, it can link back to the trace that called setAlarm.
|
|
7
12
|
*
|
|
8
13
|
* @param storage - The DurableObjectStorage instance to instrument
|
|
14
|
+
* @param waitUntil - Optional waitUntil function to defer span context storage
|
|
9
15
|
* @returns An instrumented DurableObjectStorage instance
|
|
10
16
|
*/
|
|
11
|
-
export declare function instrumentDurableObjectStorage(storage: DurableObjectStorage): DurableObjectStorage;
|
|
17
|
+
export declare function instrumentDurableObjectStorage(storage: DurableObjectStorage, waitUntil?: WaitUntil): DurableObjectStorage;
|
|
18
|
+
export {};
|
|
12
19
|
//# sourceMappingURL=instrumentDurableObjectStorage.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CloudflareOptions } from '../../client';
|
|
2
|
+
/**
|
|
3
|
+
* Wraps the Cloudflare `env` object in a Proxy that detects binding types
|
|
4
|
+
* on property access and returns instrumented versions.
|
|
5
|
+
*
|
|
6
|
+
* Currently detects:
|
|
7
|
+
* - DurableObjectNamespace (via `idFromName` duck-typing)
|
|
8
|
+
* - Service bindings / JSRPC proxies (wraps `fetch` for trace propagation)
|
|
9
|
+
*
|
|
10
|
+
* Extensible for future binding types (KV, D1, Queue, etc.).
|
|
11
|
+
*
|
|
12
|
+
* @param env - The Cloudflare env object to instrument
|
|
13
|
+
* @param options - Optional CloudflareOptions to control RPC trace propagation
|
|
14
|
+
*/
|
|
15
|
+
export declare function instrumentEnv<Env extends Record<string, unknown>>(env: Env, options?: CloudflareOptions): Env;
|
|
16
|
+
//# sourceMappingURL=instrumentEnv.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Fetcher } from '@cloudflare/workers-types';
|
|
2
|
+
/**
|
|
3
|
+
* Wraps a fetch-like function to create a span and propagate trace headers
|
|
4
|
+
* (`sentry-trace` and `baggage`) on the outgoing request.
|
|
5
|
+
*
|
|
6
|
+
* Useful for instrumenting Cloudflare bindings that expose a `fetch` method
|
|
7
|
+
* (e.g. Durable Object stubs, Service bindings).
|
|
8
|
+
*/
|
|
9
|
+
export declare function instrumentFetcher(fetchFn: Fetcher['fetch']): Fetcher['fetch'];
|
|
10
|
+
//# sourceMappingURL=instrumentFetcher.d.ts.map
|
|
@@ -7,6 +7,13 @@
|
|
|
7
7
|
* Therefore, we cannot automatically patch setting `experimental_telemetry: { isEnabled: true }`
|
|
8
8
|
* and users have to manually set this to get spans.
|
|
9
9
|
*/
|
|
10
|
+
interface VercelAiOptions {
|
|
11
|
+
/**
|
|
12
|
+
* Enable or disable truncation of recorded input messages.
|
|
13
|
+
* Defaults to `true`.
|
|
14
|
+
*/
|
|
15
|
+
enableTruncation?: boolean;
|
|
16
|
+
}
|
|
10
17
|
/**
|
|
11
18
|
* Adds Sentry tracing instrumentation for the [ai](https://www.npmjs.com/package/ai) library.
|
|
12
19
|
* This integration is not enabled by default, you need to manually add it.
|
|
@@ -33,5 +40,6 @@
|
|
|
33
40
|
* experimental_telemetry: { isEnabled: true, recordInputs: true, recordOutputs: true },
|
|
34
41
|
* });
|
|
35
42
|
*/
|
|
36
|
-
export declare const vercelAIIntegration: () => import("@sentry/core").Integration;
|
|
43
|
+
export declare const vercelAIIntegration: (options?: VercelAiOptions | undefined) => import("@sentry/core").Integration;
|
|
44
|
+
export {};
|
|
37
45
|
//# sourceMappingURL=vercelai.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapted from https://github.com/evanderkoogh/otel-cf-workers/blob/effeb549f0a4ed1c55ea0c4f0d8e8e37e5494fb3/src/instrumentation/env.ts
|
|
3
|
+
*
|
|
4
|
+
* BSD 3-Clause License
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) 2023, Erwin van der Koogh
|
|
7
|
+
*
|
|
8
|
+
* Redistribution and use in source and binary forms, with or without
|
|
9
|
+
* modification, are permitted provided that the following conditions are met:
|
|
10
|
+
*
|
|
11
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
12
|
+
* list of conditions and the following disclaimer.
|
|
13
|
+
*
|
|
14
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
15
|
+
* this list of conditions and the following disclaimer in the documentation
|
|
16
|
+
* and/or other materials provided with the distribution.
|
|
17
|
+
*
|
|
18
|
+
* 3. Neither the name of the copyright holder nor the names of its
|
|
19
|
+
* contributors may be used to endorse or promote products derived from
|
|
20
|
+
* this software without specific prior written permission.
|
|
21
|
+
*
|
|
22
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
23
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
24
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
25
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
26
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
27
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
28
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
29
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
30
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
31
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
32
|
+
*/
|
|
33
|
+
import { DurableObjectNamespace } from '@cloudflare/workers-types';
|
|
34
|
+
/**
|
|
35
|
+
* Checks if a value is a JSRPC proxy (service binding).
|
|
36
|
+
*
|
|
37
|
+
* JSRPC proxies return a truthy value for ANY property access, including
|
|
38
|
+
* properties that don't exist. This makes other duck-type checks unreliable
|
|
39
|
+
* unless we exclude JSRPC first.
|
|
40
|
+
*
|
|
41
|
+
* Must be checked before other binding type checks.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isJSRPC(item: unknown): item is Service;
|
|
44
|
+
/**
|
|
45
|
+
* Duck-type check for DurableObjectNamespace bindings.
|
|
46
|
+
* DurableObjectNamespace has `idFromName`, `idFromString`, `get`, `newUniqueId`.
|
|
47
|
+
*/
|
|
48
|
+
export declare function isDurableObjectNamespace(item: unknown): item is DurableObjectNamespace;
|
|
49
|
+
//# sourceMappingURL=isBinding.d.ts.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CloudflareOptions } from '../client';
|
|
2
|
+
/**
|
|
3
|
+
* Gets the effective RPC propagation setting, handling deprecation of `instrumentPrototypeMethods`.
|
|
4
|
+
*
|
|
5
|
+
* Priority:
|
|
6
|
+
* 1. If `enableRpcTracePropagation` is set, use it (ignore `instrumentPrototypeMethods`)
|
|
7
|
+
* 2. If only `instrumentPrototypeMethods` is set, use it with deprecation warning (converted to boolean)
|
|
8
|
+
* 3. If neither is set, return `false`
|
|
9
|
+
*
|
|
10
|
+
* @returns The effective setting for RPC trace propagation
|
|
11
|
+
*/
|
|
12
|
+
export declare function getEffectiveRpcPropagation(options: CloudflareOptions): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Gets the method filter for prototype method instrumentation.
|
|
15
|
+
*
|
|
16
|
+
* Returns:
|
|
17
|
+
* - `null` if no instrumentation should occur
|
|
18
|
+
* - `true` if all methods should be instrumented
|
|
19
|
+
* - `string[]` if only specific methods should be instrumented (deprecated behavior)
|
|
20
|
+
*
|
|
21
|
+
* @returns The method filter or null if no instrumentation
|
|
22
|
+
*/
|
|
23
|
+
export declare function getPrototypeMethodFilter(options: CloudflareOptions): boolean | string[];
|
|
24
|
+
//# sourceMappingURL=rpcOptions.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DurableObjectStorage } from '@cloudflare/workers-types';
|
|
2
|
+
import { SpanLink } from '@sentry/core';
|
|
3
|
+
/** Stored span context for creating span links */
|
|
4
|
+
export interface StoredSpanContext {
|
|
5
|
+
traceId: string;
|
|
6
|
+
spanId: string;
|
|
7
|
+
sampled: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Gets the storage key for a specific method's trace link.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getTraceLinkKey(methodName: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Stores the current span context in Durable Object storage for trace linking.
|
|
15
|
+
* Uses the original uninstrumented storage to avoid creating spans for internal operations.
|
|
16
|
+
* Errors are silently ignored to prevent internal storage failures from propagating to user code.
|
|
17
|
+
*/
|
|
18
|
+
export declare function storeSpanContext(originalStorage: DurableObjectStorage, methodName: string): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves a stored span context from Durable Object storage.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getStoredSpanContext(originalStorage: DurableObjectStorage, methodName: string): Promise<StoredSpanContext | undefined>;
|
|
23
|
+
/**
|
|
24
|
+
* Builds span links from a stored span context.
|
|
25
|
+
*/
|
|
26
|
+
export declare function buildSpanLinks(storedContext: StoredSpanContext): SpanLink[];
|
|
27
|
+
//# sourceMappingURL=traceLinks.d.ts.map
|