From the course: Mastering Observability with OpenTelemetry

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Logging in OpenTelemetry

Logging in OpenTelemetry

- [Instructor] Logs are our last signal in observability, and they also came last after metrics when OpenTelemetry was created. So what are logs? Logs are technically the oldest way to debug. Before there were metrics or traces, people were already writing logs for decades. OpenTelemetry defines logs like this: a log is a timestamped text record, either structured, which is recommended, or unstructured, with metadata. By the way, we saw logs already in our console when Flask express locked our requests. So logs can be structured and unstructured. Unstructured log entries are plain text lines, and it's hard for a system to parse their meaning. They are meant for humans. And then there are structured logs, often using JSON. They are machine parsable and contain all the data in dedicated fields, along with metadata, like in this example, the trace_id and span_id. This trace_id and span_id can then be used to correlate traces and logs, and you will see this in this chapter. Structured…

Contents