Library for distributed tracing in Scala
final case class Span(
traceId: TraceId,
spanId: SpanId,
name: String,
timestamp: Instant,
kind: Option[Kind] = None,
duration: Option[FiniteDuration] = None,
remoteEndpoint: Option[Endpoint] = None,
tags: Tags = List.empty,
shared: Option[Boolean] = None,
parentId: Option[SpanId])
final case class Trace(
traceId: TraceId,
spanId: SpanId,
parentId: Option[SpanId],
timestamp: Option[Instant],
sampling: Option[Sampling] = None)
Generate SpanId and Trace
trait Tracer[F[_]] {
def trace(sampling: Option[Sampling] = None): F[Option[Trace]]
}
We provide Kafka based implementation, which uses SpanBytesEncoder.THRIFT
from Zipkin to encode spans.
It is also compatible with Jaeger & Ingester
Since version 5.0.0
this implementation is available in separate module stracer-kafka
.
trait ReportSpan[F[_]] {
def apply(span: Span): F[Unit]
}
addSbtPlugin("com.evolution" % "sbt-artifactory-plugin" % "0.0.2")
libraryDependencies += "com.evolutiongaming" %% "stracer" % "5.0.0"
libraryDependencies += "com.evolutiongaming" %% "stracer-play-json" % "5.0.0"
libraryDependencies += "com.evolutiongaming" %% "stracer-circe" % "5.0.0"
libraryDependencies += "com.evolutiongaming" %% "stracer-kafka" % "5.0.0"