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
Copy file name to clipboardExpand all lines: develop-docs/sdk/telemetry/traces/index.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Reference implementations:
16
16
17
17
<Note>
18
18
19
-
This document uses standard interval notation, where `[` and `]`denote closed intervals which include the endpoints of the interval, while `(` and `)`denote open intervals which exclude the endpoints of the interval. An interval `[x, y)` covers all values starting from `x` up to but excluding `y`.
19
+
This document uses standard interval notation, where `[` and `]`indicates closed intervals, which include the endpoints of the interval, while `(` and `)`indicates open intervals, which exclude the endpoints of the interval. An interval `[x, y)` covers all values starting from `x` up to but excluding `y`.
20
20
21
21
</Note>
22
22
@@ -32,13 +32,13 @@ This option is **deprecated** and should be removed from all SDKs.
32
32
33
33
### `tracesSampleRate`
34
34
35
-
This should be a float point number in the range `[0, 1]` and represents the percentage chance that any given transaction will be sent to Sentry. So, barring [outside influence](#sampling), `0.0` is a guaranteed 0% chance (none will be sent) and `1.0` is a guaranteed 100% chance (all will be sent). This rate applies equally to all transactions; in other words, each transaction should have the same random chance of ending up with`sampled = true`, equal to the `tracesSampleRate`.
35
+
This should be a floating-point number in the range `[0, 1]` and represents the percentage chance that any given transaction will be sent to Sentry. So, barring [outside influence](#sampling), `0.0` is a guaranteed 0% chance (none will be sent) and `1.0` is a guaranteed 100% chance (all will be sent). This rate applies equally to all transactions; in other words, each transaction has an equal chance of being marked as`sampled = true`, based on the `tracesSampleRate`.
36
36
37
37
See more about how sampling should be performed [below](#sampling).
38
38
39
39
### `tracesSampler`
40
40
41
-
This should be a callback, called when a transaction is started, which will be given a `samplingContext` object and which should return a sample rate in range `[0, 1]`_for the transaction in question_. This sample rate should behave the same way as the `tracesSampleRate` above, with the difference that it only applies to the newly-created transaction, such that different transactions can be sampled at different rates. Returning `0.0` should force the transaction to be dropped (set to `sampled = false`) and returning `1.0` should force the transaction to be sent (set `sampled = true`).
41
+
This should be a callback function, triggered when a transaction is started. It should be given a `samplingContext` object and should return a sample rate in the range of `[0, 1]`_for the transaction in question_. This sample rate should behave the same way as the `tracesSampleRate` above. The only difference is that it only applies to the newly-created transaction and that different transactions can be sampled at different rates. Returning `0.0` should force the transaction to be dropped (set to `sampled = false`) and returning `1.0` should force the transaction to be sent (set to`sampled = true`).
42
42
43
43
Historically, the `tracesSampler` callback could have also returned a boolean to force a sampling decision (with `false` equivalent to `0.0` and `true` equivalent to `1.0`). This behavior is now **deprecated** and should be removed from all SDKs.
44
44
@@ -194,7 +194,7 @@ There are multiple ways a transaction can end up with a sampling decision:
194
194
- If the transaction has a parent, inheriting its parent's sampling decision
195
195
- Absolute decision passed to `startTransaction`
196
196
197
-
When there's the potential for more than one of these to apply, the following precedence rules should apply:
197
+
If more than one option could apply, the following rules determine which takes precedence:
198
198
199
199
1. If a sampling decision is passed to `startTransaction` (`startTransaction({name: "my transaction", sampled: true})`), that decision will be used, regardlesss of anything else
200
200
2. If `tracesSampler` is defined, its decision will be used. It can choose to keep or ignore any parent sampling decision, or use the sampling context data to make its own decision or choose a sample rate for the transaction.
0 commit comments