Skip to content

Commit 85d630c

Browse files
committed
show negative sampling decision
1 parent 089e0ed commit 85d630c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/platforms/javascript/common/migration/v7-to-v8/v8-new-performance-api.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,15 @@ Sentry.startTransition({op: 'function.myFunction', sampled: true});
268268
// 1. define a tracesSampler
269269
Sentry.init({
270270
tracesSampler: (samplingContext) => {
271+
// force a positive sampling decision for a specific span
271272
if (samplingContext.op === 'function.myFunction') {
272273
return 1;
273274
}
275+
// force a negative sampling decision for a specific span
276+
if (samplingContext.op === 'function.healthCheck') {
277+
return 0;
278+
}
279+
// return 0.1 as default for all other spans
274280
return 0.1;
275281
}
276282
});

0 commit comments

Comments
 (0)