Trait/Object

com.beachape.zipkin

TracedOp

Related Docs: object TracedOp | package zipkin

Permalink

trait TracedOp extends AnyRef

Helper methods for tracing synchronous operations

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TracedOp
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def timeout: FiniteDuration

    Permalink

    Duration of timeout to wait for the in-scope ZipkinServiceLike to produce a Span for sync tracing purposes

Concrete 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]) ⇒ A)(implicit parentSpan: Span, zipkinService: ZipkinServiceLike): A

    Permalink

    Traces the provided synchronous operation Option[Span] => A op, using the provided traceName and annotations.

    Traces the provided synchronous operation Option[Span] => A op, using the provided traceName and annotations.

    This function expects that there is a parent Span in scope. If there is even 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. Also, note that if the ZipkinServiceLike does not provide a Span in the timeout duration timeout, then 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.

    TracedOp("sleepy", "boom" -> "shakalaka") { maybeSpan =>
      Thread.sleep(2000.millis.toMillis)
      3
    }
    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 a Option[Span] and produce an [A]

  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]) ⇒ (A, Seq[(String, String)]))(implicit parentSpan: Span, zipkinService: ZipkinServiceLike): A

    Permalink

    Traces the provided synchronous operation Option[Span] => A op, using the provided traceName and annotations.

    Traces the provided synchronous operation Option[Span] => A op, using the provided traceName and annotations. The Option[Span] parameter is so that you can pass the span details toother systems in your A-producing function. Note that this function expects the a 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. If there is even 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. Also, note that if the ZipkinServiceLike does not provide a Span in the timeout duration timeout, then 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.

    TracedOp.endAnnotations("sleepy", "boom" -> "shakalaka") { maybeSpan =>
      Thread.sleep(2000.millis.toMillis)
      (3, Seq("finished-with" -> "3")) // end annotations
    }
    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 a Option[Span] and produce an [A]

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

    Permalink

    The simplest kind synchronous tracing; traces the provided operation f using the provided traceName and annotations.

    The simplest kind synchronous tracing; traces the provided operation f using the provided traceName and annotations.

    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 you do not need to have access to the generated Span used for tracing this operation, this is the best synchronous tracing method to use, as it does not block the current thread in waiting for the Span to be produced by the in-scope ZipkinServiceLike

    Example:

    TracedOp.simple("sleepy", "boom" -> "shakalaka") {
      Thread.sleep(2000.millis.toMillis)
      3
    }
    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 [A]

  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 AnyRef

Inherited from Any

Ungrouped