Skip to content

Commit 41e496a

Browse files
authored
Merge 49cc6bb into 25f1ca4
2 parents 25f1ca4 + 49cc6bb commit 41e496a

File tree

443 files changed

+15430
-6311
lines changed

Some content is hidden

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

443 files changed

+15430
-6311
lines changed

.craft.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ targets:
3737
maven:io.sentry:sentry-android-core:
3838
maven:io.sentry:sentry-android-ndk:
3939
maven:io.sentry:sentry-android-timber:
40-
maven:io.sentry:sentry-android-okhttp:
4140
maven:io.sentry:sentry-kotlin-extensions:
4241
maven:io.sentry:sentry-android-fragment:
4342
maven:io.sentry:sentry-bom:

.github/ISSUE_TEMPLATE/bug_report_android.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ body:
1010
options:
1111
- sentry-android
1212
- sentry-android-ndk
13-
- sentry-android-okhttp
1413
- sentry-android-timber
1514
- sentry-android-fragment
1615
- sentry-android-sqlite
1716
- sentry-apollo
18-
- sentry-compose
1917
- sentry-apollo-3
18+
- sentry-compose
19+
- sentry-okhttp
2020
- other
2121
validations:
2222
required: true

.github/workflows/system-tests-backend.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
- name: Exclude android modules from build
4848
run: |
49-
sed -i -e '/.*"sentry-android-ndk",/d' -e '/.*"sentry-android",/d' -e '/.*"sentry-compose",/d' -e '/.*"sentry-android-core",/d' -e '/.*"sentry-android-fragment",/d' -e '/.*"sentry-android-navigation",/d' -e '/.*"sentry-android-okhttp",/d' -e '/.*"sentry-android-sqlite",/d' -e '/.*"sentry-android-timber",/d' -e '/.*"sentry-android-integration-tests:sentry-uitest-android-benchmark",/d' -e '/.*"sentry-android-integration-tests:sentry-uitest-android",/d' -e '/.*"sentry-android-integration-tests:test-app-sentry",/d' -e '/.*"sentry-samples:sentry-samples-android",/d' settings.gradle.kts
49+
sed -i -e '/.*"sentry-android-ndk",/d' -e '/.*"sentry-android",/d' -e '/.*"sentry-compose",/d' -e '/.*"sentry-android-core",/d' -e '/.*"sentry-android-fragment",/d' -e '/.*"sentry-android-navigation",/d' -e '/.*"sentry-android-sqlite",/d' -e '/.*"sentry-android-timber",/d' -e '/.*"sentry-android-integration-tests:sentry-uitest-android-benchmark",/d' -e '/.*"sentry-android-integration-tests:sentry-uitest-android",/d' -e '/.*"sentry-android-integration-tests:test-app-sentry",/d' -e '/.*"sentry-samples:sentry-samples-android",/d' settings.gradle.kts
5050
5151
- name: Exclude android modules from ignore list
5252
run: |

.github/workflows/update-deps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
native:
1414
uses: getsentry/github-workflows/.github/workflows/updater.yml@v2
1515
with:
16-
path: sentry-android-ndk/sentry-native
16+
path: scripts/update-sentry-native-ndk.sh
1717
name: Native SDK
1818
secrets:
1919
# If a custom token is used instead, a CI would be triggered on a created PR.

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +0,0 @@
1-
[submodule "sentry-android-ndk/sentry-native"]
2-
path = sentry-android-ndk/sentry-native
3-
url = https://github.com/getsentry/sentry-native

