Skip to content

Commit 7448805

Browse files
authored
Merge branch 'main' into feat/android-app-lifecycle-log-flushing
2 parents 04d209c + fc5ccaf commit 7448805

File tree

250 files changed

+9074
-2906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

250 files changed

+9074
-2906
lines changed

.craft.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ targets:
4141
maven:io.sentry:sentry-android-fragment:
4242
maven:io.sentry:sentry-bom:
4343
maven:io.sentry:sentry-openfeign:
44+
#maven:io.sentry:sentry-openfeature:
4445
maven:io.sentry:sentry-opentelemetry-agent:
4546
maven:io.sentry:sentry-opentelemetry-agentcustomization:
4647
maven:io.sentry:sentry-opentelemetry-agentless:
@@ -64,3 +65,4 @@ targets:
6465
maven:io.sentry:sentry-apollo-4:
6566
maven:io.sentry:sentry-reactor:
6667
maven:io.sentry:sentry-ktor-client:
68+
maven:io.sentry:sentry-async-profiler:

.cursor/rules/feature_flags.mdc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
alwaysApply: false
3+
description: Feature Flags
4+
---
5+
# Java SDK Feature Flags
6+
7+
There is a scope based and a span based API for tracking feature flag evaluations.
8+
9+
## Scope Based API
10+
11+
The `addFeatureFlag` method can be used to track feature flag evaluations. It exists on `Sentry` static API as well as `IScopes` and `IScope`.
12+
13+
The `maxFeatureFlags` option controls how many flags are tracked per scope and also how many are sent to Sentry as part of events.
14+
Scope based feature flags can also be disabled by setting the value to 0. Defaults to 100 feature flag evaluations.
15+
16+
Order of feature flag evaluations is important as we only keep track of the last {maxFeatureFlag} items.
17+
18+
When a feature flag evluation with the same name is added, the previous one is removed and the new one is stored so that it'll be dropped last.
19+
20+
When sending out an error event, feature flag buffers from all three scope types (global, isolation and current scope) are merged, chosing the newest {maxFeatureFlag} entries across all scope types. Feature flags are sent as part of the `flags` context.
21+
22+
## Span Based API
23+
24+
tbd

.cursor/rules/overview_dev.mdc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ Use the `fetch_rules` tool to include these rules when working on specific areas
3434
- Rate limiting, cache rotation
3535
- Android vs JVM caching differences
3636

37+
- **`feature_flags`**: Use when working with:
38+
- Feature flag tracking and evaluation
39+
- `addFeatureFlag()`, `getFeatureFlags()` methods
40+
- `FeatureFlagBuffer`, `FeatureFlag` protocol
41+
- `maxFeatureFlags` option and buffer management
42+
- Feature flag merging across scope types
43+
- Scope-based vs span-based feature flag APIs
44+
3745
### Integration & Infrastructure
3846
- **`opentelemetry`**: Use when working with:
3947
- OpenTelemetry modules (`sentry-opentelemetry-*`)
@@ -63,3 +71,4 @@ Use the `fetch_rules` tool to include these rules when working on specific areas
6371
- new module/integration/sample → `new_module`
6472
- Cache/offline/network → `offline`
6573
- System test/e2e/sample → `e2e_tests`
74+
- Feature flag/addFeatureFlag/flag evaluation → `feature_flags`

.github/ISSUE_TEMPLATE/bug_report_android.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ body:
1616
- sentry-apollo
1717
- sentry-apollo-3
1818
- sentry-compose
19+
- sentry-launchdarkly-android
1920
- sentry-okhttp
2021
- other
2122
validations:

.github/ISSUE_TEMPLATE/bug_report_java.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ body:
3535
- sentry-graphql-22
3636
- sentry-quartz
3737
- sentry-openfeign
38+
- sentry-openfeature
39+
- sentry-launchdarkly-server
3840
- sentry-apache-http-client-5
3941
- sentry-okhttp
4042
- sentry-reactor

.github/workflows/agp-matrix.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060

6161
- name: Create AVD and generate snapshot for caching
6262
if: steps.avd-cache.outputs.cache-hit != 'true'
63-
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # pin@v2
63+
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # pin@v2
6464
with:
6565
api-level: 30
6666
target: aosp_atd
@@ -79,7 +79,7 @@ jobs:
7979

8080
# We tried to use the cache action to cache gradle stuff, but it made tests slower and timeout
8181
- name: Run instrumentation tests
82-
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # pin@v2
82+
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # pin@v2
8383
with:
8484
api-level: 30
8585
target: aosp_atd

.github/workflows/generate-javadocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: |
2727
./gradlew aggregateJavadocs
2828
- name: Deploy
29-
uses: JamesIves/github-pages-deploy-action@6c2d9db40f9296374acc17b90404b6e8864128c8 # pin@4.7.3
29+
uses: JamesIves/github-pages-deploy-action@4a3abc783e1a24aeb44c16e869ad83caf6b4cc23 # pin@4.7.4
3030
with:
3131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3232
BRANCH: gh-pages

.github/workflows/integration-tests-ui-critical.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696

