You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Drop this completely by setting its sample rate to 0%
19
20
return0;
20
21
}
21
22
@@ -29,13 +30,24 @@ Sentry.init({
29
30
return0.01;
30
31
}
31
32
32
-
// Continue trace decision, if there is any parentSampled information
33
-
if (typeofparentSampled==="boolean") {
34
-
returnparentSampled;
33
+
// Inherit the samle rate of the incoming trace if there is one. Sampling is deterministic
34
+
// for one entire trace, i.e. if the parent was sampled, we will be sampled too at the same
35
+
// rate.
36
+
if (typeofparentSampleRate==="number") {
37
+
returnparentSampleRate;
35
38
}
36
39
37
40
// Else, use default sample rate
38
41
return0.5;
39
42
},
40
43
});
41
44
```
45
+
46
+
<Alerttitle="parentSampleRate">
47
+
48
+
The `parentSampleRate` sampling context was introduced in version 9 of the SDK.
49
+
To inherit sampling decisions in earlier versions of the SDK, us the `parentSampled` sampling context.
50
+
51
+
Going forward, using `parentSampleRate` is strongly encouraged over using `parentSampled`, because it allows for deterministic sampling and metric extrapolation for downstream traces.
0 commit comments