Skip to content

Commit c66a26c

Browse files
authored
Merge branch 'main' into fix/silence-init-failed-warning-for-logger-integrations
2 parents c457bde + b6cfb57 commit c66a26c

File tree

30 files changed

+499
-46
lines changed

30 files changed

+499
-46
lines changed

.craft.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +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:
44+
maven:io.sentry:sentry-openfeature:
4545
maven:io.sentry:sentry-opentelemetry-agent:
4646
maven:io.sentry:sentry-opentelemetry-agentcustomization:
4747
maven:io.sentry:sentry-opentelemetry-agentless:
@@ -66,3 +66,4 @@ targets:
6666
maven:io.sentry:sentry-reactor:
6767
maven:io.sentry:sentry-ktor-client:
6868
maven:io.sentry:sentry-async-profiler:
69+
maven:io.sentry:sentry-spotlight:

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
3737

3838
- name: Initialize CodeQL
39-
uses: github/codeql-action/init@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # pin@v2
39+
uses: github/codeql-action/init@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # pin@v2
4040
with:
4141
languages: 'java'
4242

@@ -45,4 +45,4 @@ jobs:
4545
./gradlew buildForCodeQL --no-build-cache
4646
4747
- name: Perform CodeQL Analysis
48-
uses: github/codeql-action/analyze@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # pin@v2
48+
uses: github/codeql-action/analyze@45cbd0c69e560cd9e7cd7f8c32362050c9b7ded2 # pin@v2

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
fetch-depth: 0
3535
submodules: 'recursive'
3636
- name: Prepare release
37-
uses: getsentry/craft@beea4aba589c66381258cbd131c5551ae8245b82 # v2
37+
uses: getsentry/craft@63d1636bead951f6e034ed62c2a3610965fef010 # v2
3838
env:
3939
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
4040
with:

