diff --git a/go.mod b/go.mod index 43fd7bbec8e6a6a79d3ce18aabe61e3dfa4b2362..6ad8c7d5edc632e2aa42cfbd8d124157008bb1ad 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module git.autistici.org/id/usermetadb go 1.14 require ( - git.autistici.org/ai3/go-common v0.0.0-20220816190733-e0ceb95832bc + git.autistici.org/ai3/go-common v0.0.0-20220817083651-2152f73e6a30 github.com/google/go-cmp v0.5.8 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect golang.org/x/sys v0.0.0-20220317061510-51cd9980dadf // indirect diff --git a/go.sum b/go.sum index cc801628f73c95abedc79d121fcfd84fe3022799..d9b4547ef3a9e61d679a55a1aa0bec368d8882e7 100644 --- a/go.sum +++ b/go.sum @@ -50,8 +50,8 @@ contrib.go.opencensus.io/exporter/stackdriver v0.13.5/go.mod h1:aXENhDJ1Y4lIg4EU contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE= contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA= 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-20220816190733-e0ceb95832bc h1:aWPCJUiyROs3ZmzG6Jo3kzO9Rb+xAXQek2rRBJA6Rgg= -git.autistici.org/ai3/go-common v0.0.0-20220816190733-e0ceb95832bc/go.mod h1:KckkZ6BZT7trRIKwnGoGj1DyfxywC/p+y2qHaQkT+xE= +git.autistici.org/ai3/go-common v0.0.0-20220817083651-2152f73e6a30 h1:0bAV2xv3Ss0gYFYtA3q6HScObUBb5YYofBeaW4JkIEQ= +git.autistici.org/ai3/go-common v0.0.0-20220817083651-2152f73e6a30/go.mod h1:KckkZ6BZT7trRIKwnGoGj1DyfxywC/p+y2qHaQkT+xE= 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 f563090094ec18af5312637b5aa9f381297ec215..f9cec22bd14e419a8c654cca46dd7b7e26a51bd2 100644 --- a/vendor/git.autistici.org/ai3/go-common/tracing/tracing.go +++ b/vendor/git.autistici.org/ai3/go-common/tracing/tracing.go @@ -19,16 +19,12 @@ import ( "go.opentelemetry.io/otel/sdk/resource" "go.opentelemetry.io/otel/sdk/trace" semconv "go.opentelemetry.io/otel/semconv/v1.12.0" - apitrace "go.opentelemetry.io/otel/trace" ) var ( // Enabled reports whether tracing is globally enabled or not. Enabled bool - // Global Tracer instance. - Tracer apitrace.Tracer - initOnce sync.Once ) @@ -116,6 +112,9 @@ func initTracing(serviceName string) { return } + // The sampling policy only applies to incoming requests for + // which tracing is not already enabled: in this case, we + // always pass-through. var sampler trace.Sampler switch config.Sample { case "", "always": @@ -132,13 +131,12 @@ func initTracing(serviceName string) { } tp := trace.NewTracerProvider( - trace.WithSampler(sampler), + trace.WithSampler(trace.ParentBased(sampler)), trace.WithBatcher(ze), trace.WithResource(defaultResource(serviceName)), ) otel.SetTracerProvider(tp) - Tracer = tp.Tracer(serviceName) otel.SetTextMapPropagator( propagation.NewCompositeTextMapPropagator( @@ -163,7 +161,7 @@ func Init() { // Must call Init() first. func WrapTransport(t http.RoundTripper) http.RoundTripper { if Enabled { - t = othttp.NewTransport(t, othttp.WithPublicEndpoint()) + t = othttp.NewTransport(t) } return t } @@ -178,7 +176,10 @@ func WrapHandler(h http.Handler, endpointAddr string) http.Handler { } // Format span names with the request URL path. - return othttp.NewHandler(h, serviceName, othttp.WithSpanNameFormatter(func(op string, r *http.Request) string { - return r.URL.Path - })) + return othttp.NewHandler( + h, serviceName, + othttp.WithSpanNameFormatter(func(op string, r *http.Request) string { + return r.URL.Path + }), + ) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 2a03873764b7b0c4b89a3c26e80eb4517b0234ab..38512f20a7104b74c53f00093a1f73f11aef4c2a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# git.autistici.org/ai3/go-common v0.0.0-20220816190733-e0ceb95832bc +# git.autistici.org/ai3/go-common v0.0.0-20220817083651-2152f73e6a30 ## explicit git.autistici.org/ai3/go-common git.autistici.org/ai3/go-common/clientutil