OTCA

Free OTCA practice questions

10 questions from our OTCA practice tests, each with the correct answer and a written explanation. Read them with the answers shown, or switch to quiz mode and answer first.

Back to the OTCA practice exams

Question 1 of 10, Fundamentals of Observability

An SRE wants to report the 99th-percentile latency of an API across 40 replicas. Each replica currently computes its own p99 and the team averages those values. Why is this approach misleading, and what is the better instrument choice?

  1. APer-replica p99 values are already exact; they only need to be weighted by each replica's CPU utilization before averaging
  2. BAverages of percentiles overstate tail latency; record a gauge of the latest request duration on each replica instead
  3. CPercentiles are only valid for counters; record a monotonic counter of total duration on every replica and divide it by the request count
  4. DPercentiles cannot be averaged; record a histogram on each replica and compute the percentile from merged buckets Correct answer

Answer and explanation: Percentiles are not additive, so averaging per-replica p99 values does not yield the fleet-wide p99; histograms can be merged bucket by bucket and the percentile estimated from the combined distribution. A gauge of the latest duration samples only one request. Total duration divided by count gives a mean, not a tail percentile, and weighting by CPU does not fix the math.

Question 2 of 10, Fundamentals of Observability. Choose 2.

Which statements correctly compare head-based and tail-based sampling? (Choose two.)

  1. AHead-based sampling always keeps more error traces than tail-based sampling
  2. BTail-based sampling can keep traces with errors or high latency after they finish Correct answer
  3. CHead-based sampling decides when the trace starts, before its outcome is known Correct answer
  4. DHead-based sampling requires buffering all spans of a trace in a central component
  5. ETail-based sampling is decided by the root service's SDK at span start time

Answer and explanation: Head sampling makes its decision at the start of a trace, which is cheap but blind to errors or latency that occur later. Tail sampling waits until spans are complete so it can keep interesting traces. Buffering complete traces is a tail-sampling requirement, tail sampling is not decided at span start, and head sampling does not favour error traces.

Question 3 of 10, The OpenTelemetry API and SDK. Choose 2.

A backend that ingests OTLP metrics charges by stored series and works best with delta temporality, while the team's Prometheus server scrapes the same app. Which statements are correct? (Choose two.)

  1. APrometheus scraping expects cumulative temporality for counters and histograms Correct answer
  2. BCumulative temporality cannot be produced for asynchronous counter instruments
  3. CTemporality preference is set per exporter or reader, so each path can choose its own Correct answer
  4. DDelta temporality is required for any exporter that uses the OTLP protocol
  5. ETemporality is fixed per instrument at creation time and cannot vary by exporter

Answer and explanation: Temporality is chosen by the MetricReader or exporter, for example via OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE for OTLP, so one app can serve a delta OTLP path and a cumulative Prometheus path. Prometheus is cumulative by design. Instruments do not fix temporality, OTLP supports both temporalities, and asynchronous counters can be exported cumulatively.

Question 4 of 10, The OpenTelemetry API and SDK

An instrumentation library for an HTTP server finishes handling a request that returned status 404. According to OpenTelemetry semantic conventions, how should the SERVER span status be set?

  1. ASet the status to Error with the description copied from the response body
  2. BSet the status to Ok, because the server successfully produced a response
  3. CSet the status to Error, because any status code of 400 or higher is a failure
  4. DLeave the status Unset, because a 4xx response is not a server-side error Correct answer

Answer and explanation: For SERVER spans, 4xx codes reflect client mistakes, so the span status stays Unset; only 5xx responses mark it Error. CLIENT spans, by contrast, treat 4xx as errors. Instrumentation libraries should not set Ok, which is reserved for an explicit application decision, and copying response bodies into descriptions is not part of the convention.

Question 5 of 10, The OpenTelemetry API and SDK

An auto-instrumented library emits a histogram with a high-cardinality user.id attribute. The team cannot change the library. Which approach removes the attribute from the exported metric stream at the SDK?

  1. AUse a Drop aggregation for the instrument and recreate it with a new name and attributes
  2. BConfigure the TraceIdRatioBased sampler so fewer user IDs are recorded in measurements
  3. CRegister a View for that instrument with an attribute filter that keeps only the allowed keys Correct answer
  4. DSet OTEL_ATTRIBUTE_COUNT_LIMIT to zero so that measurement attributes are dropped globally by the SDK