CHANGELOG.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Features
6+
7+
- Add `installGroupsOverride` parameter to Build Distribution SDK for programmatic filtering, with support for configuration via properties file using `io.sentry.distribution.install-groups-override` ([#5066](https://github.com/getsentry/sentry-java/pull/5066))
8+
9+
### Fixes
10+
11+
- When merging tombstones with Native SDK, use the tombstone message if the Native SDK didn't explicitly provide one. ([#5095](https://github.com/getsentry/sentry-java/pull/5095))
12+
- Fix thread leak caused by eager creation of `SentryExecutorService` in `SentryOptions` ([#5093](https://github.com/getsentry/sentry-java/pull/5093))
13+
- There were cases where we created options that ended up unused but we failed to clean those up.
14+
15+
### Dependencies
16+
17+
- Bump Native SDK from v0.12.4 to v0.12.6 ([#5071](https://github.com/getsentry/sentry-java/pull/5071))
18+
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0126)
19+
- [diff](https://github.com/getsentry/sentry-native/compare/0.12.4...0.12.6)
20+
21+
### Internal
22+
23+
- Add integration to track session replay custom masking ([#5070](https://github.com/getsentry/sentry-java/pull/5070))
24+
325
## 8.32.0
426

527
### Features
628

7-
- Add `installGroupsOverride` parameter and `installGroups` property to Build Distribution SDK ([#5062](https://github.com/getsentry/sentry-java/pull/5062))
29+
- Add `installGroups` property to Build Distribution SDK ([#5062](https://github.com/getsentry/sentry-java/pull/5062))
830
- Update Android targetSdk to API 36 (Android 16) ([#5016](https://github.com/getsentry/sentry-java/pull/5016))
931
- Add AndroidManifest support for Spotlight configuration via `io.sentry.spotlight.enable` and `io.sentry.spotlight.url` ([#5064](https://github.com/getsentry/sentry-java/pull/5064))
1032
- Collect database transaction spans (`BEGIN`, `COMMIT`, `ROLLBACK`) ([#5072](https://github.com/getsentry/sentry-java/pull/5072))

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ Sentry SDK for Java and Android
6767
| sentry-opentelemetry-core | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-opentelemetry-core?style=for-the-badge&logo=sentry&color=green) |
6868
| sentry-okhttp | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-okhttp?style=for-the-badge&logo=sentry&color=green) |
6969
| sentry-reactor | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-reactor?style=for-the-badge&logo=sentry&color=green) |
70+
| sentry-spotlight | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-spotlight?style=for-the-badge&logo=sentry&color=green) |
7071

7172
# Releases
7273

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ quartz = { module = "org.quartz-scheduler:quartz", version = "2.3.0" }
149149
reactor-core = { module = "io.projectreactor:reactor-core", version = "3.5.3" }
150150
retrofit = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" }
151151
retrofit-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit" }
152-
sentry-native-ndk = { module = "io.sentry:sentry-native-ndk", version = "0.12.4" }
152+
sentry-native-ndk = { module = "io.sentry:sentry-native-ndk", version = "0.12.6" }
153153
servlet-api = { module = "javax.servlet:javax.servlet-api", version = "3.1.0" }
154154
servlet-jakarta-api = { module = "jakarta.servlet:jakarta.servlet-api", version = "6.1.0" }
155155
slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }

sentry-android-core/api/sentry-android-core.api

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public final class io/sentry/android/core/ActivityLifecycleIntegration : android
4141
}
4242

4343
public class io/sentry/android/core/AndroidContinuousProfiler : io/sentry/IContinuousProfiler, io/sentry/transport/RateLimiter$IRateLimitObserver {
44-
public fun <init> (Lio/sentry/android/core/BuildInfoProvider;Lio/sentry/android/core/internal/util/SentryFrameMetricsCollector;Lio/sentry/ILogger;Ljava/lang/String;ILio/sentry/ISentryExecutorService;)V
44+
public fun <init> (Lio/sentry/android/core/BuildInfoProvider;Lio/sentry/android/core/internal/util/SentryFrameMetricsCollector;Lio/sentry/ILogger;Ljava/lang/String;ILio/sentry/util/LazyEvaluator$Evaluator;)V
4545
public fun close (Z)V
4646
public fun getChunkId ()Lio/sentry/protocol/SentryId;
4747
public fun getProfilerId ()Lio/sentry/protocol/SentryId;
@@ -114,7 +114,7 @@ public final class io/sentry/android/core/AndroidMetricsBatchProcessorFactory :
114114

115115
public class io/sentry/android/core/AndroidProfiler {
116116
protected final field lock Lio/sentry/util/AutoClosableReentrantLock;
117-
public fun <init> (Ljava/lang/String;ILio/sentry/android/core/internal/util/SentryFrameMetricsCollector;Lio/sentry/ISentryExecutorService;Lio/sentry/ILogger;)V
117+
public fun <init> (Ljava/lang/String;ILio/sentry/android/core/internal/util/SentryFrameMetricsCollector;Lio/sentry/util/LazyEvaluator$Evaluator;Lio/sentry/ILogger;)V
118118
public fun close ()V
119119
public fun endAndCollect (ZLjava/util/List;)Lio/sentry/android/core/AndroidProfiler$ProfileEndData;
120120
public fun start ()Lio/sentry/android/core/AndroidProfiler$ProfileStartData;

sentry-android-core/src/main/java/io/sentry/android/core/AndroidContinuousProfiler.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import io.sentry.protocol.SentryId;
2727
import io.sentry.transport.RateLimiter;
2828
import io.sentry.util.AutoClosableReentrantLock;
29+
import io.sentry.util.LazyEvaluator;
2930
import io.sentry.util.SentryRandom;
3031
import java.util.ArrayList;
3132
import java.util.List;
@@ -45,7 +46,7 @@ public class AndroidContinuousProfiler
4546
private final @NotNull ILogger logger;
4647
private final @Nullable String profilingTracesDirPath;
4748
private final int profilingTracesHz;
48-
private final @NotNull ISentryExecutorService executorService;
49+
private final @NotNull LazyEvaluator.Evaluator<ISentryExecutorService> executorServiceSupplier;
4950
private final @NotNull BuildInfoProvider buildInfoProvider;
5051
private boolean isInitialized = false;
5152
private final @NotNull SentryFrameMetricsCollector frameMetricsCollector;
@@ -73,13 +74,13 @@ public AndroidContinuousProfiler(
7374
final @NotNull ILogger logger,
7475
final @Nullable String profilingTracesDirPath,
7576
final int profilingTracesHz,
76-
final @NotNull ISentryExecutorService executorService) {
77+
final @NotNull LazyEvaluator.Evaluator<ISentryExecutorService> executorServiceSupplier) {
7778
this.logger = logger;
7879
this.frameMetricsCollector = frameMetricsCollector;
7980
this.buildInfoProvider = buildInfoProvider;
8081
this.profilingTracesDirPath = profilingTracesDirPath;
8182
this.profilingTracesHz = profilingTracesHz;
82-
this.executorService = executorService;
83+
this.executorServiceSupplier = executorServiceSupplier;
8384
}
8485

8586
private void init() {
@@ -222,7 +223,8 @@ private void start() {
222223
}
223224

224225
try {
225-
stopFuture = executorService.schedule(() -> stop(true), MAX_CHUNK_DURATION_MILLIS);
226+
stopFuture =
227+
executorServiceSupplier.evaluate().schedule(() -> stop(true), MAX_CHUNK_DURATION_MILLIS);
226228
} catch (RejectedExecutionException e) {
227229
logger.log(
228230
SentryLevel.ERROR,

sentry-android-core/src/main/java/io/sentry/android/core/AndroidOptionsInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ private static void setupProfiler(
343343
options.getLogger(),
344344
options.getProfilingTracesDirPath(),
345345
options.getProfilingTracesHz(),
346-
options.getExecutorService()));
346+
() -> options.getExecutorService()));
347347
}
348348
}
349349
}

sentry-android-core/src/main/java/io/sentry/android/core/AndroidProfiler.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import io.sentry.profilemeasurements.ProfileMeasurement;
1717
import io.sentry.profilemeasurements.ProfileMeasurementValue;
1818
import io.sentry.util.AutoClosableReentrantLock;
19+
import io.sentry.util.LazyEvaluator;
1920
import io.sentry.util.Objects;
2021
import java.io.File;
2122
import java.util.ArrayDeque;
@@ -92,7 +93,8 @@ public ProfileEndData(
9293
private final @NotNull ArrayDeque<ProfileMeasurementValue> frozenFrameRenderMeasurements =
9394
new ArrayDeque<>();
9495
private final @NotNull Map<String, ProfileMeasurement> measurementsMap = new HashMap<>();
95-
private final @Nullable ISentryExecutorService timeoutExecutorService;
96+
private final @Nullable LazyEvaluator.Evaluator<ISentryExecutorService>
97+
timeoutExecutorServiceSupplier;
9698
private final @NotNull ILogger logger;
9799
private volatile boolean isRunning = false;
98100
protected final @NotNull AutoClosableReentrantLock lock = new AutoClosableReentrantLock();
@@ -101,14 +103,15 @@ public AndroidProfiler(
101103
final @NotNull String tracesFilesDirPath,
102104
final int intervalUs,
103105
final @NotNull SentryFrameMetricsCollector frameMetricsCollector,
104-
final @Nullable ISentryExecutorService timeoutExecutorService,
106+
final @Nullable LazyEvaluator.Evaluator<ISentryExecutorService>
107+
timeoutExecutorServiceSupplier,
105108
final @NotNull ILogger logger) {
106109
this.traceFilesDir =
107110
new File(Objects.requireNonNull(tracesFilesDirPath, "TracesFilesDirPath is required"));
108111
this.intervalUs = intervalUs;
109112
this.logger = Objects.requireNonNull(logger, "Logger is required");
110113
// Timeout executor is nullable, as timeouts will not be there for continuous profiling
111-
this.timeoutExecutorService = timeoutExecutorService;
114+
this.timeoutExecutorServiceSupplier = timeoutExecutorServiceSupplier;
112115
this.frameMetricsCollector =
113116
Objects.requireNonNull(frameMetricsCollector, "SentryFrameMetricsCollector is required");
114117
}
@@ -185,10 +188,11 @@ public void onFrameMetricCollected(
185188

186189
// We stop profiling after a timeout to avoid huge profiles to be sent
187190
try {
188-
if (timeoutExecutorService != null) {
191+
if (timeoutExecutorServiceSupplier != null) {
189192
scheduledFinish =
190-
timeoutExecutorService.schedule(
191-
() -> endAndCollect(true, null), PROFILING_TIMEOUT_MILLIS);
193+
timeoutExecutorServiceSupplier
194+
.evaluate()
195+
.schedule(() -> endAndCollect(true, null), PROFILING_TIMEOUT_MILLIS);
192196
}
193197
} catch (RejectedExecutionException e) {
194198
logger.log(

0 commit comments

Comments
 (0)