Adds an OpenCensus trace context that will be sent to the backend server using Finagle's broadcast contexts.
An OpenCensus Span
that is only started when get()
is called.
An OpenCensus Span
that is only started when get()
is called.
Child spans can be created by calling child(String)
.
The first child span to be started will start the entire parent chain.
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's Future
is
satisfied.
StackServerOps for server installation instructions.
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();
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();
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 }
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.StackClientOps for client installation instructions.