File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
dd-trace-core/src/main/java/datadog/trace/common/sampling Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ public static RuleBasedTraceSampler build(
6868 rule .getResource (),
6969 rule .getTags (),
7070 new DeterministicSampler .TraceSampler (rule .getSampleRate ()),
71- SamplingMechanism . LOCAL_USER_RULE );
71+ samplingMechanism ( rule . getProvenance ()) );
7272 samplingRules .add (samplingRule );
7373 }
7474 } else {
@@ -116,6 +116,17 @@ public static RuleBasedTraceSampler build(
116116 return new RuleBasedTraceSampler (samplingRules , rateLimit , new RateByServiceTraceSampler ());
117117 }
118118
119+ private static byte samplingMechanism (SamplingRule .Provenance provenance ) {
120+ switch (provenance ) {
121+ case DYNAMIC :
122+ return SamplingMechanism .REMOTE_ADAPTIVE_RULE ;
123+ case CUSTOMER :
124+ return SamplingMechanism .REMOTE_USER_RULE ;
125+ default :
126+ return SamplingMechanism .LOCAL_USER_RULE ;
127+ }
128+ }
129+
119130 @ Override
120131 public <T extends CoreSpan <T >> boolean sample (final T span ) {
121132 return true ;
You can’t perform that action at this time.
0 commit comments