diff --git a/tracing/tracing.go b/tracing/tracing.go index 544ca1a0a0d917e47e7f06af2b75915fe4530f3b..d17852950e510088ccaa0bc1e279a41b5c4cdbd2 100644 --- a/tracing/tracing.go +++ b/tracing/tracing.go @@ -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)