# Free OTCA practice questions

> 10 free OTCA practice questions with the correct answer and an explanation.

Page: https://devopscodelab.com/exams/opentelemetry-otca/free-practice-questions/
Practice exams: https://devopscodelab.com/exams/opentelemetry-otca/

### Question 1 of 10

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?

- A. Per-replica p99 values are already exact; they only need to be weighted by each replica's CPU utilization before averaging
- B. Averages of percentiles overstate tail latency; record a gauge of the latest request duration on each replica instead
- C. Percentiles are only valid for counters; record a monotonic counter of total duration on every replica and divide it by the request count
- D. Percentiles cannot be averaged; record a histogram on each replica and compute the percentile from merged buckets

**Answer:** D

**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 (choose 2)

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

- A. Head-based sampling always keeps more error traces than tail-based sampling
- B. Tail-based sampling can keep traces with errors or high latency after they finish
- C. Head-based sampling decides when the trace starts, before its outcome is known
- D. Head-based sampling requires buffering all spans of a trace in a central component
- E. Tail-based sampling is decided by the root service's SDK at span start time

**Answer:** B, C

**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 (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.)

- A. Prometheus scraping expects cumulative temporality for counters and histograms
- B. Cumulative temporality cannot be produced for asynchronous counter instruments
- C. Temporality preference is set per exporter or reader, so each path can choose its own
- D. Delta temporality is required for any exporter that uses the OTLP protocol
- E. Temporality is fixed per instrument at creation time and cannot vary by exporter

**Answer:** A, C

**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

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?

- A. Set the status to Error with the description copied from the response body
- B. Set the status to Ok, because the server successfully produced a response
- C. Set the status to Error, because any status code of 400 or higher is a failure
- D. Leave the status Unset, because a 4xx response is not a server-side error

**Answer:** D

**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

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?

- A. Use a Drop aggregation for the instrument and recreate it with a new name and attributes
- B. Configure the TraceIdRatioBased sampler so fewer user IDs are recorded in measurements
- C. Register a View for that instrument with an attribute filter that keeps only the allowed keys
- D. Set OTEL_ATTRIBUTE_COUNT_LIMIT to zero so that measurement attributes are dropped globally by the SDK

**Answer:** C

**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

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

- A. Synchronous Counter incremented whenever an object is allocated
- B. Asynchronous Gauge with a callback that reads the heap usage
- C. Synchronous UpDownCounter changed on every allocation and free
- D. Histogram recording the heap size after every garbage collection

**Answer:** B

**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

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?

- A. batch processor with a metadata_keys setting added
- B. k8sattributes processor with a static pod label mapping
- C. resource processor with an upsert action for the key
- D. attributes processor with an insert action on spans

**Answer:** C

**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

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?

- A. forward connector with one pipeline for each of the tenants
- B. routing connector with conditions on the tenant attribute
- C. loadbalancing exporter with the routing key set to service
- D. attributes processor using a hash action on the tenant key

**Answer:** B

**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

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?

- A. The receiver only opens its port after the health_check extension reports that the pipeline is healthy
- B. The receiver's default endpoint binds to localhost, so set it to 0.0.0.0:4317 to accept external traffic
- C. The gRPC protocol listens on port 4318 by default, so the clients must be reconfigured to use that port
- D. The otlp receiver requires an explicit TLS certificate and key before it accepts any connection from another container

**Answer:** B

**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

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?

- A. Set OTEL_TRACES_SAMPLER=always_off so the SDK stops sampling and prints the cause of failures
- B. Raise the SDK's internal diagnostic log level, for example with OTEL_LOG_LEVEL=debug where supported
- C. Add the zpages extension to the application so the SDK serves its internal status pages over HTTP on port 55679
- D. Configure the propagator list to none so that header errors no longer hide exporter problems

**Answer:** B

**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.

Ready for a timed run? Take the free 15-question OTCA mini exam: https://devopscodelab.com/app/exams/opentelemetry-otca/mini/

DevOpsCode Lab is not affiliated with CNCF. OTCA and related names are trademarks of their owners. We write every question ourselves; these are not real exam questions.
