Skip to main content

Introduction

Trace4Cats ZIO Extras provides distributed tracing for ZIO and its ecosystem built on top of the excellent trace4cats library.

Getting started

Latest Release

Maven Central

libraryDependencies ++= {
val org = "io.kaizen-solutions"
val version = "9.9.0+3-e965332d-SNAPSHOT"

Seq(
org %% "trace4cats-zio-extras-core" % version, // core

// streaming
org %% "trace4cats-zio-extras-fs2" % version, // fs2

// http
org %% "trace4cats-zio-extras-http4s" % version, // http4s
org %% "trace4cats-zio-extras-sttp" % version, // sttp
org %% "trace4cats-zio-extras-tapir" % version, // tapir
org %% "trace4cats-zio-extras-zio-http" % version, // zio-http

// database
org %% "trace4cats-zio-extras-virgil" % version, // virgil
org %% "trace4cats-zio-extras-doobie" % version, // doobie
org %% "trace4cats-zio-extras-skunk" % version, // skunk

// messaging
org %% "trace4cats-zio-extras-fs2-kafka" % version, // fs2-kafka
org %% "trace4cats-zio-extras-zio-kafka" % version // zio-kafka
)
}

This library is also available on JitPack:

JitPack

NOTE: that the coordinates on JitPack are different from the ones on Maven Central. Please click the JitPack link or badge above to see the correct coordinates if you choose to go the JitPack route.

Summary

This library provides the ZTracer abstraction in order to create traces & spans. It also provides a variety of integrations with popular libraries such as:

HTTP

Database

Messaging

Streams

How it works

This library leverages Trace4Cats without making use of the typeclasses inside trace4cats (eg. Provide, etc.) and instead leverages FiberRefs hiding behind the ZTracer abstraction to call the underlying Trace4Cats APIs in order to provide a better experience for the user.

Compatibility

This library is built for ZIO 2.x and is cross-built for Scala 2.12.x, 2.13.x and 3.3.x LTS targeting the latest version of Trace4Cats.