Skip to content

Commit 38382a6

Browse files
chore(native): cleanup (#15063)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR Cleans up some small mistakes/inaccuracies/typos in the native docs ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Tightens Native docs accuracy, updates API examples (boolean usage and sampler signature), adjusts logs minimum version, and cleans formatting. > > - **Native docs**: > - **Options**: Clarify `release` sourcing (remove browser-specific note); update `before-send` to return `sentry_value_new_null()`; link `enable-logs` to `/platforms/native/logs`. > - **Logs**: Lower minimum supported SDK to `0.11.1`; update C examples to use `1` instead of `true`. > - **Performance/Tracing**: Update `traces_sampler_callback` signature to include `void *user_data` in examples. > - **Breadcrumbs**: Tweak documented keys list (simplify `timestamp` note). > - **Signal handling**: Minor formatting/whitespace fixes and remove stray code fence; tidy `SIGXFSZ` bullet. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit be80c5b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 5c38c9d commit 38382a6

File tree

8 files changed

+14
-16
lines changed

8 files changed

+14
-16
lines changed

docs/platforms/native/advanced-usage/signal-handling/index.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This document provides guidance on signal handling in the Native SDK. If you'd l
1212
* The [Signal (IPC) Wikipedia article](https://en.wikipedia.org/wiki/Signal_(IPC)) provides an overview of signals and describes many POSIX signals.
1313
* The [glibc-docs](https://www.gnu.org/software/libc/manual/html_node/Signal-Handling.html) and [the man pages](https://man7.org/linux/man-pages/man7/signal.7.html) offer reference details for the signal vocabulary.
1414
* If you want a book-length treatment, we recommend chapters 20-22 of Michael Kerrisk's [The Linux Programming Interface](https://man7.org/tlpi/).
15-
15+
1616
## Signal Handling Conflicts
1717

1818
Sentry's Native SDK comes with its own set of signal handlers. There may be conflicts if your application currently installs handlers for any [signals of interest](#signals-of-interest) (listed below) that can result in a crash. To avoid this, do the following:
@@ -38,15 +38,15 @@ If you use the `crashpad` backend, in addition to the above, on Linux, you will
3838
* `SIGSYS`: The kernel received a system call with an invalid argument.
3939
* `SIGEMT`: An emulator trap occurred.
4040
* `SIGXCPU`: The process exceeded a previously specified CPU [rlimit](https://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html).
41-
* `SIGXFSZ`: Raised when a process grows a file beyond a maximum allowed size ([`RLIMIT_FSIZE`](https://man7.org/linux/man-pages/man2/getrlimit.2.html)).
41+
* `SIGXFSZ`: Raised when a process grows a file beyond a maximum allowed size ([`RLIMIT_FSIZE`](https://man7.org/linux/man-pages/man2/getrlimit.2.html)).
4242

4343
## What to Consider When Writing `on_crash` Hooks
4444

4545
The callback that you register as an `on_crash` hook runs in the context of a signal handler. (`before_send` also runs in the context of a signal handler, unless you turned it off for crashes.)
4646

47-
Since signal handlers can interrupt the running process (and even each other) at any time, take special care when writing them.
47+
Since signal handlers can interrupt the running process (and even each other) at any time, take special care when writing them.
4848

49-
Our developer documentation provides [guidelines for writing signal handlers](https://develop.sentry.dev/sdk/signal-handlers/). If you run on Linux or Android, these guidelines also apply to hooks. Signal handlers are notoriously difficult to work with, so it is crucial to follow these guidelines in order to avoid causing severe faults (like crashes and deadlocks), which can prevent terminating programs and sending reports.```
49+
Our developer documentation provides [guidelines for writing signal handlers](https://develop.sentry.dev/sdk/signal-handlers/). If you run on Linux or Android, these guidelines also apply to hooks. Signal handlers are notoriously difficult to work with, so it is crucial to follow these guidelines in order to avoid causing severe faults (like crashes and deadlocks), which can prevent terminating programs and sending reports.
5050

5151
## Stack Size in the Signal Handler
5252

docs/platforms/native/common/configuration/options.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ Options that can be read from an environment variable (`SENTRY_DSN`, `SENTRY_ENV
1414

1515
The DSN tells the SDK where to send the events. If this value is not provided, the SDK will try to read it from the `SENTRY_DSN` environment variable. If that variable also does not exist, the SDK will just not send any events.
1616

17-
In runtimes without a process environment (such as the browser) that fallback does not apply.
18-
1917
Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-utilization).
2018

2119
</ConfigKey>
@@ -34,9 +32,9 @@ Turns debug mode on or off. If `debug` is enabled, the SDK will attempt to print
3432

3533
<ConfigKey name="release">
3634

37-
Sets the release. Some SDKs will try to automatically configure a release out of the box but it's a better idea to manually set it to guarantee that the release is in sync with your deploy integrations or source map uploads. Release names are strings, but some formats are detected by Sentry and might be rendered differently. Learn more about how to send release data so Sentry can tell you about regressions between releases and identify the potential source in [the releases documentation](/product/releases/) or the <SandboxLink scenario="releases">sandbox</SandboxLink>.
35+
Sets the release. Release names are strings, but some formats are detected by Sentry and might be rendered differently. Learn more about how to send release data so Sentry can tell you about regressions between releases and identify the potential source in [the releases documentation](/product/releases/) or the <SandboxLink scenario="releases">sandbox</SandboxLink>.
3836

39-
By default the SDK will try to read this value from the `SENTRY_RELEASE` environment variable (in the browser SDK, this will be read off of the `window.SENTRY_RELEASE.id` if available).
37+
By default the SDK will try to read this value from the `SENTRY_RELEASE` environment variable.
4038

4139
</ConfigKey>
4240

@@ -72,7 +70,7 @@ These options can be used to hook the SDK in various ways to customize the repor
7270

7371
<ConfigKey name="before-send">
7472

75-
This function is called with an SDK-specific message or error event object, and can return a modified event object, or `null` to skip reporting the event. This can be used, for instance, for manual PII stripping before sending.
73+
This function is called with an SDK-specific message or error event object, and can return a modified event object, or `sentry_value_new_null()` to skip reporting the event. This can be used, for instance, for manual PII stripping before sending.
7674

7775
By the time <PlatformIdentifier name="before-send" /> is executed, all scope data has already been applied to the event. Further modification of the scope won't have any effect.
7876

@@ -108,7 +106,7 @@ A function responsible for determining the percentage chance a given transaction
108106

109107
<ConfigKey name="enable-logs">
110108

111-
This option enables the logging integration, which allows the SDK to capture logs and send them to Sentry. This is disabled by default.
109+
This option enables the [logging integration](/platforms/native/logs), which allows the SDK to capture logs and send them to Sentry. This is disabled by default.
112110

113111
</ConfigKey>
114112

docs/platforms/native/common/enriching-events/breadcrumbs/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ Manually record a breadcrumb:
2626

2727
<PlatformContent includePath="enriching-events/breadcrumbs/breadcrumbs-example" />
2828

29-
The available breadcrumb keys are `type`, `category`, `message`, `level`, `timestamp` (which many SDKs will set automatically for you), and `data`, which is the place to put any additional information you'd like the breadcrumb to include. Using keys other than these six won't cause an error, but will result in the data being dropped when the event is processed by Sentry.
29+
The available breadcrumb keys are `type`, `category`, `message`, `level`, `timestamp`, and `data`, which is the place to put any additional information you'd like the breadcrumb to include. Using keys other than these six won't cause an error, but will result in the data being dropped when the event is processed by Sentry.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
```c
2-
sentry_options_set_attach_screenshot(options, true);
2+
sentry_options_set_attach_screenshot(options, 1);
33
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Logs for Native are supported in Sentry Native SDK version `0.12.0` and above.
1+
Logs for Native are supported in Sentry Native SDK version [0.11.1](https://github.com/getsentry/sentry-native/releases/tag/0.11.1) and above.

platform-includes/logs/setup/native.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ To enable logging, you need to initialize the SDK with the `enable_logs` option
22

33
```c
44
sentry_options_t *options = sentry_options_new();
5-
sentry_options_set_enable_logs(options, true);
5+
sentry_options_set_enable_logs(options, 1);
66
// set other options
77
sentry_init(options);
88
```

platform-includes/performance/always-inherit-sampling-decision/native.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
static double
55
traces_sampler_callback(const sentry_transaction_context_t *transaction_ctx,
6-
sentry_value_t custom_sampling_ctx, const int *parent_sampled)
6+
sentry_value_t custom_sampling_ctx, const int *parent_sampled, void *user_data)
77
{
88
if (parent_sampled != NULL) {
99
return *parent_sampled; // inherit sampling decision

platform-includes/performance/traces-sampler-as-sampler/native.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
```c
22
static double
33
traces_sampler_callback(const sentry_transaction_context_t *transaction_ctx,
4-
sentry_value_t custom_sampling_ctx, const int *parent_sampled)
4+
sentry_value_t custom_sampling_ctx, const int *parent_sampled, void *user_data)
55
{
66
// check if there was a parent sampling decision
77
if (parent_sampled != NULL) {

0 commit comments

Comments
 (0)