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
Hi there, I have some questions about sampling.
I'm sorry if my doubts are documented somewhere, but I didn't find anything here or in the official doc.
Looking into the code, I found two different Sampler interfaces:
As far as I understood the former is applied at OkHttp level, the latter when you register an AndroidTracer through AndroidTracer.Builder().setSampleRate(double).
My first doubt is how do the two work together? What If I apply both of them?
Correct me if I'm wrong, but looking into the code:
given that you set AndroidTracer.Builder().setSampleRate(globalRate);
given that you added a DataDogInterceptor (application) or a TracingInterceptor (network) with a RateBasedSampler;
This is specifically to understand if apply the DeterministicSampler into the Android client and a TraceIdRatioBased on some backend services as well, means that when a span is sampled from the Android client then also the related spans for the same trace_id are sampled on the backend as well.
The text was updated successfully, but these errors were encountered:
Regarding the sampling rates from the AndroidTracer and the TracingInterceptor, they are as you thought cumulative.
The former one simply asks how many spans (out of all the one the tracer receives) should be kept, and the latter asks how many network requests should have a span created for it.
And indeed the sampling works as Head Based sampling, as describe in the documentation you're mentionning. In theory the DeterministicSampler should give you the same sampling on both Android and the Backend, assuming we use the same Deterministic sampling algorithm (our Android implementation uses the same implementation as our Backend Java Agent).
Question
Hi there, I have some questions about sampling.
I'm sorry if my doubts are documented somewhere, but I didn't find anything here or in the official doc.
Looking into the code, I found two different
Sampler
interfaces:As far as I understood the former is applied at OkHttp level, the latter when you register an
AndroidTracer
throughAndroidTracer.Builder().setSampleRate(double)
.My first doubt is how do the two work together? What If I apply both of them?
Correct me if I'm wrong, but looking into the code:
AndroidTracer.Builder().setSampleRate(globalRate)
;DataDogInterceptor
(application) or aTracingInterceptor
(network) with aRateBasedSampler
;RateBasedSampler
is triggered at the network level and some span is sampled;AndroidTracer
;globalRate
is applied.Is this flow correct?
My second doubt is about the DeterministicSampler implementation of the
andorid-core
sampler.Is it a head-based sampling like the TraceIdRatioBased OpenTelemetry sampler?
This is specifically to understand if apply the
DeterministicSampler
into the Android client and a TraceIdRatioBased on some backend services as well, means that when a span is sampled from the Android client then also the related spans for the same trace_id are sampled on the backend as well.The text was updated successfully, but these errors were encountered: