abstract class Tracing extends AnyRef
This is a tracing system similar to Dapper:
“Dapper, a Large-Scale Distributed Systems Tracing Infrastructure”, Benjamin H. Sigelman, Luiz André Barroso, Mike Burrows, Pat Stephenson, Manoj Plakal, Donald Beaver, Saul Jaspan, Chandan Shanbhag, 2010.
It is meant to be independent of whatever underlying RPC mechanism is being used, and it is up to the underlying codec to implement the transport.
Trace
(a singleton object) maintains the state of the tracing stack stored in
com.twitter.finagle.context.Contexts. 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 annotation to share that TraceId. When reporting,
we report to all tracers in the list of Tracer
s.
The Tracing API is structured in a way it's caller's responsibility to check
if the current stack of tracers is actively tracing (Trace.isActivelyTracing
)
to avoid unnecessarily allocations.
It's recommended to "capture" a Tracing instance while performing multiple tracing operations to minimize the number of com.twitter.finagle.context.Contexts lookups and increase throughput.
// Performs six context lookups (two for isActivelyTracing, two for each record call). if (Trace.isActivelyTracing()) { Trace.record("foo") Trace.record("foo") } // Performs just two context lookups and captures the results in the `Trace` instance. val trace = Trace() if (trace.isActivelyTracing) { trace.record("foo") trace.record("bar") }
- Note
Use
Trace.getInstance()
andTrace.newInstance()
in Java.
- Alphabetic
- By Inheritance
- Tracing
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new Tracing()
Abstract Value Members
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hasId: Boolean
True if there is an identifier for the current trace.
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- 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.
- 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.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def isTerminal: Boolean
Return true if the current trace id is terminal.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def nextId: TraceId
Create a derived id from the current TraceId.
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def record(message: String, duration: Duration): Unit
- final def record(message: String): Unit
- final def record(ann: Annotation, duration: Duration): Unit
- final def record(ann: Annotation): Unit
- 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.
- final def recordBinaries(annotations: Map[String, Any]): Unit
- final def recordBinary(key: String, value: Any): Unit
- final def recordClientAddr(ia: InetSocketAddress): Unit
- final def recordClientRecv(): Unit
- final def recordClientRecvError(error: String): Unit
- final def recordClientRecvFragment(): Unit
- final def recordClientSend(): Unit
- final def recordClientSendFrargmet(): Unit
- final def recordLocalAddr(ia: InetSocketAddress): Unit
- final def recordRpc(name: String): Unit
- final def recordServerAddr(ia: InetSocketAddress): Unit
- final def recordServerRecv(): Unit
- final def recordServerRecvFragment(): Unit
- final def recordServerSend(): Unit
- final def recordServerSendError(error: String): Unit
- final def recordServerSendFragment(): Unit
- final def recordServiceName(serviceName: String): Unit
- final def recordWireRecv(): Unit
- final def recordWireRecvError(error: String): Unit
- final def recordWireSend(): Unit
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()