Skip to content

Commit d5132d9

Browse files
committed
Add changelog entry
1 parent 744193f commit d5132d9

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,37 @@
44

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

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+
738
## 10.5.0
839

940
- feat(core): better cause data extraction ([#17375](https://github.com/getsentry/sentry-javascript/pull/17375))

0 commit comments

Comments
 (0)