Skip to content

Commit ca82680

Browse files
authored
Merge 2537a27 into 25f1ca4
2 parents 25f1ca4 + 2537a27 commit ca82680

File tree

451 files changed

+15554
-6536
lines changed

Some content is hidden

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

451 files changed

+15554
-6536
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: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,172 @@
11
# Changelog
22

3+
## 8.0.0-alpha.4
4+
5+
### Fixes
6+
7+
- Removed user segment ([#3512](https://github.com/getsentry/sentry-java/pull/3512))
8+
- Use span id of remote parent ([#3548](https://github.com/getsentry/sentry-java/pull/3548))
9+
- Traces were broken because on an incoming request, OtelSentrySpanProcessor did not set the parentSpanId on the span correctly. Traces were not referencing the actual parent span but some other (random) span ID which the server doesn't know.
10+
- Attach active span to scope when using OpenTelemetry ([#3549](https://github.com/getsentry/sentry-java/pull/3549))
11+
- Errors weren't linked to traces correctly due to parts of the SDK not knowing the current span
12+
- Record dropped spans in client report when sampling out OpenTelemetry spans ([#3552](https://github.com/getsentry/sentry-java/pull/3552))
13+
- Retrieve the correct current span from `Scope`/`Scopes` when using OpenTelemetry ([#3554](https://github.com/getsentry/sentry-java/pull/3554))
14+
15+
## 8.0.0-alpha.3
16+
17+
### Breaking Changes
18+
19+
- `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))
20+
21+
### Fixes
22+
23+
- Support spans that are split into multiple batches ([#3539](https://github.com/getsentry/sentry-java/pull/3539))
24+
- 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.
25+
- Parse and use `send-default-pii` and `max-request-body-size` from `sentry.properties` ([#3534](https://github.com/getsentry/sentry-java/pull/3534))
26+
- `span.startChild` now uses `.makeCurrent()` by default ([#3544](https://github.com/getsentry/sentry-java/pull/3544))
27+
- This caused an issue where the span tree wasn't correct because some spans were not added to their direct parent
28+
- Partially fix bootstrap class loading ([#3543](https://github.com/getsentry/sentry-java/pull/3543))
29+
- 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.
30+
31+
## 8.0.0-alpha.2
32+
33+
### Behavioural Changes
34+
35+
- (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))
36+
- This now includes prefab support for sentry-native, allowing you to link and access the sentry-native API within your native app code
37+
- Checkout the `sentry-samples/sentry-samples-android` example on how to configure CMake and consume `sentry.h`
38+
39+
### Features
40+
41+
- Our `sentry-opentelemetry-agent` has been completely reworked and now plays nicely with the rest of the Java SDK
42+
- 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).
43+
- 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).
44+
- NOTE: Not all features have been implemented yet for the OpenTelemetry agent. Features of note that are not working yet:
45+
- Metrics
46+
- Measurements
47+
- `forceFinish` on transaction
48+
- `scheduleFinish` on transaction
49+
- see [#3436](https://github.com/getsentry/sentry-java/issues/3436) for a more up-to-date list of features we have (not) implemented
50+
- Please see "Installing `sentry-opentelemetry-agent`" for more details on how to set up the agent.
51+
- What's new about the Agent
52+
- 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.
53+
- 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.
54+
- OpenTelemetry spans are now only turned into Sentry spans when they are finished so they can be sent to the Sentry server.
55+
- Now registers an OpenTelemetry `Sampler` which uses Sentry sampling configuration
56+
- Other Performance integrations automatically stop creating spans to avoid duplicate spans
57+
- 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.
58+
- 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.
59+
- Add `ignoredSpanOrigins` option for ignoring spans coming from certain integrations
60+
- We pre-configure this to ignore Performance instrumentation for Spring and other integrations when using our OpenTelemetry Agent to avoid duplicate spans
61+
- Add data fetching environment hint to breadcrumb for GraphQL (#3413) ([#3431](https://github.com/getsentry/sentry-java/pull/3431))
62+
63+
### Fixes
64+
65+
- `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.
66+
- Move onFinishCallback before span or transaction is finished ([#3459](https://github.com/getsentry/sentry-java/pull/3459))
67+
- Add timestamp when a profile starts ([#3442](https://github.com/getsentry/sentry-java/pull/3442))
68+
- Move fragment auto span finish to onFragmentStarted ([#3424](https://github.com/getsentry/sentry-java/pull/3424))
69+
- Remove profiling timeout logic and disable profiling on API 21 ([#3478](https://github.com/getsentry/sentry-java/pull/3478))
70+
- Properly reset metric flush flag on metric emission ([#3493](https://github.com/getsentry/sentry-java/pull/3493))
71+
72+
### Migration Guide / Deprecations
73+
74+
- Classes used for the previous version of the Sentry OpenTelemetry Java Agent have been deprecated (`SentrySpanProcessor`, `SentryPropagator`, `OpenTelemetryLinkErrorEventProcessor`)
75+
- Sentry OpenTelemetry Java Agent has been reworked and now allows you to manually create spans using Sentry API as well.
76+
- Please see "Installing `sentry-opentelemetry-agent`" for more details on how to set up the agent.
77+
78+
### Installing `sentry-opentelemetry-agent`
79+
80+
#### Upgrading from a previous agent
81+
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.
82+
83+
#### New to the agent
84+
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
85+
- `SENTRY_PROPERTIES_FILE=sentry.properties java -javaagent:sentry-opentelemetry-agent-x.x.x.jar -jar your-application.jar`
86+
- 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.
87+
- 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.
88+
89+
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`:
90+
91+
```
92+
Sentry.init(options -> {
93+
options.setDsn("https://[email protected]/1801383");
94+
OpenTelemetryUtil.applyOpenTelemetryOptions(options);
95+
...
96+
});
97+
```
98+
99+
If you're using our Spring (Boot) integration with auto init, use the following:
100+
```
101+
@Bean
102+
Sentry.OptionsConfiguration<SentryOptions> optionsConfiguration() {
103+
return (options) -> {
104+
OpenTelemetryUtil.applyOpenTelemetryOptions(options);
105+
};
106+
}
107+
```
108+
109+
### Dependencies
110+
111+
- Bump Native SDK from v0.7.0 to v0.7.5 ([#3441](https://github.com/getsentry/sentry-java/pull/3189))
112+
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#075)
113+
- [diff](https://github.com/getsentry/sentry-native/compare/0.7.0...0.7.5)
114+
115+
## 8.0.0-alpha.1
116+
117+
Version 8 of the Sentry Android/Java SDK brings a variety of features and fixes. The most notable changes are:
118+
119+
- New `Scope` types have been introduced, see "Behavioural Changes" for more details.
120+
- Lifecycle tokens have been introduced to manage `Scope` lifecycle, see "Behavioural Changes" for more details.
121+
- `Hub` has been replaced by `Scopes`
122+
123+
### Behavioural Changes
124+
125+
- 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.
126+
- 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) -> { ... })`.
127+
- 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.
128+
- 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.
129+
- `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".
130+
- We have chosen a default scope that is used for `Sentry.configureScope()` as well as API like `Sentry.setTag()`
131+
- For Android the type defaults to `CURRENT` scope
132+
- For Backend and other JVM applicatons it defaults to `ISOLATION` scope
133+
- 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.
134+
- `Hub` is deprecated in favor of `Scopes`, alongside some `Hub` relevant APIs. More details can be found in the "Migration Guide" section.
135+
136+
### Breaking Changes
137+
138+
- `Contexts` no longer extends `ConcurrentHashMap`, instead we offer a selected set of methods.
139+
140+
### Migration Guide / Deprecations
141+
142+
- `Hub` has been deprecated, we're replacing the following:
143+
- `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.
144+
- `HubAdapter.getInstance()` has been replaced by `ScopesAdapter.getInstance()`
145+
- The `.clone()` method on `IHub`/`IScopes` has been deprecated, please use `.pushScope()` or `.pushIsolationScope()` instead
146+
- Some internal methods like `.getCurrentHub()` and `.setCurrentHub()` have also been replaced.
147+
- `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:
148+
149+
```
150+
try (final @NotNull ISentryLifecycleToken ignored = Sentry.pushScope()) {
151+
// this block has its separate current scope
152+
}
153+
```
154+
155+
as well as:
156+
157+
158+
```
159+
try (final @NotNull ISentryLifecycleToken ignored = Sentry.pushIsolationScope()) {
160+
// this block has its separate isolation scope
161+
}
162+
```
163+
164+
You may also use `LifecycleHelper.close(token)`, e.g. in case you need to pass the token around for closing later.
165+
166+
### Features
167+
168+
- Report exceptions returned by Throwable.getSuppressed() to Sentry as exception groups ([#3396] https://github.com/getsentry/sentry-java/pull/3396)
169+
3170
## 7.11.0
4171

5172
### 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
)

0 commit comments

Comments
 (0)