@sentry/cloudflare 10.71.0 → 10.73.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.
Files changed (72) hide show
  1. package/build/cjs/client.js.map +1 -1
  2. package/build/cjs/durableobject.js +2 -53
  3. package/build/cjs/durableobject.js.map +1 -1
  4. package/build/cjs/instrumentations/instrumentDurableObjectHandlers.js +114 -0
  5. package/build/cjs/instrumentations/instrumentDurableObjectHandlers.js.map +1 -0
  6. package/build/cjs/instrumentations/instrumentDurableObjectNamespace.js +4 -4
  7. package/build/cjs/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  8. package/build/cjs/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
  9. package/build/cjs/instrumentations/worker/instrumentEnv.js +5 -7
  10. package/build/cjs/instrumentations/worker/instrumentEnv.js.map +1 -1
  11. package/build/cjs/utils/rpcPropagation.js +20 -0
  12. package/build/cjs/utils/rpcPropagation.js.map +1 -0
  13. package/build/cjs/vite/autoInstrument.js +2 -1
  14. package/build/cjs/vite/autoInstrument.js.map +1 -1
  15. package/build/cjs/vite/bindings.js +6 -0
  16. package/build/cjs/vite/bindings.js.map +1 -0
  17. package/build/cjs/vite/index.js.map +1 -1
  18. package/build/cjs/vite/transform.js +30 -5
  19. package/build/cjs/vite/transform.js.map +1 -1
  20. package/build/cjs/vite/wranglerConfig.js +21 -1
  21. package/build/cjs/vite/wranglerConfig.js.map +1 -1
  22. package/build/esm/client.js.map +1 -1
  23. package/build/esm/durableobject.js +3 -54
  24. package/build/esm/durableobject.js.map +1 -1
  25. package/build/esm/instrumentations/instrumentDurableObjectHandlers.js +112 -0
  26. package/build/esm/instrumentations/instrumentDurableObjectHandlers.js.map +1 -0
  27. package/build/esm/instrumentations/instrumentDurableObjectNamespace.js +4 -4
  28. package/build/esm/instrumentations/instrumentDurableObjectNamespace.js.map +1 -1
  29. package/build/esm/instrumentations/instrumentWorkerEntrypoint.js.map +1 -1
  30. package/build/esm/instrumentations/worker/instrumentEnv.js +5 -7
  31. package/build/esm/instrumentations/worker/instrumentEnv.js.map +1 -1
  32. package/build/esm/package.json +1 -1
  33. package/build/esm/utils/rpcPropagation.js +18 -0
  34. package/build/esm/utils/rpcPropagation.js.map +1 -0
  35. package/build/esm/vite/autoInstrument.js +2 -1
  36. package/build/esm/vite/autoInstrument.js.map +1 -1
  37. package/build/esm/vite/bindings.js +4 -0
  38. package/build/esm/vite/bindings.js.map +1 -0
  39. package/build/esm/vite/index.js.map +1 -1
  40. package/build/esm/vite/transform.js +30 -5
  41. package/build/esm/vite/transform.js.map +1 -1
  42. package/build/esm/vite/wranglerConfig.js +21 -2
  43. package/build/esm/vite/wranglerConfig.js.map +1 -1
  44. package/build/types/client.d.ts +39 -29
  45. package/build/types/client.d.ts.map +1 -1
  46. package/build/types/durableobject.d.ts.map +1 -1
  47. package/build/types/instrumentations/instrumentDurableObjectHandlers.d.ts +28 -0
  48. package/build/types/instrumentations/instrumentDurableObjectHandlers.d.ts.map +1 -0
  49. package/build/types/instrumentations/instrumentDurableObjectNamespace.d.ts +2 -1
  50. package/build/types/instrumentations/instrumentDurableObjectNamespace.d.ts.map +1 -1
  51. package/build/types/instrumentations/instrumentWorkerEntrypoint.d.ts.map +1 -1
  52. package/build/types/instrumentations/worker/instrumentEnv.d.ts.map +1 -1
  53. package/build/types/utils/rpcPropagation.d.ts +15 -0
  54. package/build/types/utils/rpcPropagation.d.ts.map +1 -0
  55. package/build/types/vite/autoInstrument.d.ts.map +1 -1
  56. package/build/types/vite/bindings.d.ts +15 -0
  57. package/build/types/vite/bindings.d.ts.map +1 -0
  58. package/build/types/vite/index.d.ts +4 -0
  59. package/build/types/vite/index.d.ts.map +1 -1
  60. package/build/types/vite/transform.d.ts +3 -0
  61. package/build/types/vite/transform.d.ts.map +1 -1
  62. package/build/types/vite/wranglerConfig.d.ts +7 -0
  63. package/build/types/vite/wranglerConfig.d.ts.map +1 -1
  64. package/build/types-ts3.8/client.d.ts +39 -29
  65. package/build/types-ts3.8/instrumentations/instrumentDurableObjectHandlers.d.ts +28 -0
  66. package/build/types-ts3.8/instrumentations/instrumentDurableObjectNamespace.d.ts +2 -1
  67. package/build/types-ts3.8/utils/rpcPropagation.d.ts +15 -0
  68. package/build/types-ts3.8/vite/bindings.d.ts +15 -0
  69. package/build/types-ts3.8/vite/index.d.ts +4 -0
  70. package/build/types-ts3.8/vite/transform.d.ts +3 -0
  71. package/build/types-ts3.8/vite/wranglerConfig.d.ts +7 -0
  72. package/package.json +3 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../../../src/vite/bindings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,sFAAsF;AACtF,eAAO,MAAM,cAAc,eAA0B,CAAC;AAEtD,wGAAwG;AACxG,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,cAAc,CAAC;AAExD,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,UAAU,CAAC;CACvB"}
