@sentry/cloudflare 10.51.0 → 10.52.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/index.js +2 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/instrumentations/instrumentWorkerEntrypoint.js +12 -1
- package/build/cjs/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/cjs/instrumentations/worker/instrumentEnv.js +15 -8
- package/build/cjs/instrumentations/worker/instrumentEnv.js.map +1 -1
- package/build/cjs/instrumentations/worker/instrumentQueue.js +2 -0
- package/build/cjs/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/cjs/instrumentations/worker/instrumentQueueProducer.js +106 -0
- package/build/cjs/instrumentations/worker/instrumentQueueProducer.js.map +1 -0
- package/build/cjs/integrations/httpServer.js +68 -0
- package/build/cjs/integrations/httpServer.js.map +1 -0
- package/build/cjs/request.js +5 -0
- package/build/cjs/request.js.map +1 -1
- package/build/cjs/sdk.js +2 -0
- package/build/cjs/sdk.js.map +1 -1
- package/build/cjs/utils/isBinding.js +9 -0
- package/build/cjs/utils/isBinding.js.map +1 -1
- package/build/esm/index.js +1 -0
- package/build/esm/index.js.map +1 -1
- package/build/esm/instrumentations/instrumentWorkerEntrypoint.js +12 -1
- package/build/esm/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
- package/build/esm/instrumentations/worker/instrumentEnv.js +16 -9
- package/build/esm/instrumentations/worker/instrumentEnv.js.map +1 -1
- package/build/esm/instrumentations/worker/instrumentQueue.js +2 -0
- package/build/esm/instrumentations/worker/instrumentQueue.js.map +1 -1
- package/build/esm/instrumentations/worker/instrumentQueueProducer.js +104 -0
- package/build/esm/instrumentations/worker/instrumentQueueProducer.js.map +1 -0
- package/build/esm/integrations/httpServer.js +65 -0
- package/build/esm/integrations/httpServer.js.map +1 -0
- package/build/esm/package.json +1 -1
- package/build/esm/request.js +5 -0
- package/build/esm/request.js.map +1 -1
- package/build/esm/sdk.js +2 -0
- package/build/esm/sdk.js.map +1 -1
- package/build/esm/utils/isBinding.js +9 -1
- package/build/esm/utils/isBinding.js.map +1 -1
- package/build/types/index.d.ts +1 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/instrumentations/instrumentWorkerEntrypoint.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentEnv.d.ts +3 -2
- package/build/types/instrumentations/worker/instrumentEnv.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentQueue.d.ts.map +1 -1
- package/build/types/instrumentations/worker/instrumentQueueProducer.d.ts +10 -0
- package/build/types/instrumentations/worker/instrumentQueueProducer.d.ts.map +1 -0
- package/build/types/integrations/httpServer.d.ts +61 -0
- package/build/types/integrations/httpServer.d.ts.map +1 -0
- package/build/types/request.d.ts.map +1 -1
- package/build/types/sdk.d.ts.map +1 -1
- package/build/types/utils/isBinding.d.ts +6 -1
- package/build/types/utils/isBinding.d.ts.map +1 -1
- package/build/types-ts3.8/index.d.ts +1 -0
- package/build/types-ts3.8/instrumentations/worker/instrumentEnv.d.ts +3 -2
- package/build/types-ts3.8/instrumentations/worker/instrumentQueueProducer.d.ts +10 -0
- package/build/types-ts3.8/integrations/httpServer.d.ts +61 -0
- package/build/types-ts3.8/utils/isBinding.d.ts +6 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instrumentQueueProducer.d.ts","sourceRoot":"","sources":["../../../../src/instrumentations/worker/instrumentQueueProducer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAsB,KAAK,EAA2C,MAAM,2BAA2B,CAAC;AA0DpH;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,GAAG,CAAC,CAsCzF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { Client, MaxRequestBodySize } from '@sentry/core';
|
|
2
|
+
export interface HttpServerIntegrationOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Controls the maximum size of incoming request bodies attached to events.
|
|
5
|
+
*
|
|
6
|
+
* Only applies to requests with textual content types (text/*, application/json,
|
|
7
|
+
* application/x-www-form-urlencoded, application/xml, application/graphql).
|
|
8
|
+
* Binary data is not captured.
|
|
9
|
+
*
|
|
10
|
+
* Available options:
|
|
11
|
+
* - `'none'`: No request bodies will be attached
|
|
12
|
+
* - `'small'`: Request bodies up to 1,000 bytes will be attached
|
|
13
|
+
* - `'medium'`: Request bodies up to 10,000 bytes will be attached (default)
|
|
14
|
+
* - `'always'`: Request bodies will always be attached (up to 1MB limit)
|
|
15
|
+
*
|
|
16
|
+
* @default 'medium'
|
|
17
|
+
*/
|
|
18
|
+
maxRequestBodySize?: MaxRequestBodySize;
|
|
19
|
+
/**
|
|
20
|
+
* Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.
|
|
21
|
+
* This can be useful for long running requests where the body is not needed, health check endpoints,
|
|
22
|
+
* or requests containing sensitive data that should not be captured.
|
|
23
|
+
*
|
|
24
|
+
* @param url The full URL of the incoming request, including query string, protocol, host, etc.
|
|
25
|
+
* @param request The incoming Request object.
|
|
26
|
+
* @returns `true` to skip body capture for this request, `false` to capture normally.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* Sentry.httpServerIntegration({
|
|
31
|
+
* ignoreRequestBody: (url) => url.includes('/health') || url.includes('/upload'),
|
|
32
|
+
* })
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
ignoreRequestBody?: (url: string, request: Request) => boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Configures incoming HTTP request handling for Cloudflare Workers.
|
|
39
|
+
*
|
|
40
|
+
* This integration controls how incoming HTTP request data is captured,
|
|
41
|
+
* matching the API of `httpServerIntegration` in Node.js.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* Sentry.init({
|
|
46
|
+
* integrations: [
|
|
47
|
+
* Sentry.httpServerIntegration({
|
|
48
|
+
* maxRequestBodySize: 'medium',
|
|
49
|
+
* ignoreRequestBody: (url) => url.includes('/health'),
|
|
50
|
+
* }),
|
|
51
|
+
* ],
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const httpServerIntegration: (options?: HttpServerIntegrationOptions | undefined) => import("@sentry/core").Integration;
|
|
56
|
+
/**
|
|
57
|
+
* Capture the request body based on the HttpServer integration config.
|
|
58
|
+
* Called internally by `wrapRequestHandler`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function captureIncomingRequestBody(client: Client, request: Request): Promise<void>;
|
|
61
|
+
//# sourceMappingURL=httpServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpServer.d.ts","sourceRoot":"","sources":["../../../src/integrations/httpServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAiB,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAK9E,MAAM,WAAW,4BAA4B;IAC3C;;;;;;;;;;;;;;OAcG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC;;;;;;;;;;;;;;;OAeG;IACH,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC;CAChE;AAgBD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,qBAAqB,4FAA4C,CAAC;AAE/E;;;GAGG;AACH,wBAAsB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBhG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAe7G,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAMlD,UAAU,4BAA4B;IACpC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,2BAA2B,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;IACxF,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAAC;IACtC;;;;;;;;;OASG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,4BAA4B,EAC5C,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,GAC5D,OAAO,CAAC,QAAQ,CAAC,CAgJnB"}
|
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;AAchD,OAAO,KAAK,EAA2B,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,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;AAS5C,2DAA2D;AAC3D,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,WAAW,EAAE,CAmBhF;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,gBAAgB,GAAG,SAAS,CAiC7E"}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
31
31
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
32
32
|
*/
|
|
33
|
-
import type { DurableObjectNamespace } from '@cloudflare/workers-types';
|
|
33
|
+
import type { DurableObjectNamespace, Queue } from '@cloudflare/workers-types';
|
|
34
34
|
/**
|
|
35
35
|
* Checks if a value is a JSRPC proxy (service binding).
|
|
36
36
|
*
|
|
@@ -46,4 +46,9 @@ export declare function isJSRPC(item: unknown): item is Service;
|
|
|
46
46
|
* DurableObjectNamespace has `idFromName`, `idFromString`, `get`, `newUniqueId`.
|
|
47
47
|
*/
|
|
48
48
|
export declare function isDurableObjectNamespace(item: unknown): item is DurableObjectNamespace;
|
|
49
|
+
/**
|
|
50
|
+
* Duck-type check for Queue producer bindings.
|
|
51
|
+
* Queue has `send` and `sendBatch` async methods.
|
|
52
|
+
*/
|
|
53
|
+
export declare function isQueue(item: unknown): item is Queue;
|
|
49
54
|
//# sourceMappingURL=isBinding.d.ts.map
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"isBinding.d.ts","sourceRoot":"","sources":["../../../src/utils/isBinding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAE/E;;;;;;;;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;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,KAAK,CAEpD"}
|
|
@@ -7,6 +7,7 @@ export { sentryPagesPlugin } from './pages-plugin';
|
|
|
7
7
|
export { wrapRequestHandler } from './request';
|
|
8
8
|
export { CloudflareClient } from './client';
|
|
9
9
|
export { getDefaultIntegrations } from './sdk';
|
|
10
|
+
export { httpServerIntegration } from './integrations/httpServer';
|
|
10
11
|
export { fetchIntegration } from './integrations/fetch';
|
|
11
12
|
export { vercelAIIntegration } from './integrations/tracing/vercelai';
|
|
12
13
|
export { honoIntegration } from './integrations/hono';
|
|
@@ -5,9 +5,10 @@ import { CloudflareOptions } from '../../client';
|
|
|
5
5
|
*
|
|
6
6
|
* Currently detects:
|
|
7
7
|
* - DurableObjectNamespace (via `idFromName` duck-typing)
|
|
8
|
-
* - Service bindings / JSRPC proxies
|
|
8
|
+
* - Service bindings / JSRPC proxies
|
|
9
|
+
* - Queue producers (via `send` + `sendBatch` duck-typing)
|
|
9
10
|
*
|
|
10
|
-
* Extensible for future binding types (KV, D1,
|
|
11
|
+
* Extensible for future binding types (KV, D1, etc.).
|
|
11
12
|
*
|
|
12
13
|
* @param env - The Cloudflare env object to instrument
|
|
13
14
|
* @param options - Optional CloudflareOptions to control RPC trace propagation
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Queue } from '@cloudflare/workers-types';
|
|
2
|
+
/**
|
|
3
|
+
* Wraps a Queue producer binding to create `queue.publish` spans on
|
|
4
|
+
* `send` and `sendBatch` calls.
|
|
5
|
+
*
|
|
6
|
+
* The queue's own name is not available on the binding object, so we use
|
|
7
|
+
* the env binding key (e.g. `MY_QUEUE`) as `messaging.destination.name`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function instrumentQueueProducer<T extends Queue>(queue: T, bindingName: string): T;
|
|
10
|
+
//# sourceMappingURL=instrumentQueueProducer.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Client, MaxRequestBodySize } from '@sentry/core';
|
|
2
|
+
export interface HttpServerIntegrationOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Controls the maximum size of incoming request bodies attached to events.
|
|
5
|
+
*
|
|
6
|
+
* Only applies to requests with textual content types (text/*, application/json,
|
|
7
|
+
* application/x-www-form-urlencoded, application/xml, application/graphql).
|
|
8
|
+
* Binary data is not captured.
|
|
9
|
+
*
|
|
10
|
+
* Available options:
|
|
11
|
+
* - `'none'`: No request bodies will be attached
|
|
12
|
+
* - `'small'`: Request bodies up to 1,000 bytes will be attached
|
|
13
|
+
* - `'medium'`: Request bodies up to 10,000 bytes will be attached (default)
|
|
14
|
+
* - `'always'`: Request bodies will always be attached (up to 1MB limit)
|
|
15
|
+
*
|
|
16
|
+
* @default 'medium'
|
|
17
|
+
*/
|
|
18
|
+
maxRequestBodySize?: MaxRequestBodySize;
|
|
19
|
+
/**
|
|
20
|
+
* Do not capture the request body for incoming HTTP requests to URLs where the given callback returns `true`.
|
|
21
|
+
* This can be useful for long running requests where the body is not needed, health check endpoints,
|
|
22
|
+
* or requests containing sensitive data that should not be captured.
|
|
23
|
+
*
|
|
24
|
+
* @param url The full URL of the incoming request, including query string, protocol, host, etc.
|
|
25
|
+
* @param request The incoming Request object.
|
|
26
|
+
* @returns `true` to skip body capture for this request, `false` to capture normally.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* Sentry.httpServerIntegration({
|
|
31
|
+
* ignoreRequestBody: (url) => url.includes('/health') || url.includes('/upload'),
|
|
32
|
+
* })
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
ignoreRequestBody?: (url: string, request: Request) => boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Configures incoming HTTP request handling for Cloudflare Workers.
|
|
39
|
+
*
|
|
40
|
+
* This integration controls how incoming HTTP request data is captured,
|
|
41
|
+
* matching the API of `httpServerIntegration` in Node.js.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* Sentry.init({
|
|
46
|
+
* integrations: [
|
|
47
|
+
* Sentry.httpServerIntegration({
|
|
48
|
+
* maxRequestBodySize: 'medium',
|
|
49
|
+
* ignoreRequestBody: (url) => url.includes('/health'),
|
|
50
|
+
* }),
|
|
51
|
+
* ],
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare const httpServerIntegration: (options?: HttpServerIntegrationOptions | undefined) => import("@sentry/core").Integration;
|
|
56
|
+
/**
|
|
57
|
+
* Capture the request body based on the HttpServer integration config.
|
|
58
|
+
* Called internally by `wrapRequestHandler`.
|
|
59
|
+
*/
|
|
60
|
+
export declare function captureIncomingRequestBody(client: Client, request: Request): Promise<void>;
|
|
61
|
+
//# sourceMappingURL=httpServer.d.ts.map
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
31
31
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
32
32
|
*/
|
|
33
|
-
import { DurableObjectNamespace } from '@cloudflare/workers-types';
|
|
33
|
+
import { DurableObjectNamespace, Queue } from '@cloudflare/workers-types';
|
|
34
34
|
/**
|
|
35
35
|
* Checks if a value is a JSRPC proxy (service binding).
|
|
36
36
|
*
|
|
@@ -46,4 +46,9 @@ export declare function isJSRPC(item: unknown): item is Service;
|
|
|
46
46
|
* DurableObjectNamespace has `idFromName`, `idFromString`, `get`, `newUniqueId`.
|
|
47
47
|
*/
|
|
48
48
|
export declare function isDurableObjectNamespace(item: unknown): item is DurableObjectNamespace;
|
|
49
|
+
/**
|
|
50
|
+
* Duck-type check for Queue producer bindings.
|
|
51
|
+
* Queue has `send` and `sendBatch` async methods.
|
|
52
|
+
*/
|
|
53
|
+
export declare function isQueue(item: unknown): item is Queue;
|
|
49
54
|
//# sourceMappingURL=isBinding.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/cloudflare",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.52.0",
|
|
4
4
|
"description": "Official Sentry SDK for Cloudflare Workers and Pages",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/cloudflare",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@opentelemetry/api": "^1.9.1",
|
|
53
|
-
"@sentry/core": "10.
|
|
53
|
+
"@sentry/core": "10.52.0"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@cloudflare/workers-types": "^4.x"
|