Package com.google.cloud.http
Class CensusHttpModule
java.lang.Object
com.google.cloud.http.CensusHttpModule
Provides utilities for Open Census to record http stats/trace information and propagate tracing
context.
-
Constructor Summary
ConstructorsConstructorDescriptionCensusHttpModule(io.opencensus.trace.Tracer tracer, boolean isRecordEvents) Creates aCensusHttpModulewith given parameters. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.api.client.http.HttpRequestInitializergetHttpRequestInitializer(com.google.api.client.http.HttpRequestInitializer initializer) Returns theHttpExecuteInterceptorused when initializing theHttpRequest.io.opencensus.trace.TracerReturns the tracing component of OpenCensus.booleanReturns whether spans are stored locally.
-
Constructor Details
-
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 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 theHttpExecuteInterceptorused when initializing theHttpRequest.- Parameters:
initializer- the original initializer which will be executed before this initializer.- Returns:
- the
HttpExecuteInterceptor.
-