Logs, Metrics, Traces and Incidents

What actually happened at runtime: reading logs safely, what metrics reveal, how a distributed trace narrows the search, building an incident timeline and collecting an evidence package.

  • Intermediate to advanced
  • About 22 minutes
  • Includes an exercise and a knowledge check

Three signals What actually happened

Diagrams show how systems should communicate. Logs, metrics and traces show what actually happened. Each answers a different question:

Three panels. Logs, what happened: event received at 09:30:02, validation success at 09:30:03, a red error loan servicing timeout at 09:30:04 for TX1001, and retry scheduled, attempt 2, at 09:30:35. Metrics, how much is happening: request rate steady, while error rate, p95 latency and queue depth all rise at 09:30. Traces, where the time went: API gateway 15 ms, payment integration 35 ms, loan servicing API 2,100 ms, its database operation 1,850 ms, response handling 20 ms; about 2.2 seconds in total, so look at loan servicing first.
Logs: what happened? Metrics: how much is happening? Traces: where did the time go?

Logs Read the timeline in the logs

logIntegration service log (fictional)

2026-11-18T09:30:02Z INFO  event_received event_id=EVT9001 transaction_id=TX1001
2026-11-18T09:30:03Z INFO  payment_validation_success transaction_id=TX1001
2026-11-18T09:30:04Z ERROR loan_servicing_request_timeout transaction_id=TX1001
2026-11-18T09:30:35Z INFO  retry_scheduled transaction_id=TX1001 attempt=2

Look for error messages, timestamps, correlation, transaction and request identifiers, retry attempts, authentication and validation failures, exceptions, processing duration and unexpected state changes. Here, the timeout at 09:30:04 and the retry at 09:30:35 raise the key question: did the first attempt post the payment before the timeout?

Metrics What metrics reveal

MetricWhat it reveals
Request countWorkload
Error rateReliability
LatencyResponse performance
Queue depthProcessing backlog
Consumer lagHow far behind event processing is
Database connections in useResource pressure
CPU and memoryCompute pressure
Failed jobsBatch reliability
Reconciliation match rateBusiness process performance

A metric shows what is happening at the system level. It usually cannot tell you why one particular transaction failed.

Traces Where did the time go?

ComponentDuration
API gateway15 ms
Payment integration35 ms
Loan servicing API2,100 ms
Database operation (inside loan servicing)1,850 ms
Response handling20 ms

The whole operation takes about 2.2 seconds, and almost all of it is inside loan servicing, mostly its database work. A trace does not prove the root cause; it tells you where to look next.

Incidents Build an incident timeline

When a customer says reconciliation failed yesterday, do not open the application and hunt for errors. Build a timeline first.

TimeEvent
09:00Provider file received
09:02Ingestion job started
09:03Some records validated
09:04Database connection failures began
09:10Processing job failed
09:15Operations team notified
11:00Manual recovery started
  • Which records were processed, and which were not?
  • Was any work committed before the failure?
  • Did retries create duplicate records?
  • Was the failure limited to one component?
  • Was it detected automatically, and how was the system recovered?

A complete evidence package contains: start and end times, the affected business process and services, sample transaction IDs, relevant logs, metrics and traces, database errors, recent deployments and configuration changes, recovery actions, customer impact, and the evidence for the suspected cause.

Worksheet

Incident timeline template

One row for each event, in order. Write times with their time zone, name the source of every row, and mark whether it is confirmed from a log, metric or trace, reported by a person, or estimated. Timelines built this way can be compared and merged. Answers stay in this browser; Download CSV saves them.

Time (with zone)EventSystem or personSourceStatusRemove
Your answers stay in this browser

Practice Read the incident

Practical exercise

What happened between 09:04 and 11:00?

Using the incident timeline above, plan your investigation.

  1. Write the three queries or log searches you would run first.
  2. Name the metric that would have warned the team earlier.
  3. Write the question about retries you must answer before any re-run.
Show a sample plan
  • Count records committed between 09:02 and 09:10, compared with the file's record count.
  • Search logs for every transaction ID that failed after 09:04, and for any that were retried.
  • Check deployments and configuration changes in the 24 hours before 09:00, including database connection settings.
  • Metric: database connections in use. Rising toward the pool limit before 09:04 would have warned the team.
  • Retry question: did manual recovery at 11:00 re-process records that had already committed at 09:03?

3 questions

Check your understanding

1. Which signal helps you follow one request across several services?
2. A trace shows loan servicing took 2,100 of 2,200 ms. What have you proved?
3. What should never appear in a log?
Answer every question to submit.

What you can do now

  • Read a log timeline and spot the critical question.
  • Choose metrics that reveal workload, reliability and backlog.
  • Use a trace to find where time goes.
  • Build an incident timeline and evidence package.