Skip to content

Commit a5c8fa8

Browse files
authored
Merge branch 'master' into sentry-otel-exporter
2 parents 14ffc53 + 69ec2ae commit a5c8fa8

File tree

30 files changed

+539
-849
lines changed

30 files changed

+539
-849
lines changed

AGENTS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,12 @@ When writing requirements in `develop-docs/`:
6363
This document uses key words such as "MUST", "SHOULD", and "MAY" as defined in [RFC 2119](https://www.ietf.org/rfc/rfc2119.txt) to indicate requirement levels.
6464
</Alert>
6565
```
66+
67+
## Plan Mode
68+
69+
- Make the plan extremely concise. Sacrifice grammar for the sake of concision.
70+
- At the end of each plan, give me a list of unresolved questions to answer, if any.
71+
72+
## Pull Request generation
73+
74+
Use .github/PULL_REQUEST_TEMPLATE.md and add Co-Authored-By: Claude

develop-docs/sdk/processes/releases.mdx

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ Nice!
8585
This file is used to trigger the release from the GitHub UI.
8686

8787
You'll notice it uses `vars.SENTRY_RELEASE_BOT_CLIENT_ID` and `secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY` -- these should be
88-
available to your repository automatically!
88+
available to your repository automatically! These are needed because
89+
[GitHub prevents `GITHUB_TOKEN` from triggering downstream workflows](https://docs.github.com/en/actions/reference/events-that-trigger-workflows),
90+
which is required for creating publish request issues in `getsentry/publish`.
8991

9092
```yaml
9193
name: Release
@@ -95,7 +97,7 @@ on:
9597
inputs:
9698
version:
9799
description: Version to release
98-
required: true
100+
required: false
99101
force:
100102
description: Force a release even when there are release-blockers (optional)
101103
required: false
@@ -111,28 +113,29 @@ jobs:
111113
with:
112114
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
113115
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
114-
- uses: actions/checkout@v3
116+
- uses: actions/checkout@v6
115117
with:
116118
token: ${{ steps.token.outputs.token }}
117119
fetch-depth: 0
118120
- name: Prepare release
119-
uses: getsentry/action-prepare-release@v1
121+
uses: getsentry/craft@v2
120122
env:
121123
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
122124
with:
123125
version: ${{ github.event.inputs.version }}
124126
force: ${{ github.event.inputs.force }}
125127
```
126128

129+
For full details on all available options including auto-versioning, changelog preview,
130+
and more, see [Craft's GitHub Actions documentation](https://craft.sentry.dev/github-actions/).
131+
If your repository is outside the `getsentry` organization, you can use the simpler
132+
[reusable workflow](https://craft.sentry.dev/github-actions/#option-1-reusable-workflow-recommended)
133+
which handles token management automatically via `secrets: inherit`.
134+
127135
### Commit + PR
128136

129137
**Commit those three files and make a pull request.**
130138

131-
Here's [an example PR] and the [follow-up to fix `fetch-depth`].
132-
133-
[an example PR]: https://github.com/getsentry/uwsgi-dogstatsd-plugin/pull/2
134-
[follow-up to fix `fetch-depth`]: https://github.com/getsentry/uwsgi-dogstatsd-plugin/pull/3
135-
136139
## Setting Up Permissions
137140

138141
Give the following teams access to your repository:
@@ -158,6 +161,37 @@ add a label to.
158161

159162
[issue in `publish`]: https://github.com/getsentry/publish/issues
160163

164+
## Calendar Versioning (CalVer)
165+
166+
To enable calendar versioning for your SDK, add the following to your `.craft.yml`:
167+
168+
```yaml
169+
versioning:
170+
policy: calver
171+
calver:
172+
format: "%y.%-m" # e.g., 24.12 for December 2024
173+
offset: 14 # Days to look back for date calculation (optional)
174+
```
175+
176+
See the [Craft CalVer documentation](https://craft.sentry.dev/configuration/#calendar-versioning-calver) for more details.
177+
178+
## Merge Target
179+
180+
By default, all releases are merged to the default branch of your repository (usually `main`). To override this, pass the `merge_target` input in your release workflow:
181+
182+
```yaml
183+
- name: Prepare release
184+
uses: getsentry/craft@v2
185+
env:
186+
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
187+
with:
188+
version: ${{ github.event.inputs.version }}
189+
merge_target: ${{ github.event.inputs.merge_target }}
190+
```
191+
192+
Make sure to also add a `merge_target` input to your workflow's `workflow_dispatch.inputs` block.
193+
The same input is available in the [reusable workflow](https://craft.sentry.dev/github-actions/#option-1-reusable-workflow-recommended) as well.
194+
161195
## Version name conventions
162196

163197
To keep versioning consistent across SDKs, we generally follow [semantic versioning (semver)](https://semver.org/), with language- or platform-specific conventions around semver (if applicable).
@@ -227,7 +261,7 @@ You can opt your repo into using the config from a specific merge target branch
227261

228262
### 1. Release Preparation:
229263

230-
Add `craft_config_from_merge_target: true` when calling `getsentry/action-prepare-release` in your repo's release workflow:
264+
Add `craft_config_from_merge_target: true` when calling `getsentry/craft` in your repo's release workflow:
231265

232266
```yml
233267
# ...
@@ -238,12 +272,14 @@ jobs:
238272
steps:
239273
# ...
240274
- name: Prepare release
241-
uses: getsentry/action-prepare-release@v1
275+
uses: getsentry/craft@v2
242276
with:
243277
# ...
244278
craft_config_from_merge_target: true
245279
```
246280

281+
This input is also available in the [reusable workflow](https://craft.sentry.dev/github-actions/#option-1-reusable-workflow-recommended).
282+
247283
### 2. Publish Configuration
248284

249285
Add the branch(es) you want to take the config from to the `publish.yml` workflow in `getsentry/publish`:

develop-docs/sdk/telemetry/metrics.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ By default the SDK should attach the following attributes to a metric:
393393

394394
#### User Attributes
395395

396-
SDKs may optionally attach user information as attributes (guarded by `sendDefaultPii`):
396+
SDKs may optionally attach user information as attributes (guarded by `sendDefaultPii` [unless manually set by user](/sdk/expected-features/data-handling/#sensitive-data)):
397397

398398
1. `user.id`: The user ID. Maps to `id` in the [User](/sdk/data-model/event-payloads/user/) payload.
399399
2. `user.name`: The username. Maps to `username` in the [User](/sdk/data-model/event-payloads/user/) payload.

develop-docs/self-hosted/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ We recommend using 32 GB RAM, but it works with 16 GB RAM + 16 GB swap as well.
4141

4242
Depending on your traffic volume, you may want to increase your system specification to handle increased load. Although most of the times, this is not the case for self-hosted Sentry, since no matter how small or big the traffic is, you will most likely hover around the same used resources.
4343

44-
If increasing the disk storage space isn't possible, you can migrate your storage to use external storage such as AWS S3 or Google Cloud Storage (GCS). Decreasing your `SENTRY_RETENTION_DAYS` environment variable to lower numbers will save some storage space from being full, at the cost of having shorter data retention period. See [Event Retention](/self-hosted/configuration#event-retention) section.
44+
If increasing the disk storage space isn't possible, you can migrate your storage to use external storage such as AWS S3 or Google Cloud Storage (GCS). Decreasing your `SENTRY_EVENT_RETENTION_DAYS` environment variable to lower numbers will save some storage space from being full, at the cost of having shorter data retention period. See [Event Retention](/self-hosted/configuration#event-retention) section.
4545

4646
Below is a breakdown of self-hosted Sentry installation compatibility with various Linux distributions:
4747
* **Debian/Ubuntu-based** distros are preferred; most users succeed with them, and they're used on Sentry's dogfood instance.
326 KB
Loading
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: Android Native Crash Reporting (Tombstones)
3+
sidebar_order: 2
4+
description: Learn how to configure Tombstone support.
5+
---
6+
7+
The Tombstone Integration generates events for native crashes based on data ("tombstones") that Android attaches to [`ApplicationExitInfo.REASON_CRASH_NATIVE`](https://developer.android.com/reference/android/app/ApplicationExitInfo#REASON_CRASH_NATIVE) starting with [Android 12+](https://developer.android.com/reference/android/app/ApplicationExitInfo#getTraceInputStream()).
8+
9+
This crash context is collected by the operating system during the app’s shutdown after a crash. Because part of the collection runs out of process, it can capture richer crash details than the [NDK integration](/platforms/android/configuration/using-ndk/) and also is safer.
10+
11+
In particular, you will get:
12+
13+
* stack-traces for each of the threads in your process (which on Android is often key to understanding crashes)
14+
* improved stack traces through Android Runtime stack frames
15+
* client-side symbolication of all system libraries (while still allowing for server-side symbolication of your binaries to keep app size small)
16+
* safer crash context collection reduces crashes during crash handling
17+
* potentially smaller artifacts since the Tombstone Integration is part of `android-core` (if you [don't need the NDK integration](/platforms/android/configuration/using-ndk/#using-the-sdk-without-the-ndk) as a fallback)
18+
19+
Keep in mind that the Tombstone Integration is not a full replacement for the NDK integration:
20+
21+
* it only works on devices running Android 12+
22+
* if you instrument your native code with the NDK integration already, then Tombstones will only improve native crash reports, you still need the NDK integration for capturing native context
23+
24+
However, if you don't develop native code for your apps, but use packages that have native code and a significant portion of your users runs on Android 12+, then the Tombstone Integration can be a replacement.
25+
26+
![Tombstone Thread Stack Trace](./img/tombstone_stacktrace.png)
27+
28+
#### Enabling the Tombstone Integration
29+
30+
The Tombstone Integration is disabled by default. You can enable the tombstone integration using:
31+
32+
```xml {filename:AndroidManifest.xml}
33+
<application>
34+
<meta-data android:name="io.sentry.tombstone.enable" android:value="true" />
35+
</application>
36+
```
37+
38+
#### Merging Tombstone and NDK Crash Events
39+
40+
It generally makes sense run the [NDK integration](/platforms/android/configuration/using-ndk/) (`io.sentry.ndk.enable`) and the Tombstone integration at the same time:
41+
42+
* if you have users on devices < Android 12 (in which case the NDK integration will solely be reporting native crashes)
43+
* if you use functions of the Native SDK from your native code and want your collected context to be reflected in the crash reports
44+
45+
The reports from both integrations will be merged on the client into a single report, which will later be enriched. This means that whenever the Android version allows it, you will get improved crash reporting from tombstones; otherwise, the SDK falls back to the best-effort implementation from the NDK integration. In both cases, the Native SDK context is preserved in the final report.
46+
47+
#### Tombstone Mechanisms
48+
49+
We introduced two new mechanisms to help identify the integration from which reports originate:
50+
51+
* A report originating only from a tombstone will be called `Tombstone`
52+
* A report being a merged result from a tombstone and a Native SDK event will be called `TombstoneMerged`
53+
* A report originating solely from the NDK integration (Native SDK) will continue to be called `signalhandler`
54+
55+
#### Symbolication
56+
57+
As mentioned above, Android infrastructure will try to symbolicate as much as possible on the client side. This is particularly important for system and framework symbols, since they can differ considerably across devices. If symbols cannot be resolved on the client - for instance, for your supplied binaries - the [backend symbolication](/platforms/android/configuration/using-ndk/#symbolicate-stack-traces) process follows the same rules as with the NDK integration.
58+
59+
#### Debug Images
60+
61+
In contrast to NDK integration, Tombstones retrieve module memory mappings at the time of the crash and are thus always up-to-date. If you use the NDK integration as a fallback for older Android versions, you still need to clear the module cache when dynamically loading libraries after app initialization.
62+
63+
#### Historical Tombstones
64+
65+
By default, the SDK only reports and enriches the latest Tombstones. However, there's also a `setReportHistoricalTombstones` option available in `SentryOptions`, which enables the SDK to report all Tombstones from the [getHistoricalExitReasons](<https://developer.android.com/reference/android/app/ActivityManager?hl=en#getHistoricalProcessExitReasons(java.lang.String,%20int,%20int)>) list:
66+
67+
```kotlin
68+
SentryAndroid.init(context) { options ->
69+
options.isReportHistoricalTombstones = true
70+
}
71+
```
72+
73+
```java
74+
SentryAndroid.init(context) { options ->
75+
options.setReportHistoricalTombstones(true)
76+
}
77+
```
78+
79+
This option is useful after upgrading to an SDK version that introduces the Tombstone integration, as it allows you to report any tombstones that occurred before the update.
80+
81+
It can also make sense if you get recurring reports of native crashes early during app start, or if your app regularly runs and restarts during longer offline periods.
82+
83+
Other than that, the SDK will always pick up the latest Tombstone from the historical exit reasons list on the next app restart, and there won’t be any historical Tombstones to report. Also keep in mind that historical Tombstones will receive only minimal updates, as the available data is likely out of sync.
84+
85+
#### Interaction with other Options
86+
87+
Similar to ANR, for Tombstone derived events the options `attachThreads` and `attachStacktrace` are currently without effect.

docs/platforms/android/configuration/using-ndk.mdx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ NDK integration is packed with the SDK. The package `sentry-android-ndk` works b
1010

1111
You can [disable the NDK integration](#disable-ndk-integration), or use our Sentry Android SDK [without the NDK](#using-the-sdk-without-the-ndk).
1212

13+
<Alert>
14+
15+
Starting with Sentry Android SDK version 8.32.0 you can enable the [Tombstone Integration](/platforms/android/configuration/tombstones/) as a replacement or extension to the NDK integration.
16+
17+
</Alert>
18+
1319
## Symbolicate Stack Traces
1420

1521
To symbolicate the stack trace from native code, we need to have access to the debug symbols of your application.
@@ -123,7 +129,7 @@ sentry_clear_modulecache();
123129
```
124130

125131
```kotlin
126-
// 1. Manually initialize the SDK,
132+
// 1. Manually initialize the SDK,
127133
// in order to keep a reference to the SDK options
128134
var optionsRef: SentryAndroidOptions? = null
129135
SentryAndroid.init(this) { options ->

docs/platforms/javascript/guides/capacitor/index.mdx

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,10 @@ Sentry.init(
298298
dist: "<dist>",
299299
// ___PRODUCT_OPTION_START___ logs
300300
// Logs requires @sentry/capacitor 2.0.0 or newer.
301-
_experiments: {
302-
enableLogs: true,
303-
beforeSendLog: (log) => {
304-
// Add custom filters to logs.
305-
return log;
306-
}
301+
enableLogs: true,
302+
beforeSendLog: (log) => {
303+
// Add custom filters to logs.
304+
return log;
307305
},
308306
// ___PRODUCT_OPTION_END___ logs
309307
integrations: [
@@ -361,8 +359,16 @@ const app = createApp(App)
361359

362360
Sentry.init(
363361
{
364-
app,
365362
dsn: "___PUBLIC_DSN___",
363+
364+
// Vue specific settings.
365+
siblingOptions: {
366+
vueOptions: {
367+
app: app,
368+
attachErrorHandler: false,
369+
attachProps: true,
370+
},
371+
},
366372

367373
// Adds request headers and IP for users, for more info visit:
368374
// https://docs.sentry.io/platforms/javascript/guides/capacitor/configuration/options/#sendDefaultPii
@@ -374,12 +380,10 @@ Sentry.init(
374380
dist: "<dist>",
375381
// ___PRODUCT_OPTION_START___ logs
376382
// Logs requires @sentry/capacitor 2.0.0 or newer.
377-
_experiments: {
378-
enableLogs: true,
379-
beforeSendLog: (log) => {
380-
// Add custom filters to logs.
381-
return log;
382-
}
383+
enableLogs: true,
384+
beforeSendLog: (log) => {
385+
// Add custom filters to logs.
386+
return log;
383387
},
384388
// ___PRODUCT_OPTION_END___ logs
385389
integrations: [
@@ -436,7 +440,6 @@ import * as SentryNuxt from "@sentry/nuxt";
436440
Sentry.init(
437441
{
438442
dsn: "___PUBLIC_DSN___",
439-
440443
// Adds request headers and IP for users, for more info visit:
441444
// https://docs.sentry.io/platforms/javascript/guides/capacitor/configuration/options/#sendDefaultPii
442445
sendDefaultPii: true,
@@ -447,12 +450,10 @@ Sentry.init(
447450
dist: "<dist>",
448451
// ___PRODUCT_OPTION_START___ logs
449452
// Logs requires @sentry/capacitor 2.0.0 or newer.
450-
_experiments: {
451-
enableLogs: true,
452-
beforeSendLog: (log) => {
453-
// Add custom filters to logs.
454-
return log;
455-
}
453+
enableLogs: true,
454+
beforeSendLog: (log) => {
455+
// Add custom filters to logs.
456+
return log;
456457
},
457458
// ___PRODUCT_OPTION_END___ logs
458459
integrations: [

0 commit comments

Comments
 (0)