@@ -40,6 +40,10 @@ export interface SentryCloudflareVitePluginOptions {
40
40
  * Durable Object class with `instrumentDurableObjectWithSentry`. Both
41
41
  * `vite build` and `vite dev` are instrumented.
42
42
  *
43
+ * The plugin also adds the bindings that resolve to the wrapped classes (this worker's own
44
+ * Durable Objects and self service bindings) to `rpcTracePropagationBindings`. Bindings to
45
+ * other workers stay opt-in, their receivers may not run Sentry.
46
+ *
43
47
  * @default false
44
48
  * @experimental May change or be removed in any release.
45
49
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/index.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,aAAa,CAAC,EAAE;QACd;;;;;;;;;;;;;WAaG;QACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;QACzC;;;;;;;;;;WAUG;QACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,iCAAsC;;;;cA5DlF,CAAC;;;;;YAiCgE,CAAC;mBAChD,CAAC;gBAAS,CAAA;;;;;;kCAmCnC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/vite/index.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD;;;;;;;;;OASG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,aAAa,CAAC,EAAE;QACd;;;;;;;;;;;;;WAaG;QACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;QACzC;;;;;;;;;;;;;;WAcG;QACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,GAAE,iCAAsC;;;;cAhElF,CAAC;;;;;YA2BmC,CAAC;mBAEtC,CAAC;gBAAQ,CAAC;;;;;;kCA4ChB"}
@@ -1,4 +1,5 @@
1
1
  import MagicString from 'magic-string';
2
+ import { type SameWorkerBinding } from './bindings';
2
3
  export interface BaseNode {
3
4
  type: string;
4
5
  start: number;
@@ -34,6 +35,8 @@ export interface TransformContext {
34
35
  optionsFn: string;
35
36
  /** Import statement prepended when `optionsFn` references a separate module. */
36
37
  optionsImport?: string;
38
+ /** @see {@link import('./wranglerConfig').WranglerConfig.sameWorkerBindings} */
39
+ sameWorkerBindings?: readonly SameWorkerBinding[];
37
40
  }
38
41
  export interface TransformResult {
39
42
  code: string;
@@ -1 +1 @@
1
- {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/vite/transform.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc,CAAC;AAOvC,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAuDD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,OAAO,GAAG,UAAU,GAAG,kBAAkB,CAAC;AAc3F,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5C;;;;OAIG;IACH,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,gBAAgB,GACpB,eAAe,GAAG,SAAS,CA8C7B"}
1
+ {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../../../src/vite/transform.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc,CAAC;AACvC,OAAO,EAAmC,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AASrF,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,EAAE,CAAC;CAClB;AAuDD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAAG,eAAe,GAAG,OAAO,GAAG,UAAU,GAAG,kBAAkB,CAAC;AAc3F,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC7C;;;OAGG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gFAAgF;IAChF,kBAAkB,CAAC,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACnD;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5C;;;;OAIG;IACH,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC7B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,WAAW,EAChB,GAAG,EAAE,gBAAgB,GACpB,eAAe,GAAG,SAAS,CAsD7B"}
@@ -1,3 +1,5 @@
1
+ import { DEFAULT_EXPORT, type ExportName, type SameWorkerBinding } from './bindings';
2
+ export { DEFAULT_EXPORT, type ExportName, type SameWorkerBinding };
1
3
  /**
2
4
  * The slice of the wrangler configuration the auto-instrument plugin cares
3
5
  * about. `main` is an absolute path (wrangler resolves it against the config
@@ -20,6 +22,11 @@ export interface WranglerConfig {
20
22
  * an export on a *different* worker, which this build can't wrap.
21
23
  */
22
24
  workerEntrypoints: string[];
25
+ /**
26
+ * Bindings whose RPC receiver lives in this worker, so this build instruments it. Not deduped by
27
+ * class, two bindings may point at the same class and both names have to be listed.
28
+ */
29
+ sameWorkerBindings: SameWorkerBinding[];
23
30
  }
24
31
  /**
25
32
  * Locate and resolve the wrangler configuration via wrangler's own
@@ -1 +1 @@
1
- {"version":3,"file":"wranglerConfig.d.ts","sourceRoot":"","sources":["../../../src/vite/wranglerConfig.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD;;;;;OAKG;IACH,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,MAAM,GACpB;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CA2B3D"}
1
+ {"version":3,"file":"wranglerConfig.d.ts","sourceRoot":"","sources":["../../../src/vite/wranglerConfig.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAErF,OAAO,EAAE,cAAc,EAAE,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,CAAC;AAEnE;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtD;;;;;OAKG;IACH,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B;;;OAGG;IACH,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,MAAM,GACpB;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CA4B3D"}
@@ -1,4 +1,4 @@
1
- import { ClientOptions, Options } from '@sentry/core';
1
+ import { ClientOptions, Options, TracePropagationTargets } from '@sentry/core';
2
2
  import { ServerRuntimeClient } from '@sentry/core';
3
3
  import { ExecutionContextCompat } from './executionContext';
4
4
  import { makeFlushLock } from './flush';
@@ -68,47 +68,57 @@ interface BaseCloudflareOptions {
68
68
  */
69
69
  skipOpenTelemetrySetup?: boolean;
70
70
  /**
71
- * Enable trace propagation for RPC calls between Workers, Durable Objects, and Service Bindings.
71
+ * The bindings on `env` that outgoing RPC calls propagate trace context to.
72
72
  *
73
- * When enabled, trace context (sentry-trace + baggage) is propagated across:
74
- * - `stub.fetch()` calls to Durable Objects (via HTTP headers)
75
- * - Service binding `fetch()` calls (via HTTP headers)
76
- * - RPC method calls to Durable Objects and WorkerEntrypoints (via trailing argument)
73
+ * Strings match a binding name exactly, regular expressions match by pattern. An empty array
74
+ * (the default) propagates to nothing.
77
75
  *
78
- * When enabled on the **receiver side** (DurableObject or WorkerEntrypoint), the SDK will also:
79
- * - Extract and continue traces from incoming RPC calls
80
- * - Create spans for each RPC method invocation
81
- * - Capture errors thrown by RPC methods
76
+ * RPC has no headers to carry trace context, so the SDK appends it as a trailing argument to
77
+ * every RPC method call on a matching binding. Only a Sentry-instrumented receiver strips that
78
+ * argument again. Anywhere else it arrives as a real argument and changes what the method was
79
+ * called with, so list only the bindings whose receiver you know runs Sentry.
82
80
  *
83
- * **Important:** This option should be enabled on **both sides** for full trace propagation.
81
+ * Propagation over `stub.fetch()` and service binding `fetch()` uses HTTP headers and is not
82
+ * affected by this option.
84
83
  *
85
- * @default false
84
+ * When you build with the Sentry Cloudflare Vite plugin, bindings that resolve to *this* worker
85
+ * (its own Durable Objects, its self service bindings) are added for you, because the plugin
86
+ * instruments those receivers itself. Whatever you list here is added on top of them.
87
+ *
88
+ * Setting this takes precedence over `enableRpcTracePropagation`: an allow list is the more
89
+ * precise statement, so a worker that sets both propagates only to the listed bindings. An empty
90
+ * array propagates to nothing, which is how a receiver keeps `enableRpcTracePropagation: true`
91
+ * without propagating to anything itself.
92
+ *
93
+ * The receiver still needs `enableRpcTracePropagation: true` to continue the trace it is sent.
94
+ *
95
+ * @default []
86
96
  * @example
87
97
  * ```ts
88
- * // Worker side (caller)
98
+ * // Propagate to `env.ORDERS` and every `env.SVC_*` binding
89
99
  * export default Sentry.withSentry(
90
- * (env) => ({
100
+ * env => ({
91
101
  * dsn: env.SENTRY_DSN,
92
- * enableRpcTracePropagation: true,
102
+ * rpcTracePropagationBindings: ['ORDERS', /^SVC_/],
93
103
  * }),
94
104
  * handler,
95
105
  * );
106
+ * ```
107
+ */
108
+ rpcTracePropagationBindings?: TracePropagationTargets;
109
+ /**
110
+ * Whether trace context is propagated over RPC calls between Workers, Durable Objects, and
111
+ * Service Bindings.
96
112
  *
97
- * // Durable Object side (receiver)
98
- * export const MyDO = Sentry.instrumentDurableObjectWithSentry(
99
- * (env) => ({
100
- * dsn: env.SENTRY_DSN,
101
- * enableRpcTracePropagation: true,
102
- * }),
103
- * MyDOBase,
104
- * );
113
+ * On the caller side, `true` appends the trace context as a trailing argument to every RPC method
114
+ * call on `env`, including bindings whose receiver does not run Sentry and therefore never strips
115
+ * that argument again. On the receiver side, `true` continues an incoming trace, creates a span
116
+ * per RPC method invocation, and captures errors thrown by RPC methods.
105
117
  *
106
- * // WorkerEntrypoint side (receiver)
107
- * export const MyEntrypoint = Sentry.withSentry(
108
- * env => ({ dsn: env.SENTRY_DSN, enableRpcTracePropagation: true }),
109
- * MyEntrypointBase,
110
- * );
111
- * ```
118
+ * @deprecated Use `rpcTracePropagationBindings` to name the bindings you call. This option will
119
+ * be removed in a future major version. Receivers keep using it until then.
120
+ *
121
+ * @default false
112
122
  */
113
123
  enableRpcTracePropagation?: boolean;
114
124
  /**
@@ -0,0 +1,28 @@
1
+ import { DurableObject } from 'cloudflare:workers';
2
+ import { CloudflareOptions } from '../client';
3
+ /**
4
+ * The instrumented context of the Durable Object being wrapped.
5
+ *
6
+ * Kept as `any` for the same reason as in `durableobject.ts`: a concrete `DurableObjectState` here
7
+ * makes `tsc` relate its `SqlStorage` graph against the parameter union of `wrapMethodWithSentry`,
8
+ * which hangs the type build.
9
+ */
10
+ type InstrumentedDurableObjectContext = any;
11
+ /**
12
+ * Instruments the built-in Durable Object handler methods on a constructed instance.
13
+ *
14
+ * These are the methods that are available on a Durable Object
15
+ * ref: https://developers.cloudflare.com/durable-objects/api/base/
16
+ * - obj.alarm
17
+ * - obj.fetch
18
+ * - obj.webSocketError
19
+ * - obj.webSocketClose
20
+ * - obj.webSocketMessage
21
+ *
22
+ * Any other public methods on the Durable Object instance are RPC calls.
23
+ *
24
+ * @internal
25
+ */
26
+ export declare function instrumentDurableObjectHandlers<E, T extends DurableObject<E>>(obj: T, options: CloudflareOptions, context: InstrumentedDurableObjectContext): void;
27
+ export {};
28
+ //# sourceMappingURL=instrumentDurableObjectHandlers.d.ts.map
@@ -8,6 +8,7 @@ export declare const STUB_NON_RPC_METHODS: Set<string>;
8
8
  * - `namespace.idFromName(name)` / `namespace.idFromString(id)` / `namespace.newUniqueId()` with breadcrumbs
9
9
  *
10
10
  * @param namespace - The DurableObjectNamespace to instrument
11
+ * @param propagateRpcTrace - Whether RPC method calls on the returned stubs carry trace context
11
12
  */
12
- export declare function instrumentDurableObjectNamespace(namespace: DurableObjectNamespace): DurableObjectNamespace;
13
+ export declare function instrumentDurableObjectNamespace(namespace: DurableObjectNamespace, propagateRpcTrace?: boolean): DurableObjectNamespace;
13
14
  //# sourceMappingURL=instrumentDurableObjectNamespace.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { CloudflareOptions } from '../client';
2
+ /**
3
+ * Builds the per-binding predicate that decides whether a binding takes part in RPC trace
4
+ * propagation.
5
+ *
6
+ * `rpcTracePropagationBindings` wins over `enableRpcTracePropagation` as soon as it is set, an
7
+ * allow list is the more precise statement. An empty list therefore propagates to nothing, even
8
+ * next to `enableRpcTracePropagation: true`, which is how a receiver opts out of being a caller.
9
+ * Only leaving it unset falls back to the boolean.
10
+ *
11
+ * Callers only. Receivers continue an incoming trace whenever `enableRpcTracePropagation` is on,
12
+ * so they have nothing to match against.
13
+ */
14
+ export declare function createRpcPropagationResolver(options: CloudflareOptions | undefined): (bindingName: string) => boolean;
15
+ //# sourceMappingURL=rpcPropagation.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Binding vocabulary shared by the wrangler config reader and the AST transform.
3
+ *
4
+ * It lives apart from `wranglerConfig.ts` so the transform never has to import that module, which
5
+ * pulls in `wrangler` and with it a Node 20+ runtime.
6
+ */
7
+ /** Stands in for a class name where a binding targets the module's default export. */
8
+ export declare const DEFAULT_EXPORT: unique symbol;
9
+ /** The name a binding or an export is known by, either an exported class name or the default export. */
10
+ export type ExportName = string | typeof DEFAULT_EXPORT;
11
+ export interface SameWorkerBinding {
12
+ bindingName: string;
13
+ className: ExportName;
14
+ }
15
+ //# sourceMappingURL=bindings.d.ts.map
@@ -40,6 +40,10 @@ export interface SentryCloudflareVitePluginOptions {
40
40
  * Durable Object class with `instrumentDurableObjectWithSentry`. Both
41
41
  * `vite build` and `vite dev` are instrumented.
42
42
  *
43
+ * The plugin also adds the bindings that resolve to the wrapped classes (this worker's own
44
+ * Durable Objects and self service bindings) to `rpcTracePropagationBindings`. Bindings to
45
+ * other workers stay opt-in, their receivers may not run Sentry.
46
+ *
43
47
  * @default false
44
48
  * @experimental May change or be removed in any release.
45
49
  */
@@ -1,4 +1,5 @@
1
1
  import MagicString from 'magic-string';
2
+ import { SameWorkerBinding } from './bindings';
2
3
  export interface BaseNode {
3
4
  type: string;
4
5
  start: number;
@@ -34,6 +35,8 @@ export interface TransformContext {
34
35
  optionsFn: string;
35
36
  /** Import statement prepended when `optionsFn` references a separate module. */
36
37
  optionsImport?: string;
38
+ /** @see {@link import('./wranglerConfig').WranglerConfig.sameWorkerBindings} */
39
+ sameWorkerBindings?: readonly SameWorkerBinding[];
37
40
  }
38
41
  export interface TransformResult {
39
42
  code: string;
@@ -1,3 +1,5 @@
1
+ import { DEFAULT_EXPORT, ExportName, SameWorkerBinding } from './bindings';
2
+ export { DEFAULT_EXPORT, ExportName, SameWorkerBinding };
1
3
  /**
2
4
  * The slice of the wrangler configuration the auto-instrument plugin cares
3
5
  * about. `main` is an absolute path (wrangler resolves it against the config
@@ -20,6 +22,11 @@ export interface WranglerConfig {
20
22
  * an export on a *different* worker, which this build can't wrap.
21
23
  */
22
24
  workerEntrypoints: string[];
25
+ /**
26
+ * Bindings whose RPC receiver lives in this worker, so this build instruments it. Not deduped by
27
+ * class, two bindings may point at the same class and both names have to be listed.
28
+ */
29
+ sameWorkerBindings: SameWorkerBinding[];
23
30
  }
24
31
  /**
25
32
  * Locate and resolve the wrangler configuration via wrangler's own
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/cloudflare",
3
- "version": "10.71.0",
3
+ "version": "10.73.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",
@@ -70,8 +70,8 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@opentelemetry/api": "^1.9.1",
73
- "@sentry/core": "10.71.0",
74
- "@sentry/server-utils": "10.71.0",
73
+ "@sentry/core": "10.73.0",
74
+ "@sentry/server-utils": "10.73.0",
75
75
  "magic-string": "~0.30.21"
76
76
  },
77
77
  "peerDependencies": {