Introduction to Observability in ZIO
Observability is the ability to understand what a running application is doing from the outside. In a highly concurrent application, where many fibers run at once and services are spread across several servers, we need information emitted by the application itself to find out about errors, response latency, and where a request spends its time. ZIO provides the building blocks for this in its core library, and connects to external tools for the rest.
Pages in This Sectionโ
The section has four parts:
- Logging โ A lightweight built-in logging facade that standardizes the interface to logging functionality. It covers
ZIO.log, log levels, log spans, and log annotations, and it can be plugged into an existing logging backend. The ZLogger page documents the composable functional logging interface behind it. - Metrics โ Counter, gauge, histogram, summary, and frequency metrics, defined as ZIO aspects that can be applied to an effect without changing its signature. The section also covers metric labels and JVM metrics.
- Tracing โ How to follow the lifetime of a request across several services in a distributed system, supported through the OpenTelemetry API in ZIO Telemetry.
- Supervisor โ
Supervisor[A], which supervises the launching and termination of fibers and produces a visible value of typeA, for example to report the number of running fibers.
Where to Go Nextโ
- ZIO Logging โ Logging backends that the built-in logging facade can be plugged into.
- ZIO Telemetry โ Tracing through the OpenTelemetry API.
- Fiber โ The lightweight threads of execution that a
Supervisorobserves.