package tracing
- Alphabetic
- Public
- All
Type Members
-
sealed
class
AnnotatingTracingFilter
[Req, Rep] extends SimpleFilter[Req, Rep]
A generic filter that can be used for annotating the Server and Client side of a trace.
A generic filter that can be used for annotating the Server and Client side of a trace. Finagle-specific trace information should live here.
- sealed trait Annotation extends AnyRef
-
class
BufferingTracer
extends Tracer with Iterable[Record]
A tracer that buffers each record in memory.
A tracer that buffers each record in memory. These may then be iterated over.
-
class
ClientDestTracingFilter
[Req, Rep] extends SimpleFilter[Req, Rep]
com.twitter.finagle.Filter for clients to record the remote address of the server.
com.twitter.finagle.Filter for clients to record the remote address of the server. We don't log the local addr here because it's already done in the client Dispatcher.
-
trait
ClientRequestTracingFilter
[Req, Res] extends SimpleFilter[Req, Res]
Adds the basic tracing information to a request.
Adds the basic tracing information to a request. Includes: rpc service name, method name, client sent and client received.
-
case class
Flags
(flags: Long) extends Product with Serializable
Represents flags that can be passed along in request headers.
Represents flags that can be passed along in request headers.
- flags
Initial flag state. May be 0.
-
class
NullTracer
extends Tracer
A no-op Tracer.
-
case class
Record
(traceId: TraceId, timestamp: Time, annotation: Annotation, duration: Option[Duration]) extends Product with Serializable
Records information of interest to the tracing system.
Records information of interest to the tracing system. For example when an event happened, the service name or ip addresses involved.
- traceId
Which trace is this record a part of?
- timestamp
When did the event happen?
- annotation
What kind of information should we record?
- duration
Did this event have a duration? For example: how long did a certain code block take to run
-
class
ServerDestTracingProxy
[Req, Rep] extends ServiceFactoryProxy[Req, Rep]
com.twitter.finagle.ServiceFactoryProxy used to trace the local addr and server addr.
-
final
class
SpanId
extends Proxy
Defines trace identifiers.
Defines trace identifiers. Span IDs name a particular (unique) span, while TraceIds contain a span ID as well as context (parentId and traceId).
-
final
case class
TraceId
(_traceId: Option[SpanId], _parentId: Option[SpanId], spanId: SpanId, _sampled: Option[Boolean], flags: Flags) extends Product with Serializable
A trace id represents one particular trace for one request.
A trace id represents one particular trace for one request.
A request is composed of one or more spans, which are generally RPCs but may be other in-process activity. The TraceId for each span is a tuple of three ids:
- a shared id common to all spans in an overall request (trace id) 2. an id unique to this part of the request (span id) 3. an id for the parent request that caused this span (parent id)
For example, when service M calls service N, they may have respective TraceIds like these:
TRACE ID SPAN ID PARENT ID SERVICE M e4bbb7c0f6a2ff07.a5f47e9fced314a2<:694eb2f05b8fd7d1 | | | +-----------------+ | | v v SERVICE N e4bbb7c0f6a2ff07.263edc9b65773b08<:a5f47e9fced314a2
Parent id and trace id are optional when constructing a TraceId because they are not present for the very first span in a request. In this case all three ids in the resulting TraceId are the same:
TRACE ID SPAN ID PARENT ID SERVICE A 34429b04b6bbf478.34429b04b6bbf478<:34429b04b6bbf478
- _traceId
The id for this request.
- _parentId
The id for the request one step up the service stack.
- spanId
The id for this particular request
- _sampled
Should we sample this request or not? True means sample, false means don't, none means we defer decision to someone further down in the stack.
- flags
Flags relevant to this request. Could be things like debug mode on/off. The sampled flag could eventually be moved in here.
-
class
TraceInitializerFilter
[Req, Rep] extends SimpleFilter[Req, Rep]
The TraceInitializerFilter takes care of span lifecycle events.
The TraceInitializerFilter takes care of span lifecycle events. It is always placed first in the service com.twitter.finagle.Filter chain (or last in the com.twitter.finagle.Stack) so that protocols with trace support will override the span resets, and still be properly reported here.
- Note
This should be replaced by per-codec trace initializers that is capable of parsing trace information out of the codec.
-
trait
Tracer
extends AnyRef
Tracers record trace events.
-
class
TracingLogHandler
extends Handler
A logging Handler that sends log information via tracing
Value Members
- object AnnotatingTracingFilter
- object Annotation
- object BroadcastTracer
-
object
ClientTracingFilter
Annotate the request with Client specific records (ClientSend, ClientRecv)
- object ConsoleTracer extends Tracer
- object DefaultTracer extends Tracer with Proxy
- object Flags extends Serializable
-
object
NullTracer
extends NullTracer
A singleton instance of a no-op NullTracer.
- object Record extends Serializable
-
object
ServerTracingFilter
Annotate the request with Server specific records (ServerRecv, ServerSend)
- object SpanId
-
object
Trace
This is a tracing system similar to Dapper:
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
maintains the state of the tracing stack The currentTraceId
has a terminal flag, indicating whether it can be overridden with a differentTraceId
. Setting the currentTraceId
as terminal forces all future annotations to share thatTraceId
. When reporting, we report to all tracers in the list ofTracer
s. - object TraceId extends Serializable
- object Tracer
- object debugTrace extends GlobalFlag[Boolean]