Skip to content

Commit 7a04ad6

Browse files
authored
Handle NoOpScopes in Context when starting a span through OpenTelemetry (#4823)
* Treat NoOpScopes same as null in OtelSentrySpanProcessor * changelog * reset latest changelog entries to unreleased
1 parent d5a29b6 commit 7a04ad6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

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

3-
## 8.24.0-alpha.2
3+
## Unreleased
44

55
### Features
66

@@ -37,6 +37,8 @@
3737
- Session Replay: Avoid deadlock when pausing replay if no connection ([#4788](https://github.com/getsentry/sentry-java/pull/4788))
3838
- Session Replay: Fix capturing roots with no windows ([#4805](https://github.com/getsentry/sentry-java/pull/4805))
3939
- Session Replay: Fix `java.lang.IllegalArgumentException: width and height must be > 0` ([#4805](https://github.com/getsentry/sentry-java/pull/4805))
40+
- Handle `NoOpScopes` in `Context` when starting a span through OpenTelemetry ([#4823](https://github.com/getsentry/sentry-java/pull/4823))
41+
- This fixes "java.lang.IllegalArgumentException: The DSN is required" when combining WebFlux and OpenTelemetry
4042
- Session Replay: Do not use recycled screenshots for masking ([#4790](https://github.com/getsentry/sentry-java/pull/4790))
4143
- This fixes native crashes seen in `Canvas.<init>`/`ScreenshotRecorder.capture`
4244

sentry-opentelemetry/sentry-opentelemetry-core/src/main/java/io/sentry/opentelemetry/OtelSentrySpanProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public void onStart(final @NotNull Context parentContext, final @NotNull ReadWri
125125

126126
private IScopes forkScopes(final @NotNull Context context, final @NotNull SpanData span) {
127127
final @Nullable IScopes scopesFromContext = context.get(SENTRY_SCOPES_KEY);
128-
if (scopesFromContext == null) {
128+
if (scopesFromContext == null || scopesFromContext.isNoOp()) {
129129
return Sentry.forkedRootScopes("spanprocessor.new");
130130
}
131131
if (isRootSpan(span)) {

0 commit comments

Comments
 (0)