Skip to content
Snippets Groups Projects
Commit be955ddc authored by ale's avatar ale
Browse files

Add an Init() method for client-only services

parent 438dda6c
No related branches found
Tags
No related merge requests found
......@@ -126,6 +126,11 @@ func initTracing(endpointAddr string) {
})
}
// Init tracing support, if not using WrapHandler.
func Init() {
initTracing("")
}
// WrapTransport optionally wraps a http.RoundTripper with OpenCensus
// tracing functionality, if it is globally enabled.
func WrapTransport(t http.RoundTripper) http.RoundTripper {
......@@ -136,7 +141,7 @@ func WrapTransport(t http.RoundTripper) http.RoundTripper {
}
// WrapHandler wraps a http.Handler with OpenCensus tracing
// functionality, if globally enabled.
// functionality, if globally enabled. Automatically calls Init().
func WrapHandler(h http.Handler, endpointAddr string) http.Handler {
if Enabled {
initTracing(endpointAddr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment