Class CensusHttpModule

java.lang.Object
com.google.cloud.http.CensusHttpModule

public final class CensusHttpModule extends Object
Provides utilities for Open Census to record http stats/trace information and propagate tracing context.
  • Constructor Details

    • CensusHttpModule

      public CensusHttpModule(io.opencensus.trace.Tracer tracer, boolean isRecordEvents)
      Creates a CensusHttpModule with given parameters.
      Parameters:
      tracer - the OpenCensus Tracer.
      isRecordEvents - whether spans are stored locally.
  • Method Details

    • getTracer

      public io.opencensus.trace.Tracer getTracer()
      Returns the tracing component of OpenCensus.
      Returns:
      the tracing component of OpenCensus.
    • isRecordEvents

      public boolean isRecordEvents()
      Returns whether spans are stored locally.
      Returns:
      whether spans are stored locally.
    • getHttpRequestInitializer

      Returns the HttpExecuteInterceptor used when initializing the HttpRequest.
      Parameters:
      initializer - the original initializer which will be executed before this initializer.
      Returns:
      the HttpExecuteInterceptor.