Skip to content

Commit adcd67d

Browse files
committed
Add changelog entry
1 parent 878052c commit adcd67d

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

CHANGELOG.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,38 @@
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66

7-
Work in this release was contributed by @Karibash. Thank you for your contribution!
7+
### Important Changes
8+
9+
- feat(cloudflare): Add `instrumentPrototypeMethods` option to instrument RPC methods for DurableObjects ([#17424](https://github.com/getsentry/sentry-javascript/pull/17424))
10+
11+
By default, `Sentry.instrumentDurableObjectWithSentry` will not wrap any RPC methods on the prototype. To enable wrapping for RPC methods, set `instrumentPrototypeMethods` to `true` or a list of methods you want to instrument:
12+
13+
```js
14+
class MyDurableObjectBase extends DurableObject<Env> {
15+
method1() {
16+
// ...
17+
}
18+
19+
method2() {
20+
// ...
21+
}
22+
23+
method3() {
24+
// ...
25+
}
26+
}
27+
// Export your named class as defined in your wrangler config
28+
export const MyDurableObject = Sentry.instrumentDurableObjectWithSentry(
29+
(env: Env) => ({
30+
dsn: "https://ac49b7af3017c458bd12dab9b3328bfc@o4508482761982032.ingest.de.sentry.io/4508482780987481",
31+
tracesSampleRate: 1.0,
32+
instrumentPrototypeMethods: ['method1', 'method3'],
33+
}),
34+
MyDurableObjectBase,
35+
);
36+
```
37+
38+
Work in this release was contributed by @Karibash. Thank you for your contribution!
839

940
## 10.5.0
1041

0 commit comments

Comments
 (0)