Cloud and Container Basics
In a system in which several services work together, you want to find out which services a single user request passed through, in what order, and how much time it spent in each. Among the data used for observability, which of the following is the most suitable?
- AMetrics (numeric time series such as CPU utilization and request counts)
- BLogs (records of events output by each service)
- CTraces (records of the path of one request and the time of each segment)
Show answer and explanation
Answer: C. Traces (records of the path of one request and the time of each segment)
Observability is the degree to which the internal state of a system can be inferred from the data it emits, and metrics, logs and traces are often named as the data for it. In tracing (distributed tracing), an identifier shared by the request is passed between services, and the start and end times of the processing segments (spans) in each service are recorded to reconstruct the path of one request and the breakdown of its time. Metrics suit detecting overall trends and anomalies, and logs suit detailed investigation of individual events, but traces are the most suitable for following the flow of one request across services. In practice, the trace identifier is also written into the logs, and the three are combined to find causes.
- A. Metrics are aggregated numeric time series, suited to seeing overall trends and anomalies, but they do not show the path of one request.
- B. Logs are records of individual events, separate for each service, so on their own they make it hard to connect the flow of one request.
- C. Correct. A trace records the path and time of one request as it passes across services.