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
- Alphabetic
- By Inheritance
- Trace
- Tracing
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
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
- def apply(): Tracing
Returns a Tracing instance with captured Contexts so it's cheap to reuse.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def disable(): Unit
Turn trace recording off.
- def enable(): Unit
Turn trace recording on.
- 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 orTrace.disable()
API. - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[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.
- Definition Classes
- Tracing
- def idOption: Option[TraceId]
Get the current identifier, if it exists.
- 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.
- def letClear[R](f: => R): R
Run computation
f
with all tracing state (tracers, trace id) cleared. - 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
- 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. - def letTracer[R](tracer: Tracer)(f: => R): R
Run computation
f
withtracer
added onto the tracer stack. - 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 ontraceId
, one will be made usingtracer
.- terminal
true if the next traceId is a terminal id. Future attempts to set nextId will be ignored.
- 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.
- def letTracers[R](tracers: Seq[Tracer])(f: => R): R
Run computation
f
withtracers
added onto the tracer stack. - 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 peerId: TraceId
Create a derived id from the current TraceId.
- final def record(message: String): Unit
- Definition Classes
- Tracing
- final def record(ann: Annotation, duration: Duration): Unit
- Definition Classes
- Tracing
- final def record(ann: Annotation): Unit
- Definition Classes
- Tracing
- final def record(rec: Record): Unit
Record a raw Record.
- final def recordBinaries(annotations: Map[String, Any]): Unit
- Definition Classes
- Tracing
- final def recordBinary(key: String, value: Any): Unit
- Definition Classes
- Tracing
- 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
- final def recordClientAddr(ia: InetSocketAddress): Unit
- Definition Classes
- Tracing
- final def recordClientRecv(): Unit
- Definition Classes
- Tracing
- final def recordClientRecvError(error: String): Unit
- Definition Classes
- Tracing
- final def recordClientRecvFragment(): Unit
- Definition Classes
- Tracing
- final def recordClientSend(): Unit
- Definition Classes
- Tracing
- final def recordClientSendFragment(): Unit
- Definition Classes
- Tracing
- final def recordFilePath(filePath: String): Unit
- Definition Classes
- Tracing
- final def recordLineNumber(lineNumber: Int): Unit
- Definition Classes
- Tracing
- final def recordLocalAddr(ia: InetSocketAddress): Unit
- Definition Classes
- Tracing
- final def recordMethodName(methodName: String): Unit
- Definition Classes
- Tracing
- final def recordNamespace(namespace: String): Unit
- Definition Classes
- Tracing
- final def recordRpc(name: String): Unit
- Definition Classes
- Tracing
- final def recordServerAddr(ia: InetSocketAddress): Unit
- Definition Classes
- Tracing
- final def recordServerRecv(): Unit
- Definition Classes
- Tracing
- final def recordServerRecvFragment(): Unit
- Definition Classes
- Tracing
- final def recordServerSend(): Unit
- Definition Classes
- Tracing
- final def recordServerSendError(error: String): Unit
- Definition Classes
- Tracing
- final def recordServerSendFragment(): Unit
- Definition Classes
- Tracing
- final def recordServiceName(serviceName: String): Unit
- Definition Classes
- Tracing
- final def recordWireRecv(): Unit
- Definition Classes
- Tracing
- final def recordWireRecvError(error: String): Unit
- Definition Classes
- Tracing
- final def recordWireSend(): Unit
- Definition Classes
- Tracing
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- 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
- 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
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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
- 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
- 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
- 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
- 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
- def tracers: Seq[Tracer]
- 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()
Deprecated Value Members
- def LocalBeginAnnotation: String
- Annotations
- @deprecated
- Deprecated
(Since version 2022-06-09) Please use Tracing.LocalBeginAnnotation directly
- def LocalEndAnnotation: String
- Annotations
- @deprecated
- Deprecated
(Since version 2022-06-09) Please use Tracing.LocalEndAnnotation directly
- final def record(message: String, duration: Duration): Unit
- Definition Classes
- Tracing
- Annotations
- @deprecated
- Deprecated
(Since version 2019-20-10) Use Trace#traceLocal instead