Answer and explanation: A View with an attribute key filter changes which attributes the SDK aggregates on, removing user.id from the stream while keeping the metric. Trace sampling does not apply to metric measurements, the attribute count limit governs span and log attributes rather than metric aggregation keys, and Drop aggregation discards the whole instrument.

Question 6 of 10, The OpenTelemetry API and SDK

A service needs to report the current JVM heap usage, which the runtime exposes on demand. Which instrument is the MOST natural fit?

  1. ASynchronous Counter incremented whenever an object is allocated
  2. BAsynchronous Gauge with a callback that reads the heap usage Correct answer
  3. CSynchronous UpDownCounter changed on every allocation and free
  4. DHistogram recording the heap size after every garbage collection

Answer and explanation: An asynchronous gauge reports a non-additive current value read in a callback at collection time, which matches heap usage exposed by the runtime. Counting allocations or tracking every allocation and free is impractical and not what is being measured, and a histogram of post-GC sizes describes a distribution rather than the current value.

Question 7 of 10, The OpenTelemetry Collector

A gateway Collector must add deployment.environment.name=prod to every span, metric and log it forwards, as a resource attribute. Which processor is the MOST direct fit?

  1. Abatch processor with a metadata_keys setting added
  2. Bk8sattributes processor with a static pod label mapping
  3. Cresource processor with an upsert action for the key Correct answer
  4. Dattributes processor with an insert action on spans

Answer and explanation: The resource processor modifies resource attributes for all signals, and upsert sets the key whether or not it exists. The attributes processor edits span, log or data-point attributes rather than the resource, batch metadata_keys controls batching by client metadata, and k8sattributes enriches data from Kubernetes API objects rather than adding fixed values.

Question 8 of 10, The OpenTelemetry Collector

A gateway must send traces from tenant "acme" to one backend and all other tenants to another, based on a resource attribute. Which component is designed for this?

  1. Aforward connector with one pipeline for each of the tenants
  2. Brouting connector with conditions on the tenant attribute Correct answer
  3. Cloadbalancing exporter with the routing key set to service
  4. Dattributes processor using a hash action on the tenant key

Answer and explanation: The routing connector evaluates conditions, such as OTTL statements on resource attributes, and sends data to different pipelines with their own exporters. The loadbalancing exporter spreads data across Collector instances rather than routing by tenant, forward cannot choose between pipelines, and hashing an attribute does not route data.

Question 9 of 10, The OpenTelemetry Collector

A Collector runs in a container and the otlp receiver is configured with only protocols: grpc: and no endpoint. Applications in other containers cannot connect on port 4317. What is the MOST likely reason in current Collector versions?

  1. AThe receiver only opens its port after the health_check extension reports that the pipeline is healthy
  2. BThe receiver's default endpoint binds to localhost, so set it to 0.0.0.0:4317 to accept external traffic Correct answer
  3. CThe gRPC protocol listens on port 4318 by default, so the clients must be reconfigured to use that port
  4. DThe otlp receiver requires an explicit TLS certificate and key before it accepts any connection from another container

Answer and explanation: Recent Collector releases changed the default receiver endpoints from 0.0.0.0 to localhost, so inside a container the port is unreachable from other containers unless the endpoint is set explicitly. gRPC still uses 4317 and HTTP uses 4318. TLS is optional, and receivers do not wait on the health_check extension to start listening.

Question 10 of 10, Maintaining and Debugging Observability Pipelines

A developer sees no telemetry from an SDK and wants the SDK to print its own internal warnings and errors, such as exporter failures. What is the usual first step across SDKs?

  1. ASet OTEL_TRACES_SAMPLER=always_off so the SDK stops sampling and prints the cause of failures
  2. BRaise the SDK's internal diagnostic log level, for example with OTEL_LOG_LEVEL=debug where supported Correct answer
  3. CAdd the zpages extension to the application so the SDK serves its internal status pages over HTTP on port 55679
  4. DConfigure the propagator list to none so that header errors no longer hide exporter problems

Answer and explanation: SDKs emit self-diagnostics through their internal logger, and raising its level (OTEL_LOG_LEVEL in several SDKs, or language-specific logging) reveals exporter and configuration errors. always_off stops recording traces, zpages is a Collector extension, and disabling propagators does not surface diagnostics.