OTCA flashcards
OTCA · Build recall with a focused review session.
32 cards. Read the term and the definition here. The deck at the top of this page is optional.
- What is OpenTelemetry?
- A vendor-neutral CNCF project providing APIs, SDKs, a Collector, and semantic conventions to generate, collect, and export traces, metrics, and logs. It defines telemetry plumbing, not a backend storage or visualization system.
- API versus SDK
- The API defines interfaces for instrumenting code and defaults to a no-op. The SDK implements those interfaces with real providers, samplers, processors, and exporters, configured and registered at application startup.
- What is a span?
- A named, timed unit of work within a trace. It carries a trace ID, span ID, parent span ID, timestamps, attributes, events, links, kind, and status, and may contain child spans.
- What is a resource?
- A set of attributes describing the entity that produces telemetry, such as service.name, host.name, and process info. Resources are merged from environment, SDK defaults, and explicit configuration.
- Instrumentation scope meaning
- A name and version identifying the library or module that emitted telemetry, plus optional attributes. It replaces the older concept of instrumentation library and groups related instruments and spans.
- OTel stability guarantees
- Tracing and metrics are stable across the API and SDK; logging is stabilizing. The Collector, semantic conventions, and some language SDKs evolve separately, so pin versions and track deprecations.
- Trace and span identity
- A trace ID is 16 bytes (32 hex chars); a span ID is 8 bytes (16 hex chars). All spans in one trace share the trace ID, and parent_span_id links a child to its caller.
- Span status values
- Status is Unset, Ok, or Error. Unset means no explicit decision; Error marks a failed operation. Exceptions are recorded as span events with type, message, and stack trace, not as status alone.
- Head versus tail sampling
- Head sampling decides in the SDK before export, cheaply but without full-trace knowledge. Tail sampling decides in the Collector after observing complete traces, enabling keep-on-error and keep-slow policies.
- Metric instrument types
- Counter is a monotonic sum; UpDownCounter is a non-monotonic sum; Histogram records distributions into buckets; Gauge reports a current value. Choose by whether the value only increases, fluctuates, or is a snapshot.
- Delta versus cumulative temporality
- Delta reports the change since the last collection; cumulative reports the total since start. Prometheus typically expects cumulative, while some backends prefer delta, so configure temporality per exporter.
- What is baggage?
- Key-value pairs propagated across service boundaries via the W3C Baggage header. Baggage is not exported as telemetry automatically; code must read it and record values as attributes if needed.
- What are exemplars?
- Optional trace references (trace ID and span ID) attached to individual metric data points, allowing a metric spike to be linked to a specific sampled trace for investigation.
- Zero-code instrumentation
- Automatic instrumentation via language agents, bytecode injection, or eBPF that creates spans for common libraries without source changes. It can be combined with manual instrumentation in the same process.
- TracerProvider and Tracer
- The TracerProvider holds SDK configuration and is created once per process. Tracer instances obtained from it are cheap, long-lived handles used to start spans; do not create them per request.
- Meter and instruments
- A Meter comes from a MeterProvider and creates instruments. Instruments should be created once during initialization and reused, since creating them per request leaks resources and breaks aggregation.
- Span links purpose
- Links associate a span with causally related spans without making them parents. They suit batch processing, fan-in, and async workflows where a strict parent-child tree would misrepresent the relationship.
- Active context and spans
- Starting a span does not automatically make it current. Code must attach it to the context (for example context.with(span)) so nested operations create child spans and propagate correctly.
- Collector pipeline components
- Receivers ingest data, processors transform or filter it, exporters send it onward, and connectors join pipelines. Pipelines are declared per signal under service.pipelines with receivers, processors, and exporters.
- Batch processor behavior
- Groups spans, metrics, or logs by maximum batch size or timeout before exporting, reducing network overhead. Place memory_limiter before batch so memory pressure is checked before buffering grows.
- memory_limiter processor
- Tracks Collector memory and applies soft and hard limits. Above the soft limit it refuses data to relieve pressure; above the hard limit it forces garbage collection, preventing out-of-memory crashes.
- Agent versus gateway mode
- Agent mode runs a Collector per host or pod, typically forwarding with batching. Gateway mode runs a centralized pool that performs tail sampling, enrichment, and routing before backend export.
- Collector connectors
- Connectors join two pipelines, acting as an exporter in one and a receiver in another. They enable cross-signal processing, such as generating metrics from spans or routing by attribute.
- traceparent header format
- Four dash-separated fields: version, 32-hex trace ID, 16-hex parent span ID, and 2-hex trace flags. A flags value of 01 means sampled; 00 means not sampled.
- tracestate header
- A comma-separated list of vendor key-value entries carried alongside traceparent. Proxies and services must forward it unchanged and only modify entries they own.
- Inject and extract
- Propagation has two operations: inject writes context into a carrier such as HTTP headers or message attributes; extract reads context from a carrier to resume a trace in the receiving service.
- Span kinds
- Server, client, producer, consumer, and internal. Kind reflects the span's role: client spans cover outbound calls, server spans inbound handling, producer and consumer cover messaging, internal covers in-process work.
- HTTP semantic conventions
- Standard attributes include http.request.method, url.full, http.response.status_code, server.address, and error.type. Using them keeps telemetry consistent across languages and backends.
- OTLP default ports
- OTLP/gRPC listens on port 4317 and OTLP/HTTP on port 4318 by default. Most SDKs support both; choose based on proxy support and firewall rules.
- Common OTEL environment variables
- OTEL_SERVICE_NAME sets the service resource attribute. OTEL_EXPORTER_OTLP_ENDPOINT sets the export target. OTEL_TRACES_SAMPLER selects the sampler, and OTEL_RESOURCE_ATTRIBUTES adds resource attributes.
- Missing cross-service spans
- Usually a propagation failure: propagators are misconfigured, or proxies, gateways, or async queues drop traceparent and tracestate headers. Verify headers arrive at each hop.
- Collector troubleshooting tools
- Use the debug or logging exporter to print received telemetry, service.telemetry logs for internal errors, and the health_check and zpages extensions to inspect pipeline status and queues.