Choosing Spans, Instruments and Log Records: OTCA practice questions
The spec overview describes tracing, metrics and baggage as separate signals that share the context propagation subsystem, and it also defines a log signal. Knowing which tool fits which question is a core OTCA skill.
By Ibrahim Yesilay · Published · Updated
Independent community practice, not affiliated with or endorsed by CNCF or The Linux Foundation.
What Choosing Spans, Instruments and Log Records covers in OTCA
The spec overview describes tracing, metrics and baggage as separate signals that share the context propagation subsystem, and it also defines a log signal. Knowing which tool fits which question is a core OTCA skill.
A span represents one operation with a start and an end. Its name should describe a class of operations, such as get_account, with identifiers like the account number recorded as attributes instead of being built into the name. SpanKind describes the relationship to other spans. CLIENT and SERVER are used for request and response calls where the caller waits. PRODUCER and CONSUMER are for deferred work such as queue messages, where the producer does not wait for the outcome. INTERNAL is for in-process work and is the default. A span event marks a meaningful moment inside a span. If the timestamp of a piece of data matters, record it as an event, and otherwise as an attribute. Exceptions are recorded with RecordException, which adds an event named exception with type, message and stacktrace attributes.
Metrics come from instruments created by a Meter. Counter accepts only non-negative increments, which suits counts of requests or bytes. UpDownCounter allows increments and decrements, for example the number of active requests or the items in a queue. Histogram records values whose statistics are interesting, such as request durations. The synchronous Gauge records non-additive values when a change event fires. The asynchronous instruments, called Asynchronous Counter, Asynchronous UpDownCounter and Asynchronous Gauge, report absolute values from callbacks that run only when metrics are collected. The guidelines recommend Asynchronous UpDownCounter for additive values such as heap size, so consumers know they may add them across processes. Instrument names are case-insensitive ASCII strings that start with a letter and are at most 255 characters long. Units are case-sensitive and limited to 63 characters.
Only synchronous measurements can be associated with the current Context, which is why exemplars work through them. The default exemplar filter is TraceBased, so a measurement can become an exemplar only when it is recorded inside a sampled span.
Logs usually come from existing logging libraries. The Logs API was designed mainly for authors of log appenders, also called bridges, that connect a logging library to the OpenTelemetry SDK. An application developer normally keeps the familiar logger and configures an appender, although the API can also be called directly, for example to emit structured events. Baggage carries name/value pairs to later services so they can index their own telemetry with that data. It is not copied into span, metric or log attributes unless code or a processor does so explicitly.
Key points
- Use PRODUCER and CONSUMER for deferred messaging, and CLIENT and SERVER for calls where the caller waits.
- Record a span event when the timestamp of a moment matters, and an attribute when it does not.
- Counter is monotonic, UpDownCounter can go down, Histogram captures distributions and Gauge records non-additive values.
- Asynchronous instruments report absolute values from callbacks invoked during collection.
- The Logs API mainly serves appender authors, so applications usually keep their logging library.
Three sample questions
23 OTCA questions on Choosing Spans, Instruments and Log Records, 23 with explanations. How practice works
Question 1
- A.Set each item span as a child of the batch operation span using the parent field.
- B.Use Span Links to associate the batch operation span with each individual item span.
- C.Use separate traces for the batch operation and individual item spans without linking them.
- D.Merge all individual item spans into the batch operation span.
Correct answer: B
Sources: OpenTelemetry spec: Overview, OpenTelemetry docs: Traces
Question 2
- A.Histogram
- B.Gauge
- C.Summary
- D.Counter
Correct answer: B
Sources: OpenTelemetry docs: Metrics, OpenTelemetry spec: Metrics Data Model
Question 3
- A.UpDownCounter
- B.Counter
- C.Histogram
- D.Asynchronous Counter
Correct answer: A
Sources: OpenTelemetry spec: Metrics API, OpenTelemetry spec: Metrics Supplementary Guidelines
Practice this topic
Focus mode keeps every question on Choosing Spans, Instruments and Log Records until you leave it. 10 free guest answers, then a free account; no credit card.
Or open OTCA practice across all topics.
Sources
The explanation above was checked against these official documents.
- OpenTelemetry spec: Metrics API (checked 2026-10-28)
- OpenTelemetry spec: Metrics Supplementary Guidelines (checked 2026-10-28)
- OpenTelemetry docs: Traces concepts (checked 2026-10-28)
- OpenTelemetry docs: Logs concepts (checked 2026-10-28)
- OpenTelemetry docs: Baggage concepts (checked 2026-10-28)
- OpenTelemetry spec: Metrics SDK (checked 2026-10-28)
- OpenTelemetry spec: Overview (checked 2026-10-28)
Frequently asked questions
When should a synchronous Gauge be used instead of an Asynchronous Gauge?
Use the synchronous Gauge when the value arrives through change events you subscribe to. Use the Asynchronous Gauge when you read the value through an accessor inside a collection callback.
Why do only some measurements show exemplars?
The default ExemplarFilter is TraceBased, so only measurements recorded in the context of a sampled span are eligible, and the reservoir then decides which of them are kept.