Skip to content

Commit 2e521c2

Browse files
committed
fix: Dont require transaction to be on the scope to be delivered correctly
1 parent ef7b3b2 commit 2e521c2

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Unreleased
44

5-
Coming soon...
5+
- [apm] fix: Always attach `contexts.trace` to finished transaction (#2353)
66

77
## 5.10.2
88

packages/apm/src/span.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@ export class Span implements SpanInterface, SpanContext {
287287
}
288288

289289
return this._hub.captureEvent({
290+
contexts: {
291+
trace: this.getTraceContext(),
292+
},
290293
spans: finishedSpans,
291294
start_timestamp: this.startTimestamp,
292295
tags: this.tags,

packages/hub/src/scope.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,6 @@ export class Scope implements ScopeInterface {
327327
if (this._transaction) {
328328
event.transaction = this._transaction;
329329
}
330-
if (this._span) {
331-
event.contexts = event.contexts || {};
332-
event.contexts.trace = this._span.getTraceContext();
333-
}
334330

335331
this._applyFingerprint(event);
336332

0 commit comments

Comments
 (0)