@@ -116,7 +116,7 @@ internal constructor(
116
116
* auto-instrumented requests. By default it is [DeterministicTraceSampler], which either can accept
117
117
* fixed sample rate or can get it dynamically from the provider. Value between `0.0` and
118
118
* `100.0`. A value of `0.0` means no trace will be kept, `100.0` means all traces will
119
- * be kept (default value is `20 .0`). If there is a parent trace attached to the network span created, then its
119
+ * be kept (default value is `100 .0`). If there is a parent trace attached to the network span created, then its
120
120
* sampling decision will be used instead.
121
121
*/
122
122
@JvmOverloads
@@ -141,7 +141,7 @@ internal constructor(
141
141
tracedRequestListener = tracedRequestListener,
142
142
traceOrigin = null ,
143
143
traceSampler = traceSampler,
144
- traceContextInjection = TraceContextInjection .All ,
144
+ traceContextInjection = TraceContextInjection .SAMPLED ,
145
145
redacted404ResourceName = true ,
146
146
localTracerFactory = DEFAULT_LOCAL_TRACER_FACTORY
147
147
)
@@ -162,7 +162,7 @@ internal constructor(
162
162
* auto-instrumented requests. By default it is [DeterministicTraceSampler], which either can accept
163
163
* fixed sample rate or can get it dynamically from the provider. Value between `0.0` and
164
164
* `100.0`. A value of `0.0` means no trace will be kept, `100.0` means all traces will
165
- * be kept (default value is `20 .0`). If there is a parent trace attached to the network span created, then its
165
+ * be kept (default value is `100 .0`). If there is a parent trace attached to the network span created, then its
166
166
* sampling decision will be used instead.
167
167
*/
168
168
@JvmOverloads
@@ -182,7 +182,7 @@ internal constructor(
182
182
tracedRequestListener = tracedRequestListener,
183
183
traceOrigin = null ,
184
184
traceSampler = traceSampler,
185
- traceContextInjection = TraceContextInjection .All ,
185
+ traceContextInjection = TraceContextInjection .SAMPLED ,
186
186
redacted404ResourceName = true ,
187
187
localTracerFactory = DEFAULT_LOCAL_TRACER_FACTORY
188
188
)
@@ -197,7 +197,7 @@ internal constructor(
197
197
* auto-instrumented requests. By default it is [DeterministicTraceSampler], which either can accept
198
198
* fixed sample rate or can get it dynamically from the provider. Value between `0.0` and
199
199
* `100.0`. A value of `0.0` means no trace will be kept, `100.0` means all traces will
200
- * be kept (default value is `20 .0`). If there is a parent trace attached to the network span created, then its
200
+ * be kept (default value is `100 .0`). If there is a parent trace attached to the network span created, then its
201
201
* sampling decision will be used instead.
202
202
*/
203
203
@JvmOverloads
@@ -216,7 +216,7 @@ internal constructor(
216
216
tracedRequestListener = tracedRequestListener,
217
217
traceOrigin = null ,
218
218
traceSampler = traceSampler,
219
- traceContextInjection = TraceContextInjection .All ,
219
+ traceContextInjection = TraceContextInjection .SAMPLED ,
220
220
redacted404ResourceName = true ,
221
221
localTracerFactory = DEFAULT_LOCAL_TRACER_FACTORY
222
222
)
@@ -561,7 +561,7 @@ internal constructor(
561
561
}
562
562
563
563
private fun handleDatadogSampledOutHeaders (requestBuilder : Request .Builder , span : Span , tracer : Tracer ) {
564
- if (traceContextInjection == TraceContextInjection .All ) {
564
+ if (traceContextInjection == TraceContextInjection .ALL ) {
565
565
tracer.inject(
566
566
span.context(),
567
567
Format .Builtin .TEXT_MAP_INJECT ,
@@ -583,19 +583,19 @@ internal constructor(
583
583
}
584
584
585
585
private fun handleB3SampledOutHeaders (requestBuilder : Request .Builder ) {
586
- if (traceContextInjection == TraceContextInjection .All ) {
586
+ if (traceContextInjection == TraceContextInjection .ALL ) {
587
587
requestBuilder.addHeader(B3_HEADER_KEY , B3_DROP_SAMPLING_DECISION )
588
588
}
589
589
}
590
590
591
591
private fun handleB3MultiNotSampledHeaders (requestBuilder : Request .Builder ) {
592
- if (traceContextInjection == TraceContextInjection .All ) {
592
+ if (traceContextInjection == TraceContextInjection .ALL ) {
593
593
requestBuilder.addHeader(B3M_SAMPLING_PRIORITY_KEY , B3M_DROP_SAMPLING_DECISION )
594
594
}
595
595
}
596
596
597
597
private fun handleW3CNotSampledHeaders (span : Span , requestBuilder : Request .Builder ) {
598
- if (traceContextInjection == TraceContextInjection .All ) {
598
+ if (traceContextInjection == TraceContextInjection .ALL ) {
599
599
val traceId = span.context().traceIdAsHexString()
600
600
val spanId = span.context().toSpanId()
601
601
requestBuilder.addHeader(
@@ -828,7 +828,7 @@ internal constructor(
828
828
internal var traceOrigin: String? = null
829
829
internal var traceSampler: Sampler <Span > = DeterministicTraceSampler (DEFAULT_TRACE_SAMPLE_RATE )
830
830
internal var localTracerFactory = DEFAULT_LOCAL_TRACER_FACTORY
831
- internal var traceContextInjection = TraceContextInjection .All
831
+ internal var traceContextInjection = TraceContextInjection .SAMPLED
832
832
833
833
internal var redacted404ResourceName = true
834
834
@@ -855,7 +855,7 @@ internal constructor(
855
855
* Set the trace sample rate controlling the sampling of APM traces created for
856
856
* auto-instrumented requests. If there is a parent trace attached to the network span created, then its
857
857
* sampling decision will be used instead.
858
- * @param sampleRate the sample rate to use (percentage between 0f and 100f, default is 20f ).
858
+ * @param sampleRate the sample rate to use (percentage between 0f and 100f, default is 100f ).
859
859
*/
860
860
fun setTraceSampleRate (@FloatRange(from = 0.0 , to = 100.0 ) sampleRate : Float ): R {
861
861
this .traceSampler = DeterministicTraceSampler (sampleRate)
@@ -867,7 +867,7 @@ internal constructor(
867
867
* auto-instrumented requests. If there is a parent trace attached to the network span created, then its
868
868
* sampling decision will be used instead.
869
869
* @param traceSampler the trace sampler controlling the sampling of APM traces.
870
- * By default it is a sampler accepting 20 % of the traces.
870
+ * By default it is a sampler accepting 100 % of the traces.
871
871
*/
872
872
fun setTraceSampler (traceSampler : Sampler <Span >): R {
873
873
this .traceSampler = traceSampler
@@ -876,13 +876,13 @@ internal constructor(
876
876
877
877
/* *
878
878
* Set the trace context injection behavior for this interceptor in the intercepted requests.
879
- * By default this is set to [TraceContextInjection.All] meaning that all the trace context
879
+ * By default this is set to [TraceContextInjection.SAMPLED], meaning that only the sampled request will
880
+ * propagate the trace context. In case of [TraceContextInjection.ALL] all the trace context
880
881
* will be propagated in the intercepted requests no matter if the span created around the request
881
- * is sampled or not. In case of [TraceContextInjection.Sampled] only the sampled request will propagate
882
- * the trace context.
882
+ * is sampled or not.
883
883
* @param traceContextInjection the trace context injection option.
884
- * @see TraceContextInjection.All
885
- * @see TraceContextInjection.Sampled
884
+ * @see TraceContextInjection.ALL
885
+ * @see TraceContextInjection.SAMPLED
886
886
*/
887
887
fun setTraceContextInjection (traceContextInjection : TraceContextInjection ): R {
888
888
this .traceContextInjection = traceContextInjection
@@ -942,7 +942,7 @@ internal constructor(
942
942
internal const val NETWORK_REQUESTS_TRACKING_FEATURE_NAME = " Network Requests"
943
943
internal const val ALL_IN_SAMPLE_RATE : Double = 100.0
944
944
internal const val ZERO_SAMPLE_RATE : Float = 0f
945
- internal const val DEFAULT_TRACE_SAMPLE_RATE : Float = 20f
945
+ internal const val DEFAULT_TRACE_SAMPLE_RATE : Float = 100f
946
946
947
947
// taken from DatadogHttpCodec
948
948
internal const val DATADOG_LEAST_SIGNIFICANT_64_BITS_TRACE_ID_HEADER = " x-datadog-trace-id"
0 commit comments