Skip to content

Commit 84f0274

Browse files
romtsnclaude
andcommitted
docs: add changelog entry for beforeErrorSampling callback
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d091f74 commit 84f0274

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Features
6+
7+
- Add `beforeErrorSampling` callback to Session Replay ([#5214](https://github.com/getsentry/sentry-java/pull/5214))
8+
- Allows filtering which errors trigger replay capture before the `onErrorSampleRate` is checked
9+
- Returning `false` skips replay capture entirely for that error; returning `true` proceeds with the normal sample rate check
10+
- Example usage:
11+
```java
12+
SentryAndroid.init(context) { options ->
13+
options.sessionReplay.beforeErrorSampling =
14+
SentryReplayOptions.BeforeErrorSamplingCallback { event, hint ->
15+
// Skip replay for handled exceptions
16+
val dominated = event.exceptions?.lastOrNull()
17+
val isHandled = dominated?.mechanism?.isHandled == true
18+
!isHandled
19+
}
20+
}
21+
```
22+
323
## 8.36.0
424

525
### Features

0 commit comments

Comments
 (0)