Introduction to ZIO Telemetry
ZIO telemetry is purely-functional and type-safe. It provides clients for OpenTracing, OpenCensus and OpenTelemetry.
ZIO Telemetry consists of the following projects:
In monolithic architecture, everything is in one place, and we know when a request starts and then how it goes through the components and when it finishes. We can obviously see what is happening with our request and where is it going. But, in distributed systems like microservice architecture, we cannot find out the story of a request through various services easily. This is where distributed tracing comes into play.
ZIO Telemetry is a purely functional client which helps up propagate context between services in a distributed environment.
In order to use this library, we need to add the following line in our
build.sbt file if we want to use OpenTelemetry client:
libraryDependencies += "dev.zio" %% "zio-opentelemetry" % "<version>"
For using OpenTracing client we should add the following line in our
libraryDependencies += "dev.zio" %% "zio-opentracing" % "<version>"
And for using OpenCensus client we should add the following line in our
libraryDependencies += "dev.zio" %% "zio-opencensus" % "<version>"
You can find examples with full source code and instructions of how to run by following the links:
- Trace your microservices with ZIO by Marek Kadek (September 2021)