CHANGELOG.md

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,160 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Breaking Changes
6+
7+
- `sentry-android-okhttp` has been removed in favor of `sentry-okhttp`, removing android dependency from the module ([#3510](https://github.com/getsentry/sentry-java/pull/3510))
8+
9+
### Fixes
10+
11+
- Support spans that are split into multiple batches ([#3539](https://github.com/getsentry/sentry-java/pull/3539))
12+
- When spans belonging to a single transaction were split into multiple batches for SpanExporter, we did not add all spans because the isSpanTooOld check wasn't inverted.
13+
- Parse and use `send-default-pii` and `max-request-body-size` from `sentry.properties` ([#3534](https://github.com/getsentry/sentry-java/pull/3534))
14+
- `span.startChild` now uses `.makeCurrent()` by default ([#3544](https://github.com/getsentry/sentry-java/pull/3544))
15+
- This caused an issue where the span tree wasn't correct because some spans were not added to their direct parent
16+
- Partially fix bootstrap class loading ([#3543](https://github.com/getsentry/sentry-java/pull/3543))
17+
- There was a problem with two separate Sentry `Scopes` being active inside each OpenTelemetry `Context` due to using context keys from more than one class loader.
18+
19+
## 8.0.0-alpha.2
20+
21+
### Behavioural Changes
22+
23+
- (Android) The JNI layer for sentry-native has now been moved from sentry-java to sentry-native ([#3189](https://github.com/getsentry/sentry-java/pull/3189))
24+
- This now includes prefab support for sentry-native, allowing you to link and access the sentry-native API within your native app code
25+
- Checkout the `sentry-samples/sentry-samples-android` example on how to configure CMake and consume `sentry.h`
26+
27+
### Features
28+
29+
- Our `sentry-opentelemetry-agent` has been completely reworked and now plays nicely with the rest of the Java SDK
30+
- You may also want to give this new agent a try even if you haven't used OpenTelemetry (with Sentry) before. It offers support for [many more libraries and frameworks](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md), improving on our trace propagation, `Scopes` (used to be `Hub`) propagation as well as performance instrumentation (i.e. more spans).
31+
- If you are using a framework we did not support before and currently resort to manual instrumentation, please give the agent a try. See [here for a list of supported libraries, frameworks and application servers](https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md).
32+
- NOTE: Not all features have been implemented yet for the OpenTelemetry agent. Features of note that are not working yet:
33+
- Metrics
34+
- Measurements
35+
- `forceFinish` on transaction
36+
- `scheduleFinish` on transaction
37+
- see [#3436](https://github.com/getsentry/sentry-java/issues/3436) for a more up-to-date list of features we have (not) implemented
38+
- Please see "Installing `sentry-opentelemetry-agent`" for more details on how to set up the agent.
39+
- What's new about the Agent
40+
- When the OpenTelemetry Agent is used, Sentry API creates OpenTelemetry spans under the hood, handing back a wrapper object which bridges the gap between traditional Sentry API and OpenTelemetry. We might be replacing some of the Sentry performance API in the future.
41+
- This is achieved by configuring the SDK to use `OtelSpanFactory` instead of `DefaultSpanFactory` which is done automatically by the auto init of the Java Agent.
42+
- OpenTelemetry spans are now only turned into Sentry spans when they are finished so they can be sent to the Sentry server.
43+
- Now registers an OpenTelemetry `Sampler` which uses Sentry sampling configuration
44+
- Other Performance integrations automatically stop creating spans to avoid duplicate spans
45+
- The Sentry SDK now makes use of OpenTelemetry `Context` for storing Sentry `Scopes` (which is similar to what used to be called `Hub`) and thus relies on OpenTelemetry for `Context` propagation.
46+
- Classes used for the previous version of our OpenTelemetry support have been deprecated but can still be used manually. We're not planning to keep the old agent around in favor of less complexity in the SDK.
47+
- Add `ignoredSpanOrigins` option for ignoring spans coming from certain integrations
48+
- We pre-configure this to ignore Performance instrumentation for Spring and other integrations when using our OpenTelemetry Agent to avoid duplicate spans
49+
- Add data fetching environment hint to breadcrumb for GraphQL (#3413) ([#3431](https://github.com/getsentry/sentry-java/pull/3431))
50+
51+
### Fixes
52+
53+
- `TracesSampler` is now only created once in `SentryOptions` instead of creating a new one for every `Hub` (which is now `Scopes`). This means we're now creating fewer `SecureRandom` instances.
54+
- Move onFinishCallback before span or transaction is finished ([#3459](https://github.com/getsentry/sentry-java/pull/3459))
55+
- Add timestamp when a profile starts ([#3442](https://github.com/getsentry/sentry-java/pull/3442))
56+
- Move fragment auto span finish to onFragmentStarted ([#3424](https://github.com/getsentry/sentry-java/pull/3424))
57+
- Remove profiling timeout logic and disable profiling on API 21 ([#3478](https://github.com/getsentry/sentry-java/pull/3478))
58+
- Properly reset metric flush flag on metric emission ([#3493](https://github.com/getsentry/sentry-java/pull/3493))
59+
60+
### Migration Guide / Deprecations
61+
62+
- Classes used for the previous version of the Sentry OpenTelemetry Java Agent have been deprecated (`SentrySpanProcessor`, `SentryPropagator`, `OpenTelemetryLinkErrorEventProcessor`)
63+
- Sentry OpenTelemetry Java Agent has been reworked and now allows you to manually create spans using Sentry API as well.
64+
- Please see "Installing `sentry-opentelemetry-agent`" for more details on how to set up the agent.
65+
66+
### Installing `sentry-opentelemetry-agent`
67+
68+
#### Upgrading from a previous agent
69+
If you've been using the previous version of `sentry-opentelemetry-agent`, simply replace the agent JAR with the [latest release](https://central.sonatype.com/artifact/io.sentry/sentry-opentelemetry-agent?smo=true) and start your application. That should be it.
70+
71+
#### New to the agent
72+
If you've not been using OpenTelemetry before, you can add `sentry-opentelemetry-agent` to your setup by downloading the latest release and using it when starting up your application
73+
- `SENTRY_PROPERTIES_FILE=sentry.properties java -javaagent:sentry-opentelemetry-agent-x.x.x.jar -jar your-application.jar`
74+
- Please use `sentry.properties` or environment variables to configure the SDK as the agent is now in charge of initializing the SDK and options coming from things like logging integrations or our Spring Boot integration will not take effect.
75+
- You may find the [docs page](https://docs.sentry.io/platforms/java/tracing/instrumentation/opentelemetry/#using-sentry-opentelemetry-agent-with-auto-initialization) useful. While we haven't updated it yet to reflect the changes described here, the section about using the agent with auto init should still be valid.
76+
77+
If you want to skip auto initialization of the SDK performed by the agent, please follow the steps above and set the environment variable `SENTRY_AUTO_INIT` to `false` then add the following to your `Sentry.init`:
78+
79+
```
80+
Sentry.init(options -> {
81+
options.setDsn("https://[email protected]/1801383");
82+
OpenTelemetryUtil.applyOpenTelemetryOptions(options);
83+
...
84+
});
85+
```
86+
87+
If you're using our Spring (Boot) integration with auto init, use the following:
88+
```
89+
@Bean
90+
Sentry.OptionsConfiguration<SentryOptions> optionsConfiguration() {
91+
return (options) -> {
92+
OpenTelemetryUtil.applyOpenTelemetryOptions(options);
93+
};
94+
}
95+
```
96+
97+
### Dependencies
98+
99+
- Bump Native SDK from v0.7.0 to v0.7.5 ([#3441](https://github.com/getsentry/sentry-java/pull/3189))
100+
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#075)
101+
- [diff](https://github.com/getsentry/sentry-native/compare/0.7.0...0.7.5)
102+
103+
## 8.0.0-alpha.1
104+
105+
Version 8 of the Sentry Android/Java SDK brings a variety of features and fixes. The most notable changes are:
106+
107+
- New `Scope` types have been introduced, see "Behavioural Changes" for more details.
108+
- Lifecycle tokens have been introduced to manage `Scope` lifecycle, see "Behavioural Changes" for more details.
109+
- `Hub` has been replaced by `Scopes`
110+
111+
### Behavioural Changes
112+
113+
- We're introducing some new `Scope` types in the SDK, allowing for better control over what data is attached where. Previously there was a stack of scopes that was pushed and popped. Instead we now fork scopes for a given lifecycle and then restore the previous scopes. Since `Hub` is gone, it is also never cloned anymore. Separation of data now happens through the different scope types while making it easier to manipulate exactly what you need without having to attach data at the right time to have it apply where wanted.
114+
- Global scope is attached to all events created by the SDK. It can also be modified before `Sentry.init` has been called. It can be manipulated using `Sentry.configureScope(ScopeType.GLOBAL, (scope) -> { ... })`.
115+
- Isolation scope can be used e.g. to attach data to all events that come up while handling an incoming request. It can also be used for other isolation purposes. It can be manipulated using `Sentry.configureScope(ScopeType.ISOLATION, (scope) -> { ... })`. The SDK automatically forks isolation scope in certain cases like incoming requests, CRON jobs, Spring `@Async` and more.
116+
- Current scope is forked often and data added to it is only added to events that are created while this scope is active. Data is also passed on to newly forked child scopes but not to parents.
117+
- `Sentry.popScope` has been deprecated, please call `.close()` on the token returned by `Sentry.pushScope` instead or use it in a way described in more detail in "Migration Guide".
118+
- We have chosen a default scope that is used for `Sentry.configureScope()` as well as API like `Sentry.setTag()`
119+
- For Android the type defaults to `CURRENT` scope
120+
- For Backend and other JVM applicatons it defaults to `ISOLATION` scope
121+
- Event processors on `Scope` can now be ordered by overriding the `getOrder` method on implementations of `EventProcessor`. NOTE: This order only applies to event processors on `Scope` but not `SentryOptions` at the moment. Feel free to request this if you need it.
122+
- `Hub` is deprecated in favor of `Scopes`, alongside some `Hub` relevant APIs. More details can be found in the "Migration Guide" section.
123+
124+
### Breaking Changes
125+
126+
- `Contexts` no longer extends `ConcurrentHashMap`, instead we offer a selected set of methods.
127+
128+
### Migration Guide / Deprecations
129+
130+
- `Hub` has been deprecated, we're replacing the following:
131+
- `IHub` has been replaced by `IScopes`, however you should be able to simply pass `IHub` instances to code expecting `IScopes`, allowing for an easier migration.
132+
- `HubAdapter.getInstance()` has been replaced by `ScopesAdapter.getInstance()`
133+
- The `.clone()` method on `IHub`/`IScopes` has been deprecated, please use `.pushScope()` or `.pushIsolationScope()` instead
134+
- Some internal methods like `.getCurrentHub()` and `.setCurrentHub()` have also been replaced.
135+
- `Sentry.popScope` has been replaced by calling `.close()` on the token returned by `Sentry.pushScope()` and `Sentry.pushIsolationScope()`. The token can also be used in a `try` block like this:
136+
137+
```
138+
try (final @NotNull ISentryLifecycleToken ignored = Sentry.pushScope()) {
139+
// this block has its separate current scope
140+
}
141+
```
142+
143+
as well as:
144+
145+
146+
```
147+
try (final @NotNull ISentryLifecycleToken ignored = Sentry.pushIsolationScope()) {
148+
// this block has its separate isolation scope
149+
}
150+
```
151+
152+
You may also use `LifecycleHelper.close(token)`, e.g. in case you need to pass the token around for closing later.
153+
154+
### Features
155+
156+
- Report exceptions returned by Throwable.getSuppressed() to Sentry as exception groups ([#3396] https://github.com/getsentry/sentry-java/pull/3396)
157+
3158
## 7.11.0
4159

5160
### Features

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Sentry SDK for Java and Android
2121
| sentry-android | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android) | 19 |
2222
| sentry-android-core | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-core) | 19 |
2323
| sentry-android-ndk | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-ndk/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-ndk) | 19 |
24-
| sentry-android-okhttp | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-okhttp/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-okhttp) | 21 |
2524
| sentry-android-timber | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-timber/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-timber) | 19 |
2625
| sentry-android-fragment | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-fragment/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-fragment) | 19 |
2726
| sentry-android-navigation | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-navigation/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.sentry/sentry-android-navigation) | 19 |

build.gradle.kts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ buildscript {
3232
classpath(Config.QualityPlugins.errorpronePlugin)
3333
classpath(Config.QualityPlugins.gradleVersionsPlugin)
3434

35-
// add classpath of androidNativeBundle
36-
// com.ydq.android.gradle.build.tool:nativeBundle:{version}}
37-
classpath(Config.NativePlugins.nativeBundlePlugin)
38-
3935
// add classpath of sentry android gradle plugin
4036
// classpath("io.sentry:sentry-android-gradle-plugin:{version}")
4137

@@ -78,6 +74,7 @@ allprojects {
7874
repositories {
7975
google()
8076
mavenCentral()
77+
mavenLocal()
8178
}
8279
group = Config.Sentry.group
8380
version = properties[Config.Sentry.versionNameProp].toString()
@@ -99,7 +96,7 @@ allprojects {
9996
dependsOn("cleanTest")
10097
}
10198
withType<JavaCompile> {
102-
options.compilerArgs.addAll(arrayOf("-Xlint:all", "-Werror", "-Xlint:-classfile", "-Xlint:-processing"))
99+
options.compilerArgs.addAll(arrayOf("-Xlint:all", "-Werror", "-Xlint:-classfile", "-Xlint:-processing", "-Xlint:-try"))
103100
}
104101
}
105102
}
@@ -110,7 +107,6 @@ subprojects {
110107
"sentry-android-fragment",
111108
"sentry-android-navigation",
112109
"sentry-android-ndk",
113-
"sentry-android-okhttp",
114110
"sentry-android-sqlite",
115111
"sentry-android-timber"
116112
)
@@ -294,7 +290,6 @@ private val androidLibs = setOf(
294290
"sentry-android-ndk",
295291
"sentry-android-fragment",
296292
"sentry-android-navigation",
297-
"sentry-android-okhttp",
298293
"sentry-android-timber",
299294
"sentry-compose-android"
300295
)

buildSrc/src/main/java/Config.kt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ object Config {
151151
val apolloKotlin = "com.apollographql.apollo3:apollo-runtime:3.8.2"
152152

153153
object OpenTelemetry {
154-
val otelVersion = "1.33.0"
154+
val otelVersion = "1.39.0"
155155
val otelAlphaVersion = "$otelVersion-alpha"
156-
val otelJavaagentVersion = "1.32.0"
156+
val otelJavaagentVersion = "2.5.0"
157157
val otelJavaagentAlphaVersion = "$otelJavaagentVersion-alpha"
158158
val otelSemanticConvetionsVersion = "1.23.1-alpha"
159159

@@ -199,7 +199,9 @@ object Config {
199199
object QualityPlugins {
200200
object Jacoco {
201201
val version = "0.8.7"
202-
val minimumCoverage = BigDecimal.valueOf(0.6)
202+
203+
// TODO [POTEL] add tests and restore
204+
val minimumCoverage = BigDecimal.valueOf(0.1)
203205
}
204206
val spotless = "com.diffplug.spotless"
205207
val spotlessVersion = "6.11.0"
@@ -254,9 +256,4 @@ object Config {
254256
val errorprone = "com.google.errorprone:error_prone_core:2.11.0"
255257
val errorProneNullAway = "com.uber.nullaway:nullaway:0.9.5"
256258
}
257-
258-
object NativePlugins {
259-
val nativeBundlePlugin = "io.github.howardpang:androidNativeBundle:1.1.1"
260-
val nativeBundleExport = "com.ydq.android.gradle.native-aar.export"
261-
}
262259
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ android.useAndroidX=true
1010
android.defaults.buildfeatures.buildconfig=true
1111

1212
# Release information
13-
versionName=7.11.0
13+
versionName=8.0.0-alpha.2
1414

1515
# Override the SDK name on native crashes on Android
1616
sentryAndroidSdkName=sentry.native.android

0 commit comments

Comments
 (0)