Skip to content

Commit 82a43dd

Browse files
committed
feat: Set sampled = false on V4 instead of dropping
1 parent b321f68 commit 82a43dd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/js/tracing/reactnavigationv4.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,15 @@ class ReactNavigationV4Instrumentation extends RoutingInstrumentation {
141141
if (!this._prevRoute || currentRoute.key !== this._prevRoute.key) {
142142
const context = this._getTransactionContext(currentRoute);
143143

144-
if (this._options.shouldSendTransaction(currentRoute, this._prevRoute)) {
145-
this.onRouteWillChange(context);
146-
} else {
144+
if (!this._options.shouldSendTransaction(currentRoute, this._prevRoute)) {
145+
context.sampled = false;
147146
logger.log(
148147
`[ReactNavigationV4Instrumentation] Will not send transaction "${context.name}" due to shouldSendTransaction.`
149148
);
150149
}
151150

151+
this.onRouteWillChange(context);
152+
152153
this._prevRoute = currentRoute;
153154
}
154155
}

0 commit comments

Comments
 (0)