OpenTelemetry Certified Associate (OTCA) Practice Questions

OpenTelemetry Certified Associate (OTCA) exam preparation

OpenTelemetry Certified Associate (OTCA) practice questions in English: 180 questions with explanations. The mock exam has 60 questions and 90 minutes.

OpenTelemetry Certified Associate (OTCA) free question 5 / 10 · Domain 2: The OpenTelemetry API and SDK

A service sets no sampler configuration. Which sampler does the SDK use according to the environment variable specification?

  1. parentbased_always_on, a ParentBased sampler whose root sampler is AlwaysOn
  2. traceidratio, with a sampling probability of 1.0
  3. always_on, which samples a span without looking at the parent decision
  4. parentbased_always_off, which drops the root spans of new traces
Show the answer and explanation

Answer: A

Why this is correct
The default of OTEL_TRACES_SAMPLER is parentbased_always_on, which the page defines as ParentBased(root=AlwaysOnSampler). Root spans are therefore sampled, and spans with a parent follow the parent's sampling decision. The other known values include always_on, always_off, traceidratio, parentbased_always_off, and parentbased_traceidratio.

Why the other options are wrong
"always_on, which samples a span without looking at the parent decision" … The default is the ParentBased variant, so a decision made by the parent is respected.
"traceidratio, with a sampling probability of 1.0" … traceidratio is a valid value but not the default. It also does not look at the parent.
"parentbased_always_off, which drops the root spans of new traces" … The default root sampler is AlwaysOn, so new traces are sampled.

Key points
Default sampling is parent-based and records new traces. To sample a ratio, use parentbased_traceidratio with OTEL_TRACES_SAMPLER_ARG.

Go to the OpenTelemetry Certified Associate (OTCA) practice app (10 free questions; purchase unlocks all questions)

See the full practice set