diff --git a/go.mod b/go.mod index a0c286d099a8097af1fa6131e31de9f4a713f578..178297c64fb2bca70f71b2c03a9a93a49d478ab0 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.autistici.org/ai3/tools/assetmon go 1.15 require ( - git.autistici.org/ai3/go-common v0.0.0-20220814124137-4f7bac42fbdb + git.autistici.org/ai3/go-common v0.0.0-20220814151247-39e01d32d5ee github.com/google/subcommands v1.2.0 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect gopkg.in/yaml.v3 v3.0.1 diff --git a/go.sum b/go.sum index 37d83dbb3b7c6337231ee36d8f31e9b73dbc2f6e..d28e7ba5bf06802ced2c19143ee32f440a62cde9 100644 --- a/go.sum +++ b/go.sum @@ -52,6 +52,8 @@ contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcig dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= git.autistici.org/ai3/go-common v0.0.0-20220814124137-4f7bac42fbdb h1:SNnhiNFAy64wKkk+Wxq1lotFPvaQY8GP+Z27wqpIN8E= git.autistici.org/ai3/go-common v0.0.0-20220814124137-4f7bac42fbdb/go.mod h1:yhMB8VKJBBr+EKMft7MtqHVO73vkwdq/O5sVDTs/CNI= +git.autistici.org/ai3/go-common v0.0.0-20220814151247-39e01d32d5ee h1:EPfpfiG3vK9xoMt2sGclSaEXLikOCX1NfqUFRJXV4nk= +git.autistici.org/ai3/go-common v0.0.0-20220814151247-39e01d32d5ee/go.mod h1:yhMB8VKJBBr+EKMft7MtqHVO73vkwdq/O5sVDTs/CNI= github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU= github.com/Azure/azure-pipeline-go v0.2.1/go.mod h1:UGSo8XybXnIGZ3epmeBw7Jdz+HiUVpqIlpz/HKHylF4= github.com/Azure/azure-sdk-for-go v29.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= diff --git a/vendor/git.autistici.org/ai3/go-common/tracing/tracing.go b/vendor/git.autistici.org/ai3/go-common/tracing/tracing.go index d1b88b9df252b46cd02d35e88be022656d54ca46..d4185014b2b58f9308d72e56a247779f1c975641 100644 --- a/vendor/git.autistici.org/ai3/go-common/tracing/tracing.go +++ b/vendor/git.autistici.org/ai3/go-common/tracing/tracing.go @@ -148,6 +148,8 @@ func Init() { // WrapTransport optionally wraps a http.RoundTripper with OpenCensus // tracing functionality, if it is globally enabled. +// +// Must call Init() first. func WrapTransport(t http.RoundTripper) http.RoundTripper { if Enabled { t = othttp.NewTransport(t) @@ -158,10 +160,10 @@ func WrapTransport(t http.RoundTripper) http.RoundTripper { // WrapHandler wraps a http.Handler with OpenCensus tracing // functionality, if globally enabled. Automatically calls Init(). func WrapHandler(h http.Handler, endpointAddr string) http.Handler { - if Enabled { - serviceName := getServiceName() - initTracing(serviceName) - h = othttp.NewHandler(h, serviceName) + serviceName := getServiceName() + initTracing(serviceName) + if !Enabled { + return h } - return h + return othttp.NewHandler(h, serviceName) } diff --git a/vendor/modules.txt b/vendor/modules.txt index a9ba6c992b3c7a4f10ab649f7073c84e3d42802d..aa2c1dcccf23e5fb376da0203e6624865c2d3349 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# git.autistici.org/ai3/go-common v0.0.0-20220814124137-4f7bac42fbdb +# git.autistici.org/ai3/go-common v0.0.0-20220814151247-39e01d32d5ee ## explicit git.autistici.org/ai3/go-common git.autistici.org/ai3/go-common/clientutil