Object

com.beachape.zipkin

TracedFuture

Related Doc: package zipkin

Permalink

object TracedFuture

Helpers for Tracing futures with Zipkin.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. TracedFuture
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

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[A](traceName: String, annotations: (String, String)*)(f: (Option[Span]) ⇒ Future[A])(implicit parentSpan: Span, zipkinService: ZipkinServiceLike): Future[A]

    Permalink

    Does tracing of a Option[Span] => Future[A] based on the given trace name and annotations (annotations are sent at the beginning).

    Does tracing of a Option[Span] => Future[A] based on the given trace name and annotations (annotations are sent at the beginning). The Option[Span] parameter is so that you can pass the span details to other systems in your Future-producing function.

    This function expects that there is a parent Span in scope. Even if there is a Span in scope, it may not be used as a Parent Span if it does not have the proper ids, namely a span id and a trace id. In this case, a new scope with the given name and new ids will be used and it will not have a parent id.

    If the in scope ZipkinServiceLike does not provide a Span for the in scope parentSpan Span (or if it fails) your function will be handed a None.

    Note, the Span given to your function should not be mutated to affect tracing. It is a deep copy anyways, so there will be no effect.

    Example:

    val myTracedFuture = TracedFuture("slowHttpCall") { maybeSpan =>
      val forwardHeaders = maybeSpan.fold(Seq.empty[(String,String)]){ toHttpHeaders }
      WS.url("myServer").withHeaders(forwardHeaders:_*)
    }
    traceName

    the name for the span used for tracing

    annotations

    variable list of annotations to send for tracing in the beginning (after the client sent annotation)

    f

    the function that will take an Option[Span] and produce a Future[A]. It is an Option[Span] because there is a chance the ZipkinServiceLike will either fail or not produce a Span at all due to filtering or sampling.

  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. def endAnnotations[A](traceName: String, annotations: (String, String)*)(f: (Option[Span]) ⇒ Future[(A, Seq[(String, String)])])(implicit parentSpan: Span, zipkinService: ZipkinServiceLike): Future[A]

    Permalink

    Does tracing of a Option[Span] => Future[(A, Seq[(String, String)]] based on the given trace name and annotations (annotations are sent at the beginning).

    Does tracing of a Option[Span] => Future[(A, Seq[(String, String)]] based on the given trace name and annotations (annotations are sent at the beginning). The Option[Span] parameter is so that you can pass the span details to other systems in your Future-producing function. Note that this function expects the a Future Tuple2 result, where the second element in the pair is a Seq[(String, String)] set of annotations that you might want to use in order to set final annotations on the span.

    This function expects that there is a parent Span in scope. Even if there is a Span in scope, it may not be used as a Parent Span if it does not have the proper ids, namely a span id and a trace id. In this case, a new scope with the given name and new ids will be used and it will not have a parent id.

    If the in scope ZipkinServiceLike does not provide a Span for the in scope parentSpan Span (or if it fails) your function will be handed a None.

    Note, the Span given to your function should not be mutated to affect tracing. It is a deep copy anyways, so there will be no effect.

    Example:

    val myTracedFuture = TracedFuture.endAnnotations("slowHttpCall") { maybeSpan =>
      val forwardHeaders = maybeSpan.fold(Seq.empty[(String,String)]){ toHttpHeaders }
      WS.url("myServer").withHeaders(forwardHeaders:_*).map { response =>
         (response.json, Seq("session id" -> response.header("session id").toString))
      }
    }
    traceName

    the name for the span used for tracing

    annotations

    variable list of annotations to send for tracing in the beginning (after the client sent annotation)

    f

    the function that will take an Option[Span] and produce a Future[(A, Seq[(String, String)])]. It is an Option[Span] because there is a chance the ZipkinServiceLike will either fail or not produce a Span at all due to filtering or sampling. The Seq[(String, String)] will be used as annotations to be sent right before setting client received and sending the Span.

  8. final def eq(arg0: AnyRef): Boolean

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

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

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

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

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

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

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped