Skip to content
Ameen Abozaid
Planned lessonMID-047-L06

Correlating logs and traces

  • Lesson 6 of 9
  • Mid-level
On This Lesson 4 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

find all logs for one request.

Planned topics

  • Put trace_id and span_id in every log line (MDC fields, JSON logs).
  • In the tracing tool jump from a span to its logs; in the log tool search by trace id.
  • Log structured JSON, not free text.
  • Never log secrets or personal data.
Draft outline details

Demonstration

a JSON log line: {"level":"WARN","trace_id":"4bf9…","msg":"stock low","sku":"A12"}.

Check your understanding

Which id joins a log line to a trace?

Show answer

The trace id.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Continue to next lesson

Type to search levels, phases, modules and lessons.