Microservices Monitoring, Logging, and Tracing 2 — Questions and Answers
Question 1: In distributed tracing, what does a 'span' represent?
- A single unit of work or operation within a request's journey (Correct answer)
- The total memory used by a service
- A network firewall rule
- A database backup window
Correct answer: A single unit of work or operation within a request's journey
A span represents a single named, timed operation within a trace, such as a service call or database query.
Question 2: Which header is commonly propagated to correlate spans across services in W3C Trace Context?
- traceparent (Correct answer)
- Authorization
- Content-Type
- Cache-Control
Correct answer: traceparent
The 'traceparent' header carries trace ID, parent span ID, and flags across service boundaries.
Question 3: What is the primary purpose of a correlation ID in microservices logging?
- To link all log entries belonging to a single request across services (Correct answer)
- To encrypt log files at rest
- To compress logs before storage
- To rotate log files daily
Correct answer: To link all log entries belonging to a single request across services
A correlation ID is attached to every log line for a request so logs can be tied together across services.
Question 4: Which logging approach is most suitable for machine parsing and aggregation in microservices?
- Structured logging in JSON format (Correct answer)
- Free-text plain logs only
- Logging only to local console
- Binary memory dumps
Correct answer: Structured logging in JSON format
Structured JSON logs include consistent key-value fields, making them easy to index, search, and aggregate.
Question 5: In the RED method for monitoring services, what do R, E, and D stand for?
- Rate, Errors, Duration (Correct answer)
- Read, Edit, Delete
- Requests, Endpoints, Data
- Resource, Event, Dependency
Correct answer: Rate, Errors, Duration
The RED method tracks Rate (requests/sec), Errors (failed requests), and Duration (latency).
Question 6: What is a key benefit of centralized log aggregation (e.g., ELK or Loki)?
- Searching and analyzing logs from all services in one place (Correct answer)
- Eliminating the need for any monitoring
- Reducing the number of microservices
- Replacing all databases
Correct answer: Searching and analyzing logs from all services in one place
Centralized aggregation collects logs from every service into a single searchable system for cross-service analysis.
Question 7: Which open standard provides a vendor-neutral set of APIs for traces, metrics, and logs?
- OpenTelemetry (Correct answer)
- OAuth2
- GraphQL
- gRPC
Correct answer: OpenTelemetry
OpenTelemetry provides unified, vendor-neutral instrumentation for traces, metrics, and logs.
In distributed tracing, what does a 'span' represent?