OpenTelemetry Certified Associate (OTCA) free question 3 / 10 · Domain 2: The OpenTelemetry API and SDK
Which parameter of the ParentBased sampler is required, with the other parameters optional?
- remoteParentSampled, the sampler called for remote parents whose sampled flag is set
- localParentNotSampled, the sampler called for local parents whose sampled flag is not set
- root, the sampler called for spans that have no parent
- localParentSampled, the sampler called for local parents whose sampled flag is set
Show the answer and explanation
Answer: C
Why this is correct
The ParentBased specification lists "root(Sampler) - Sampler called for spans with no parent (root spans)" as the one required parameter. The four optional parameters, remoteParentSampled, remoteParentNotSampled, localParentSampled, and localParentNotSampled, each have a default of AlwaysOn or AlwaysOff.
Why the other options are wrong
"remoteParentSampled, the sampler called for remote parents whose sampled flag is set" … remoteParentSampled is optional and defaults to AlwaysOn.
"localParentSampled, the sampler called for local parents whose sampled flag is set" … localParentSampled is optional and defaults to AlwaysOn.
"localParentNotSampled, the sampler called for local parents whose sampled flag is not set" … localParentNotSampled is optional and defaults to AlwaysOff.
Key points
Always decide the root sampler explicitly. It is the only choice the ParentBased sampler cannot default.