9797
- name: Create AVD and generate snapshot for caching
9898
if: steps.avd-cache.outputs.cache-hit != 'true'
99-
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # pin@v2
99+
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # pin@v2
100100
with:
101101
api-level: ${{ matrix.api-level }}
102102
target: ${{ matrix.target }}
@@ -120,7 +120,7 @@ jobs:
120120
version: ${{env.MAESTRO_VERSION}}
121121

122122
- name: Run tests
123-
uses: reactivecircus/android-emulator-runner@1dcd0090116d15e7c562f8db72807de5e036a4ed # pin@v2.34.0
123+
uses: reactivecircus/android-emulator-runner@b530d96654c385303d652368551fb075bc2f0b6b # pin@v2.35.0
124124
with:
125125
api-level: ${{ matrix.api-level }}
126126
target: ${{ matrix.target }}

.github/workflows/spring-boot-4-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
springboot-version: [ '4.0.0-M1', '4.0.0-M2', '4.0.0-M3' ]
22+
springboot-version: [ '4.0.0' ]
2323

2424
name: Spring Boot ${{ matrix.springboot-version }}
2525
env:

CHANGELOG.md

Lines changed: 120 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,142 @@
22

33
## Unreleased
44

5+
### Features
6+
7+
- Add option to capture additional OkHttp network request/response details in session replays ([#4919](https://github.com/getsentry/sentry-java/pull/4919))
8+
- Depends on `SentryOkHttpInterceptor` to intercept the request and extract request/response bodies
9+
- To enable, add url regexes via the `io.sentry.session-replay.network-detail-allow-urls` metadata tag in AndroidManifest ([code sample](https://github.com/getsentry/sentry-java/blob/b03edbb1b0d8b871c62a09bc02cbd8a4e1f6fea1/sentry-samples/sentry-samples-android/src/main/AndroidManifest.xml#L196-L205))
10+
- Or you can manually specify SentryReplayOptions via `SentryAndroid#init`:
11+
_(Make sure you disable the auto init via manifest meta-data: io.sentry.auto-init=false)_
12+
13+
<details>
14+
<summary>Kotlin</summary>
15+
16+
```kotlin
17+
SentryAndroid.init(
18+
this,
19+
options -> {
20+
// options.dsn = "https://examplePublicKey@o0.ingest.sentry.io/0"
21+
// options.sessionReplay.sessionSampleRate = 1.0
22+
// options.sessionReplay.onErrorSampleRate = 1.0
23+
// ..
24+
25+
options.sessionReplay.networkDetailAllowUrls = listOf(".*")
26+
options.sessionReplay.networkDetailDenyUrls = listOf(".*deny.*")
27+
options.sessionReplay.networkRequestHeaders = listOf("Authorization", "X-Custom-Header", "X-Test-Request")
28+
options.sessionReplay.networkResponseHeaders = listOf("X-Response-Time", "X-Cache-Status", "X-Test-Response")
29+
});
30+
```
31+
32+
</details>
33+
34+
<details>
35+
<summary>Java</summary>
36+
37+
```java
38+
SentryAndroid.init(
39+
this,
40+
options -> {
41+
options.getSessionReplay().setNetworkDetailAllowUrls(Arrays.asList(".*"));
42+
options.getSessionReplay().setNetworkDetailDenyUrls(Arrays.asList(".*deny.*"));
43+
options.getSessionReplay().setNetworkRequestHeaders(
44+
Arrays.asList("Authorization", "X-Custom-Header", "X-Test-Request"));
45+
options.getSessionReplay().setNetworkResponseHeaders(
46+
Arrays.asList("X-Response-Time", "X-Cache-Status", "X-Test-Response"));
47+
});
48+
49+
```
50+
51+
</details>
52+
- Android: Flush logs when app enters background ([#4873](https://github.com/getsentry/sentry-java/pull/4873))
53+
54+
55+
### Improvements
56+
57+
- Avoid forking `rootScopes` for Reactor if current thread has `NoOpScopes` ([#4793](https://github.com/getsentry/sentry-java/pull/4793))
58+
- This reduces the SDKs overhead by avoiding unnecessary scope forks
59+
60+
### Fixes
61+
62+
- Fix missing thread stacks for ANRv1 events ([#4918](https://github.com/getsentry/sentry-java/pull/4918))
63+
64+
### Internal
65+
66+
- Support `span` envelope item type ([#4935](https://github.com/getsentry/sentry-java/pull/4935))
67+
68+
## 8.27.1
69+
70+
### Fixes
71+
72+
- Do not log if `sentry.properties` in rundir has not been found ([#4929](https://github.com/getsentry/sentry-java/pull/4929))
73+
74+
## 8.27.0
75+
76+
### Features
77+
78+
- Implement OpenFeature Integration that tracks Feature Flag evaluations ([#4910](https://github.com/getsentry/sentry-java/pull/4910))
79+
- To make use of it, add the `sentry-openfeature` dependency and register the the hook using: `openFeatureApiInstance.addHooks(new SentryOpenFeatureHook());`
80+
- Implement LaunchDarkly Integrations that track Feature Flag evaluations ([#4917](https://github.com/getsentry/sentry-java/pull/4917))
81+
- For Android, please add `sentry-launchdarkly-android` as a dependency and register the `SentryLaunchDarklyAndroidHook`
82+
- For Server / JVM, please add `sentry-launchdarkly-server` as a dependency and register the `SentryLaunchDarklyServerHook`
83+
- Detect oversized events and reduce their size ([#4903](https://github.com/getsentry/sentry-java/pull/4903))
84+
- You can opt into this new behaviour by setting `enableEventSizeLimiting` to `true` (`sentry.enable-event-size-limiting=true` for Spring Boot `application.properties`)
85+
- You may optionally register an `onOversizedEvent` callback to implement custom logic that is executed in case an oversized event is detected
86+
- This is executed first and if event size was reduced sufficiently, no further truncation is performed
87+
- In case we detect an oversized event, we first drop breadcrumbs and if that isn't sufficient we also drop stack frames in order to get an events size down
88+
89+
### Improvements
90+
91+
- Do not send manual log origin ([#4897](https://github.com/getsentry/sentry-java/pull/4897))
92+
93+
### Dependencies
94+
95+
- Bump Spring Boot 4 to GA ([#4923](https://github.com/getsentry/sentry-java/pull/4923))
96+
97+
## 8.26.0
98+
99+
### Features
100+
101+
- Add feature flags API ([#4812](https://github.com/getsentry/sentry-java/pull/4812)) and ([#4831](https://github.com/getsentry/sentry-java/pull/4831))
102+
- You may now keep track of your feature flag evaluations and have them show up in Sentry.
103+
- Top level API (`Sentry.addFeatureFlag("my-feature-flag", true);`) writes to scopes and the current span (if there is one)
104+
- It is also possible to use API on `IScope`, `IScopes`, `ISpan` and `ITransaction` directly
105+
- Feature flag evaluations tracked on scope(s) will be added to any errors reported to Sentry.
106+
- The SDK keeps the latest 100 evaluations from scope(s), replacing old entries as new evaluations are added.
107+
- For feature flag evaluations tracked on spans:
108+
- Only 10 evaluations are tracked per span, existing flags are updated but new ones exceeding the limit are ignored
109+
- Spans do not inherit evaluations from their parent
110+
- Drop log events once buffer hits hard limit ([#4889](https://github.com/getsentry/sentry-java/pull/4889))
111+
- If we have 1000 log events queued up, we drop any new logs coming in to prevent OOM
112+
- Remove vendored code and upgrade to async profiler 4.2 ([#4856](https://github.com/getsentry/sentry-java/pull/4856))
113+
- This adds support for JDK 23+
114+
5115
### Fixes
6116

7117
- Removed SentryExecutorService limit for delayed scheduled tasks ([#4846](https://github.com/getsentry/sentry-java/pull/4846))
8118
- Fix visual artifacts for the Canvas strategy on some devices ([#4861](https://github.com/getsentry/sentry-java/pull/4861))
119+
- [Config] Trim whitespace on properties path ([#4880](https://github.com/getsentry/sentry-java/pull/4880))
120+
- Only set `DefaultReplayBreadcrumbConverter` if replay is available ([#4888](https://github.com/getsentry/sentry-java/pull/4888))
121+
- Session Replay: Cache connection status instead of using blocking calls ([#4891](https://github.com/getsentry/sentry-java/pull/4891))
122+
- Fix log count in client reports ([#4869](https://github.com/getsentry/sentry-java/pull/4869))
123+
- Fix profilerId propagation ([#4833](https://github.com/getsentry/sentry-java/pull/4833))
124+
- Fix profiling init for Spring and Spring Boot w Agent auto-init ([#4815](https://github.com/getsentry/sentry-java/pull/4815))
125+
- Copy active span on scope clone ([#4878](https://github.com/getsentry/sentry-java/pull/4878))
9126

10127
### Improvements
11128

12129
- Fallback to distinct-id as user.id logging attribute when user is not set ([#4847](https://github.com/getsentry/sentry-java/pull/4847))
13130
- Report Timber.tag() as `timber.tag` log attribute ([#4845](https://github.com/getsentry/sentry-java/pull/4845))
14131
- Session Replay: Add screenshot strategy serialization to RRWeb events ([#4851](https://github.com/getsentry/sentry-java/pull/4851))
15-
- Android: Flush log when app enters background ([#4873](https://github.com/getsentry/sentry-java/pull/4873))
132+
- Report discarded log bytes ([#4871](https://github.com/getsentry/sentry-java/pull/4871))
133+
- Log why a properties file was not loaded ([#4879](https://github.com/getsentry/sentry-java/pull/4879))
16134

17135
### Dependencies
18136

19137
- Bump Native SDK from v0.11.3 to v0.12.1 ([#4859](https://github.com/getsentry/sentry-java/pull/4859))
20138
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0121)
21139
- [diff](https://github.com/getsentry/sentry-native/compare/0.11.3...0.12.1)
140+
- Bump Spring Boot 4 to RC2 ([#4886](https://github.com/getsentry/sentry-java/pull/4886))
22141

23142
## 8.25.0
24143

0 commit comments

Comments
 (0)