com.twitter.finagle.tracing

Trace

Related Doc: package tracing

object Trace

Trace maintains the state of the tracing stack The current TraceId has a terminal flag, indicating whether it can be overridden with a different TraceId. Setting the current TraceId as terminal forces all future annotations to share that TraceId. When reporting, we report to all tracers in the list of Tracers.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Trace
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

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

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

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

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def disable(): Unit

    Turn trace recording off.

  7. def enable(): Unit

    Turn trace recording on.

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

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

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

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

    Definition Classes
    AnyRef → Any
  12. def hasId: Boolean

    True if there is an identifier for the current trace.

  13. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  14. def id: TraceId

    Get the current trace identifier.

    Get the current trace identifier. If no identifiers have been pushed, a default one is provided.

  15. def idOption: Option[TraceId]

    Get the current identifier, if it exists.

  16. def isActivelyTracing: Boolean

    Returns true if tracing is enabled with a good tracer pushed and the current trace is sampled

  17. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  18. def isTerminal: Boolean

    returns

    true if the current trace id is terminal

  19. def letClear[R](f: ⇒ R): R

    Run computation f with all tracing state (tracers, trace id) cleared.

  20. def letId[R](traceId: TraceId, terminal: Boolean = false)(f: ⇒ R): R

    Run computation f with the given traceId.

    Run computation f with the given traceId.

    traceId

    the TraceId to set as the current trace id

    terminal

    true if traceId is a terminal id. Future calls to set() after a terminal id is set will not set the traceId

  21. def letIdOption[R](traceIdOpt: Option[TraceId])(f: ⇒ R): R

    A version of [com.twitter.finagle.tracing.Trace.letId] providing an optional ID.

    A version of [com.twitter.finagle.tracing.Trace.letId] providing an optional ID. If the argument is None, the computation f is run without altering the trace environment.

  22. def letTracer[R](tracer: Tracer)(f: ⇒ R): R

    Run computation f with tracer added onto the tracer stack.

  23. def letTracerAndId[R](tracer: Tracer, id: TraceId, terminal: Boolean = false)(f: ⇒ R): R

    Run computation f with the given tracer and trace id.

    Run computation f with the given tracer and trace id.

    terminal

    true if the next traceId is a terminal id. Future attempts to set nextId will be ignored.

  24. def letTracerAndNextId[R](tracer: Tracer, terminal: Boolean = false)(f: ⇒ R): R

    Run computation f with the given tracer, and a derivative TraceId.

    Run computation f with the given tracer, and a derivative TraceId. The implementation of this function is more efficient than calling letTracer, nextId and letId sequentially as it minimizes the number of request context changes.

    tracer

    the tracer to be pushed

    terminal

    true if the next traceId is a terminal id. Future attempts to set nextId will be ignored.

  25. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  26. def nextId: TraceId

    Create a derived id from the current TraceId.

  27. final def notify(): Unit

    Definition Classes
    AnyRef
  28. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  29. def record(message: String, duration: Duration): Unit

  30. def record(message: String): Unit

  31. def record(ann: Annotation, duration: Duration): Unit

  32. def record(ann: Annotation): Unit

  33. def record(rec: ⇒ Record): Unit

    Record a raw Record.

    Record a raw Record. This will record to a _unique_ set of tracers in the stack.

  34. def recordBinaries(annotations: Map[String, Any]): Unit

  35. def recordBinary(key: String, value: Any): Unit

  36. def recordClientAddr(ia: InetSocketAddress): Unit

  37. def recordLocalAddr(ia: InetSocketAddress): Unit

  38. def recordRpc(name: String): Unit

  39. def recordServerAddr(ia: InetSocketAddress): Unit

  40. def recordServiceName(serviceName: String): Unit

  41. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  42. def time[T](message: String)(f: ⇒ T): T

    Time an operation and add an annotation with that duration on it

    Time an operation and add an annotation with that duration on it

    T

    return type

    message

    The message describing the operation

    f

    operation to perform

    returns

    return value of the operation

  43. def timeFuture[T](message: String)(f: Future[T]): Future[T]

    Runs the function f and logs that duration until the future is satisfied with the given name.

  44. def toString(): String

    Definition Classes
    AnyRef → Any
  45. def traceService[T](service: String, rpc: String, hostOpt: Option[InetSocketAddress] = None)(f: ⇒ T): T

    Convenience method for event loops in services.

    Convenience method for event loops in services. Put your service handling code inside this to get proper tracing with all the correct fields filled in.

  46. def tracers: List[Tracer]

    returns

    the current list of tracers

  47. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def recordRpcname(service: String, rpc: String): Unit

    Annotations
    @deprecated
    Deprecated

    (Since version 6.13.x) Use recordRpc and recordServiceName

Inherited from AnyRef

Inherited from Any

Ungrouped