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 Summary

    Constructors
    Constructor
    Description
    CensusHttpModule(io.opencensus.trace.Tracer tracer, boolean isRecordEvents)
    Creates a CensusHttpModule with given parameters.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.google.api.client.http.HttpRequestInitializer
    getHttpRequestInitializer(com.google.api.client.http.HttpRequestInitializer initializer)
    Returns the HttpExecuteInterceptor used when initializing the HttpRequest.
    io.opencensus.trace.Tracer
    Returns the tracing component of OpenCensus.
    boolean
    Returns whether spans are stored locally.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public com.google.api.client.http.HttpRequestInitializer getHttpRequestInitializer(com.google.api.client.http.HttpRequestInitializer initializer)
      Returns the HttpExecuteInterceptor used when initializing the HttpRequest.
      Parameters:
      initializer - the original initializer which will be executed before this initializer.
      Returns:
      the HttpExecuteInterceptor.