package opencensus
- Alphabetic
- Public
- Protected
Type Members
- final class ClientTraceContextFilter[Req, Resp] extends SimpleFilter[Req, Resp]
Adds an OpenCensus trace context that will be sent to the backend server using Finagle's broadcast contexts.
Adds an OpenCensus trace context that will be sent to the backend server using Finagle's broadcast contexts. The backend service should install a ServerTraceContextFilter to attach on to this.
A
Span
is created per request and is ended when the request'sFuture
is satisfied.- See also
StackClientOps for client installation instructions.
- sealed trait LazySpan extends AnyRef
An OpenCensus
Span
that is only started whenget()
is called.An OpenCensus
Span
that is only started whenget()
is called.Child spans can be created by calling
child(String)
. The first child span to be started will start the entire parent chain. - final class ServerTraceContextFilter[Req, Resp] extends SimpleFilter[Req, Resp]
Restoring an OpenCensus trace context sent by a ClientTraceContextFilter into the server's OpenCensus trace context.
Restoring an OpenCensus trace context sent by a ClientTraceContextFilter into the server's OpenCensus trace context.
A
Span
is created per request and is ended when the request'sFuture
is satisfied.- See also
StackServerOps for server installation instructions.
Value Members
- object ClientTraceContextFilter
- object LazySpan
- object ServerTraceContextFilter
- object StackClientOps
Syntax enhancements to Finagle clients to add OpenCensus tracing headers to requests.
Syntax enhancements to Finagle clients to add OpenCensus tracing headers to requests.
HTTP and ThriftMux protocols are supported.
Servers should also participate by using StackServerOps.
Scala:
import com.twitter.finagle.Http import com.twitter.finagle.tracing.opencensus.StackClientOps._ val clientWithOpenCensusTracing = Http.client.withOpenCensusTracing
Java users can explicitly use a StackClientOps class:
import com.twitter.finagle.Http; import com.twitter.finagle.tracing.opencensus.StackClientOps.HttpOpenCensusTracing; Http.Client clientWithOpenCensusTracing = new HttpOpenCensusTracing(Http.client()).withOpenCensusTracing();
- See also
Example: - object StackServerOps
Syntax enhancements to Finagle servers to attach OpenCensus tracing headers from requests.
Syntax enhancements to Finagle servers to attach OpenCensus tracing headers from requests.
HTTP and ThriftMux protocols are supported.
Clients should also participate by using StackClientOps.
Scala:
import com.twitter.finagle.Http import com.twitter.finagle.tracing.opencensus.StackServerOps._ val serverWithOpenCensusTracing = Http.server.withOpenCensusTracing
Java users can explicitly use a StackServerOps class:
import com.twitter.finagle.Http; import com.twitter.finagle.tracing.opencensus.StackServerOps.HttpOpenCensusTracing; Http.Server serverWithOpenCensusTracing = new HttpOpenCensusTracing(Http.server()).withOpenCensusTracing();
- See also
Example: - object TracingOps
Scala syntax extensions for OpenCensus tracing.
Scala syntax extensions for OpenCensus tracing.
import com.twitter.finagle.tracing.opencensus.TracingOps._ import io.opencensus.trace._ // run with this Span in the current context and ends // it when the returned Future is satisfied val span: Span = ??? span.scopedToFuture { // code that returns a com.twitter.util.Future } // run with this Span in the current context and ends // it when the block of code completes val span: Span = ??? span.scopedAndEnd { // code } // run the given code in a newly scoped Span val spanBuilder: SpanBuilder = ??? spanBuilder.runInScope { // code }
Example: