docs(cli): Add code mappings documentation page#17196
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Unrelated Android session replay changes included in PR
- Removed the accidental Android session replay
beforeErrorSamplingdocs from both affected files and pushed a single focused commit.
- Removed the accidental Android session replay
Or push these changes by commenting:
@cursor push b8f666ce65
Preview (b8f666ce65)
diff --git a/docs/platforms/android/session-replay/configuration.mdx b/docs/platforms/android/session-replay/configuration.mdx
--- a/docs/platforms/android/session-replay/configuration.mdx
+++ b/docs/platforms/android/session-replay/configuration.mdx
@@ -29,7 +29,6 @@
| networkRequestHeaders | `io.sentry.session-replay.network-request-headers` | List<String> | `['Content-Type', 'Content-Length', 'Accept']` | Request header names to capture for enabled URLs. |
| networkResponseHeaders| `io.sentry.session-replay.network-response-headers` | List<String> | `['Content-Type', 'Content-Length', 'Accept']` | Response header names to capture for enabled URLs. |
| debug | `io.sentry.session-replay.debug` | boolean | `false` | Enables Session Replay debug logging, which prints diagnostic information when a replay is recorded. |
- | beforeErrorSampling | `—` | `BeforeErrorSamplingCallback` | `null` | A callback invoked before the `onErrorSampleRate` is checked. Return `false` to skip replay capture for this error, or `true` to proceed with the normal sample rate check. If the callback throws, replay capture proceeds normally (fail-open). Only configurable in code. See [Ignore Certain Errors from Error Sampling](/platforms/android/session-replay/#ignore-certain-errors-from-error-sampling). |
## Network Details
diff --git a/docs/platforms/android/session-replay/index.mdx b/docs/platforms/android/session-replay/index.mdx
--- a/docs/platforms/android/session-replay/index.mdx
+++ b/docs/platforms/android/session-replay/index.mdx
@@ -121,37 +121,6 @@
Sampling begins as soon as a session starts. `sessionSampleRate` is evaluated first. If it's sampled, the replay recording will begin. Otherwise, `onErrorSampleRate` is evaluated and if it's sampled, the integration will begin buffering the replay and will only upload it to Sentry if an error occurs. The remainder of the replay will behave similarly to a whole-session replay.
-### Ignore Certain Errors from Error Sampling
-
-Once you've enabled `onErrorSampleRate`, you can further customize which errors should trigger a replay capture by using the `beforeErrorSampling` callback. This is useful if you want to capture replays only for unhandled errors, or exclude certain error types from replay capture.
-
-The `beforeErrorSampling` callback is called when an error occurs and receives the event and hint as arguments. Returning `false` will prevent the replay from being captured for that specific error. If the callback throws an exception, replay capture proceeds normally (fail-open).
-
-```kotlin {tabTitle:Kotlin}
-SentryAndroid.init(context) { options ->
- options.dsn = "___PUBLIC_DSN___"
- options.sessionReplay.onErrorSampleRate = 1.0
-
- options.sessionReplay.beforeErrorSampling =
- SentryReplayOptions.BeforeErrorSamplingCallback { event, hint ->
- // Only capture replays for unhandled/crashed events
- event.isCrashed
- }
-}
-```
-
-```java {tabTitle:Java}
-SentryAndroid.init(context, options -> {
- options.setDsn("___PUBLIC_DSN___");
- options.getSessionReplay().setOnErrorSampleRate(1.0);
-
- options.getSessionReplay().setBeforeErrorSampling((event, hint) -> {
- // Only capture replays for unhandled/crashed events
- return event.isCrashed();
- });
-});
-```
-
## Privacy
The SDK is recording and aggressively masking all text, images, and webviews by default. If your app has any sensitive data, you should only turn the default masking off after explicitly masking out the sensitive data, using the APIs described below.This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Add a new CLI docs page for code mappings with upload command usage, JSON format, options, batching, and CI/CD integration. Also add backlinks from suspect commits, Java source context, and GitHub integration pages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
e37e221 to
6d06adb
Compare
| | `--repo` | Optional | The repository name (e.g. `getsentry/sentry`). Defaults to the git remote origin. Required if not running from within a git repository. | | ||
| | `--default-branch` | Optional | The default branch name. Defaults to the git remote HEAD or `main`. Required if not running from within a git repository. | | ||
|
|
||
| ### JSON File Format |
There was a problem hiding this comment.
Is there a standardized way to generate such files? If so, I think we should mention it.
There was a problem hiding this comment.
nope, not really. I was thinking to add a sentry.io/changelog entry where I'd provide an example snippet on how to do this in Gradle, but I could also add it here if you prefer. Although, the next step would be to do this automatically in the Sentry Gradle plugin so this would make the snippet redundant.
- Simplify command example to minimal invocation - Remove options table, point to --help instead - Remove batching, output, CI/CD, and stack trace root sections - Reorder JSON format (description first, then example) - Mention CI usage at the top instead of separate section - Keep code mappings mention in CLI index without link - Fix broken link in Java source context page Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
|
||
| Code mappings link stack trace paths to source code paths in your repository. They enable features like [source context](/platforms/java/source-context/), [suspect commits](/product/issues/suspect-commits/), [stack trace linking](/organization/integrations/source-code-mgmt/github/#stack-trace-linking), and [code owners](/product/issues/ownership-rules/). |
There was a problem hiding this comment.
| Code mappings link stack trace paths to source code paths in your repository. They enable features like [source context](/platforms/java/source-context/), [suspect commits](/product/issues/suspect-commits/), [stack trace linking](/organization/integrations/source-code-mgmt/github/#stack-trace-linking), and [code owners](/product/issues/ownership-rules/). | |
| _Available in version 3.3.4 of Sentry CLI_ | |
| Code mappings link stack trace paths to source code paths in your repository. They enable features like [source context](/platforms/java/source-context/), [suspect commits](/product/issues/suspect-commits/), [stack trace linking](/organization/integrations/source-code-mgmt/github/#stack-trace-linking), and [code owners](/product/issues/ownership-rules/). |
@szokeasaurusrex not sure if we should mention the min supported version here?


Summary
/cli/code-mappings/covering thesentry-cli code-mappings uploadcommandTest plan
/cli/code-mappings/🤖 Generated with Claude Code