Skip to content

Commit

Permalink
POTEL 30 - span.startChild now uses .makeCurrent() by default (#3544
Browse files Browse the repository at this point in the history
)

* Partially fix class loading into bootstrap classloader

* startChild span now makes the child span the current span by default

* changelog
  • Loading branch information
adinauer authored Jul 3, 2024
1 parent afff380 commit 49cc6bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
- Support spans that are split into multiple batches ([#3539](https://github.com/getsentry/sentry-java/pull/3539))
- 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.
- Parse and use `send-default-pii` and `max-request-body-size` from `sentry.properties` ([#3534](https://github.com/getsentry/sentry-java/pull/3534))
- `span.startChild` now uses `.makeCurrent()` by default ([#3544](https://github.com/getsentry/sentry-java/pull/3544))
- This caused an issue where the span tree wasn't correct because some spans were not added to their direct parent
- Partially fix bootstrap class loading ([#3543](https://github.com/getsentry/sentry-java/pull/3543))
- 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.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ public OtelSpanWrapper(
return NoOpSpan.getInstance();
}

return scopes.getOptions().getSpanFactory().createSpan(scopes, spanOptions, spanContext, this);
final @NotNull ISpan childSpan =
scopes.getOptions().getSpanFactory().createSpan(scopes, spanOptions, spanContext, this);
// TODO [POTEL] spanOptions.isBindToScope with default true?
childSpan.makeCurrent();
return childSpan;
}

@Override
Expand Down

0 comments on commit 49cc6bb

Please sign in to comment.