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: lib/samplers/README.md
+13-54Lines changed: 13 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ Customers configure how they would like their transactions to be sampled under o
14
14
-`remote_parent_sampled`: The sampler for when the upstream service has sampled the trace.
15
15
-`remote_parent_not_sampled`: The sampler for when the upstream service has not sampled the trace.
16
16
17
-
NOTE: `distributed_tracing.sampler` only exists for backward compatiability and will be deprecated in favor of `distributed_tracing.sampler.full_granularity`. For now, `full_granularity` will take precedence over the old path.
17
+
NOTE: `distributed_tracing.sampler` only exists for backward compatiability and may be deprecated in favor of `distributed_tracing.sampler.full_granularity`. For now, `full_granularity` will take precedence over the old path.
18
18
19
19
### Full Config in Accordance to Spec
20
20
@@ -68,64 +68,23 @@ distributed_tracing:
68
68
69
69
## Solution
70
70
71
-
There are three sampler modes, each with three sampler sections, resulting in potentially nine different sampling decisions that the agent would have to support.
72
-
73
-
### Seperate Sampler Instances
74
-
75
-
We create a new `Sampler` instance for each sampler modes' section, resulting in 9 samplers. It would be something like (left-hand side represents the current instance's name if it exists):
71
+
There are three sampler modes, each with three sampler sections, resulting in potentially nine different sampling decisions that the agent would have to support. We create a new `Sampler` instance (`AdaptiveSampler`, `AlwaysOnSampler`, `AlwaysOffSampler`, or `TraceIdRatioBasedSampler`, defined in this folder) for each of these sampler modes' sections.
Will be deprecated, `full_granularity` takes precedence:
82
+
These fields currently exist (before core tracing was implemented); `agent.sampler.fullGranularity.*` will take precedence over these fields:
87
83
88
84
*`agent.sampler.root`
89
-
*`agent.sampler.remote_parent_sampled`
90
-
*`agent.sampler.remote_parent_not_sampled`
85
+
*`agent.sampler.remoteParentSampled`
86
+
*`agent.sampler.remoteParentNotSampled`
91
87
92
-
`Transaction.prototype._calculatePriority` would be modified like:
88
+
These samplers have a `applySamplingDecision({transaction})` function, which `Transaction` calls (in `lib/transaction/index.js`) to update its `sampled` field and therefore its `priority`.
Unlike the other samplers, the `AdaptiveSampler` must share state with other `AdaptiveSamplers` with the same `sampling_target`, which complicates our seperate sampler instances approach. This will be fixed shortly, and this document will be updated to describe that solution.
0 commit comments