Object

com.github.gvolpe.tracer

Tracer

Related Doc: package tracer

Permalink

object Tracer extends StringSyntax

org.http4s.server.HttpMiddleware that either tries to get a Trace-Id from the headers or otherwise creates one with a unique Time-based UUID value, adds it to the headers and logs the http request and http response with it.

Quite useful to trace the flow of each request. For example:

TraceId(72b079c8-fc92-4c4f-aa5a-c0cd91ea221c) >> Request(method=GET, uri=/users, ...) TraceId(72b079c8-fc92-4c4f-aa5a-c0cd91ea221c) >> UserAlgebra requesting users TraceId(72b079c8-fc92-4c4f-aa5a-c0cd91ea221c) >> UserRepository fetching users from DB TraceId(72b079c8-fc92-4c4f-aa5a-c0cd91ea221c) >> MetricsService saving users metrics TraceId(72b079c8-fc92-4c4f-aa5a-c0cd91ea221c) >> Response(status=200, ...)

In a normal application, you will have thousands of requests and tracing the call chain in a failure scenario will be invaluable.

Linear Supertypes
StringSyntax, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Tracer
  2. StringSyntax
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final case class TraceId(value: String) extends AnyVal with Product with Serializable

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply[F[_]](http: HttpApp[F], headerName: String = DefaultTraceIdHeader)(implicit F: Sync[F], L: TracerLog[[β$0$]Kleisli[F, TraceId, β$0$]]): HttpApp[F]

    Permalink
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def getTraceId[F[_]](request: Request[F])(implicit arg0: Applicative[F]): F[Option[TraceId]]

    Permalink
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. implicit def http4sStringSyntax(s: String): StringOps

    Permalink
    Definition Classes
    StringSyntax
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  19. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from StringSyntax

Inherited from AnyRef

Inherited from Any

Ungrouped