Package com.google.cloud.http
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 aCensusHttpModulewith given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.api.client.http.HttpRequestInitializergetHttpRequestInitializer(com.google.api.client.http.HttpRequestInitializer initializer)Returns theHttpExecuteInterceptorused when initializing theHttpRequest.io.opencensus.trace.TracergetTracer()Returns the tracing component of OpenCensus.booleanisRecordEvents()Returns whether spans are stored locally.
-
-
-
Constructor Detail
-
CensusHttpModule
public CensusHttpModule(io.opencensus.trace.Tracer tracer, boolean isRecordEvents)Creates aCensusHttpModulewith given parameters.- Parameters:
tracer- the OpenCensusTracer.isRecordEvents- whether spans are stored locally.
-
-
Method Detail
-
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 theHttpExecuteInterceptorused when initializing theHttpRequest.- Parameters:
initializer- the original initializer which will be executed before this initializer.- Returns:
- the
HttpExecuteInterceptor.
-
-