Package

com.twitter.finagle.tracing

opencensus

Permalink

package opencensus

Visibility
  1. Public
  2. All

Type Members

  1. final class ClientTraceContextFilter[Req, Resp] extends SimpleFilter[Req, Resp]

    Permalink

    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's Future is satisfied.

    See also

    StackClientOps for client installation instructions.

  2. sealed trait LazySpan extends AnyRef

    Permalink

    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.

  3. final class ServerTraceContextFilter[Req, Resp] extends SimpleFilter[Req, Resp]

    Permalink

    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.

    See also

    StackServerOps for server installation instructions.

Value Members

  1. object ClientTraceContextFilter

    Permalink
  2. object LazySpan

    Permalink
  3. object ServerTraceContextFilter

    Permalink
  4. object StackClientOps

    Permalink

    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.

    Example:
    1. 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

    StackServerOps

  5. object StackServerOps

    Permalink

    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.

    Example:
    1. 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

    StackClientOps

  6. object TracingOps

    Permalink

    Scala syntax extensions for OpenCensus tracing.

    Scala syntax extensions for OpenCensus tracing.

    Example:
    1. 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
      }

Ungrouped