Coder Social home page Coder Social logo

opentracing-scala's Introduction

opentracing-scala

Functional interface for opentracing and an implementation, based on cats.data.StateT.


Tracing monad is defined over type constructor T[_[*], *], that wraps the underlying monad. But its interface is separated into two typeclasses.

Traced[F[_]] ignores underlying type constructor and defines most operations:

  def apply[A](op: String, tags: Traced.Tag*)(fa: F[A]): F[A]
  def spanResource(op: String, tags: Traced.Tag*): Resource[F, ActiveSpan]
    
  def pure[A](a: A): F[A]
  def defer[A](fa: => F[A]): F[A]
  
  def currentSpan: Traced.SpanInterface[F]
  
  def injectContext(context: SpanContext): Traced.Interface[F]
  def injectContextFrom[C](carrier: C, format: Format[C]): Traced.Interface[F]
  
  def extractContext[C0 <: C, C](carrier: C0, format: Format[C]): F[Option[C0]] 

Traced2[T[_[*], *], F[_]] refines operations, that require knowing underlying functor:

  def currentRunParams: F[U, Traced.RunParams]
  def run[A](traced: F[U, A], params: Traced.RunParams): U[A]
  
  def lift[A](ua: U[A]): F[U, A]
  def mapK[G[_]](f: U ~> G): F[U, *] ~> F[G, *]

Traced Transformer

Implementation using cats' state transformer.

  type TracedT[F[_], A] = StateT[F, State, A]

Provides (experimental) instances of Sync and ConcurrentEffect.

opentracing-jaeger-scalac-implicits

Compiler plugin that traces implicit searches performed by scalac and reports them to local jaegertracing backend.

Usage

  • Put to your build.sbt
    addCompilerPlugin("com.github.fehu" %% "opentracing-jaeger-scalac-implicits" % "0.1.3")
    
  • Run, for example, all-in-one jaeger backend with docker
  • Compile your project
  • See the traces at http://localhost:16686

opentracing-scala's People

Contributors

fehu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.