Packages

object Trace extends Tracing

A singleton instance of Tracing (a facade-style API) that performs a number of Contexts lookups on each operation. Prefer "capturing" a Tracing instance for batching lookups.

See also

Tracing

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Trace
  2. Tracing
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

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. val LocalBeginAnnotation: String
    Definition Classes
    Tracing
  5. val LocalEndAnnotation: String
    Definition Classes
    Tracing
  6. def apply(): Tracing

    Returns a Tracing instance with captured Contexts so it's cheap to reuse.

  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  9. def disable(): Unit

    Turn trace recording off.

  10. def enable(): Unit

    Turn trace recording on.

  11. def enabled: Boolean

    Whether or not trace recording is enabled on this process: false indicates it was shutdown either via -com.twitter.finagle.tracing.enabled flag or Trace.disable() API.

  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hasId: Boolean

    True if there is an identifier for the current trace.

    True if there is an identifier for the current trace.

    Definition Classes
    TraceTracing
  17. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. final def id: TraceId

    Get the current trace identifier.

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

    Definition Classes
    Tracing
  19. def idOption: Option[TraceId]

    Get the current identifier, if it exists.

    Get the current identifier, if it exists.

    Definition Classes
    TraceTracing
  20. final def isActivelyTracing: Boolean

    Return true if tracing is enabled with a good tracer pushed and at least one tracer decides to actively trace the current id.

    Return true if tracing is enabled with a good tracer pushed and at least one tracer decides to actively trace the current id.

    Definition Classes
    Tracing
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. final def isTerminal: Boolean

    Return true if the current trace id is terminal.

    Return true if the current trace id is terminal.

    Definition Classes
    Tracing
  23. def letClear[R](f: => R): R

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

  24. 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

  25. 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.

  26. def letTracer[R](tracer: Tracer)(f: => R): R

    Run computation f with tracer added onto the tracer stack.

  27. def letTracerAndId[R](tracer: Tracer, traceId: 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. If a sampling decision was not made on traceId, one will be made using tracer.

    terminal

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

  28. 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.

  29. def letTracers[R](tracers: Seq[Tracer])(f: => R): R

    Run computation f with tracers added onto the tracer stack.

  30. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. final def nextId: TraceId

    Create a derived id from the current TraceId.

    Create a derived id from the current TraceId.

    Definition Classes
    Tracing
  32. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  33. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. final def record(message: String): Unit
    Definition Classes
    Tracing
  35. final def record(ann: Annotation, duration: Duration): Unit
    Definition Classes
    Tracing
  36. final def record(ann: Annotation): Unit
    Definition Classes
    Tracing
  37. final 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.

    Definition Classes
    Tracing
  38. final def recordBinaries(annotations: Map[String, Any]): Unit
    Definition Classes
    Tracing
  39. final def recordBinary(key: String, value: Any): Unit
    Definition Classes
    Tracing
  40. final def recordCallSite(): Unit

    WARNING: This method call is expensive.

    WARNING: This method call is expensive. It must be sampled. Record the method name, namespace, absolute filepath and line number.

    Definition Classes
    Tracing
  41. final def recordClientAddr(ia: InetSocketAddress): Unit
    Definition Classes
    Tracing
  42. final def recordClientRecv(): Unit
    Definition Classes
    Tracing
  43. final def recordClientRecvError(error: String): Unit
    Definition Classes
    Tracing
  44. final def recordClientRecvFragment(): Unit
    Definition Classes
    Tracing
  45. final def recordClientSend(): Unit
    Definition Classes
    Tracing
  46. final def recordClientSendFragment(): Unit
    Definition Classes
    Tracing
  47. final def recordFilePath(filePath: String): Unit
    Definition Classes
    Tracing
  48. final def recordLineNumber(lineNumber: Int): Unit
    Definition Classes
    Tracing
  49. final def recordLocalAddr(ia: InetSocketAddress): Unit
    Definition Classes
    Tracing
  50. final def recordLocalSpan(name: String, timestamp: Time, duration: Duration): Unit

    Adds an annotation such that the zipkin UI can properly display it

    Adds an annotation such that the zipkin UI can properly display it

    Attributes
    protected
    Definition Classes
    Tracing
    Note

    This method does *not* check isActivelyTracing -- the onus is on the user to include this check.

  51. final def recordMethodName(methodName: String): Unit
    Definition Classes
    Tracing
  52. final def recordNamespace(namespace: String): Unit
    Definition Classes
    Tracing
  53. final def recordRpc(name: String): Unit
    Definition Classes
    Tracing
  54. final def recordServerAddr(ia: InetSocketAddress): Unit
    Definition Classes
    Tracing
  55. final def recordServerRecv(): Unit
    Definition Classes
    Tracing
  56. final def recordServerRecvFragment(): Unit
    Definition Classes
    Tracing
  57. final def recordServerSend(): Unit
    Definition Classes
    Tracing
  58. final def recordServerSendError(error: String): Unit
    Definition Classes
    Tracing
  59. final def recordServerSendFragment(): Unit
    Definition Classes
    Tracing
  60. final def recordServiceName(serviceName: String): Unit
    Definition Classes
    Tracing
  61. final def recordWireRecv(): Unit
    Definition Classes
    Tracing
  62. final def recordWireRecvError(error: String): Unit
    Definition Classes
    Tracing
  63. final def recordWireSend(): Unit
    Definition Classes
    Tracing
  64. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  65. def time[T](message: String)(f: => T): T

    Time an operation and add a binary annotation to the current span with the duration.

    Time an operation and add a binary annotation to the current span with the duration.

    T

    return type

    message

    The message describing the operation

    f

    operation to perform

    returns

    return value of the operation

    Definition Classes
    Tracing
  66. def timeFuture[T](message: String)(f: Future[T]): Future[T]

    Time an async operation and add a binary annotation to the current span with the duration.

    Time an async operation and add a binary annotation to the current span with the duration.

    Definition Classes
    Tracing
  67. def toString(): String
    Definition Classes
    AnyRef → Any
  68. def traceLocal[T](name: String)(f: => T): T

    Create a span that begins right before the function is called and ends immediately after the function completes.

    Create a span that begins right before the function is called and ends immediately after the function completes. This span will never have a corresponding remote component and is contained completely within the process it is created.

    Definition Classes
    Tracing
  69. def traceLocalFuture[T](name: String)(f: => Future[T]): Future[T]

    Create a span that begins right before the function is called and ends immediately after the async operation completes.

    Create a span that begins right before the function is called and ends immediately after the async operation completes. This span will never have a corresponding remote component and is contained completely within the process it is created.

    Definition Classes
    Tracing
  70. def traceLocalSpan(name: String, timestamp: Time, duration: Duration): Unit

    Create a span with the given name, timestamp and Duration.

    Create a span with the given name, timestamp and Duration. This is useful for debugging, or if you do not have complete control over the whole execution, e.g. you can not use traceLocalFuture.

    Definition Classes
    Tracing
  71. def traceLocalSpan(name: String, duration: Duration): Unit

    Create a span with the given name and Duration, with the end of the span at Time.now.

    Create a span with the given name and Duration, with the end of the span at Time.now.

    Definition Classes
    Tracing
  72. 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.

    Definition Classes
    Tracing
  73. def tracers: Seq[Tracer]

    returns

    the current list of tracers

    Definition Classes
    TraceTracing
  74. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  75. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  76. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. final def record(message: String, duration: Duration): Unit
    Definition Classes
    Tracing
    Annotations
    @deprecated
    Deprecated

    (Since version 2019-20-10) Use Trace#traceLocal instead

Inherited from Tracing

Inherited from AnyRef

Inherited from Any

Ungrouped