From af2dfc7baf3392e81ea4b6938b3a8a5d39cf9db7 Mon Sep 17 00:00:00 2001 From: Anthony Mirabella Date: Fri, 9 Oct 2020 22:40:41 -0400 Subject: [PATCH] Pre release v0.13.0 (#391) * Prepare for v0.13.0 release * Update Jaeger propagator to new otel.TextMapPropagator interface * Update CHANGELOG.md for v0.13.0 release * Avoid setting global propagator in tests where it is not reset afterward --- CHANGELOG.md | 14 +++- contrib.go | 2 +- detectors/aws/go.mod | 4 +- detectors/aws/go.sum | 51 ++------------- detectors/gcp/gce.go | 2 +- detectors/gcp/go.mod | 4 +- detectors/gcp/go.sum | 8 +-- exporters/metric/cortex/example/go.mod | 8 +-- exporters/metric/cortex/example/go.sum | 12 ++-- exporters/metric/cortex/go.mod | 4 +- exporters/metric/cortex/go.sum | 12 ++-- exporters/metric/cortex/utils/go.mod | 2 +- exporters/metric/cortex/utils/go.sum | 12 ++-- exporters/metric/datadog/go.mod | 4 +- exporters/metric/datadog/go.sum | 56 ++-------------- exporters/metric/dogstatsd/go.mod | 4 +- exporters/metric/dogstatsd/go.sum | 56 ++-------------- go.mod | 2 +- go.sum | 4 +- .../sarama/otelsarama/consumer_test.go | 18 +++-- .../Shopify/sarama/otelsarama/dispatcher.go | 5 +- .../otelsarama/example/consumer/consumer.go | 3 +- .../Shopify/sarama/otelsarama/example/go.mod | 8 +-- .../Shopify/sarama/otelsarama/example/go.sum | 57 ++-------------- .../Shopify/sarama/otelsarama/example/init.go | 3 + .../otelsarama/example/producer/producer.go | 5 +- .../Shopify/sarama/otelsarama/go.mod | 4 +- .../Shopify/sarama/otelsarama/go.sum | 4 +- .../Shopify/sarama/otelsarama/message.go | 6 +- .../Shopify/sarama/otelsarama/option.go | 8 +-- .../Shopify/sarama/otelsarama/option_test.go | 2 +- .../Shopify/sarama/otelsarama/producer.go | 7 +- .../sarama/otelsarama/producer_test.go | 25 +++---- .../astaxie/beego/otelbeego/beego.go | 6 +- .../astaxie/beego/otelbeego/beego_test.go | 7 +- .../astaxie/beego/otelbeego/config.go | 8 +-- .../astaxie/beego/otelbeego/example/go.mod | 8 +-- .../astaxie/beego/otelbeego/example/go.sum | 19 ++---- .../beego/otelbeego/example/server/server.go | 3 + .../github.com/astaxie/beego/otelbeego/go.mod | 8 +-- .../github.com/astaxie/beego/otelbeego/go.sum | 4 +- .../memcache/otelmemcache/example/go.mod | 8 +-- .../memcache/otelmemcache/example/go.sum | 61 ++--------------- .../gomemcache/memcache/otelmemcache/go.mod | 4 +- .../gomemcache/memcache/otelmemcache/go.sum | 4 +- .../memcache/otelmemcache/gomemcache_test.go | 2 +- .../memcache/otelmemcache/status.go | 12 ++-- .../emicklei/go-restful/otelrestful/config.go | 6 +- .../go-restful/otelrestful/example/go.mod | 8 +-- .../go-restful/otelrestful/example/go.sum | 61 ++--------------- .../emicklei/go-restful/otelrestful/go.mod | 6 +- .../emicklei/go-restful/otelrestful/go.sum | 4 +- .../go-restful/otelrestful/restful.go | 5 +- .../go-restful/otelrestful/restful_test.go | 15 ++--- .../gin-gonic/gin/otelgin/example/go.mod | 8 +-- .../gin-gonic/gin/otelgin/example/go.sum | 59 ++--------------- .../gin-gonic/gin/otelgin/example/server.go | 3 + .../gin-gonic/gin/otelgin/gintrace.go | 7 +- .../gin-gonic/gin/otelgin/gintrace_test.go | 16 ++--- .../github.com/gin-gonic/gin/otelgin/go.mod | 6 +- .../github.com/gin-gonic/gin/otelgin/go.sum | 4 +- .../gin-gonic/gin/otelgin/option.go | 6 +- .../gocql/gocql/otelgocql/example/go.mod | 8 +-- .../gocql/gocql/otelgocql/example/go.sum | 22 +++---- .../github.com/gocql/gocql/otelgocql/go.mod | 4 +- .../github.com/gocql/gocql/otelgocql/go.sum | 4 +- .../github.com/gorilla/mux/otelmux/config.go | 6 +- .../gorilla/mux/otelmux/example/go.mod | 14 ++-- .../gorilla/mux/otelmux/example/go.sum | 65 ++----------------- .../gorilla/mux/otelmux/example/server.go | 3 + .../github.com/gorilla/mux/otelmux/go.mod | 6 +- .../github.com/gorilla/mux/otelmux/go.sum | 4 +- .../github.com/gorilla/mux/otelmux/mux.go | 8 +-- .../gorilla/mux/otelmux/mux_test.go | 15 ++--- .../labstack/echo/otelecho/config.go | 6 +- .../github.com/labstack/echo/otelecho/echo.go | 5 +- .../labstack/echo/otelecho/echo_test.go | 17 +++-- .../labstack/echo/otelecho/example/go.mod | 8 +-- .../labstack/echo/otelecho/example/go.sum | 58 ++--------------- .../labstack/echo/otelecho/example/server.go | 3 + .../github.com/labstack/echo/otelecho/go.mod | 6 +- .../github.com/labstack/echo/otelecho/go.sum | 4 +- .../mongo-driver/mongo/otelmongo/go.mod | 4 +- .../mongo-driver/mongo/otelmongo/go.sum | 4 +- .../grpc/otelgrpc/example/config/config.go | 3 + .../grpc/otelgrpc/example/go.mod | 13 ++-- .../grpc/otelgrpc/example/go.sum | 14 ++-- .../google.golang.org/grpc/otelgrpc/go.mod | 4 +- .../google.golang.org/grpc/otelgrpc/go.sum | 4 +- .../grpc/otelgrpc/grpctrace.go | 24 +++---- .../grpc/otelgrpc/interceptor.go | 18 ++--- .../grpc/otelgrpc/interceptor_test.go | 2 +- .../gopkg.in/macaron.v1/otelmacaron/config.go | 10 +-- .../macaron.v1/otelmacaron/example/go.mod | 8 +-- .../macaron.v1/otelmacaron/example/go.sum | 57 ++-------------- .../macaron.v1/otelmacaron/example/server.go | 3 + .../gopkg.in/macaron.v1/otelmacaron/go.mod | 6 +- .../gopkg.in/macaron.v1/otelmacaron/go.sum | 4 +- .../macaron.v1/otelmacaron/macaron.go | 3 +- .../macaron.v1/otelmacaron/macaron_test.go | 15 ++--- instrumentation/host/example/go.mod | 6 +- instrumentation/host/example/go.sum | 60 ++--------------- instrumentation/host/go.mod | 4 +- instrumentation/host/go.sum | 4 +- .../httptrace/otelhttptrace/clienttrace.go | 6 +- .../otelhttptrace/example/client/client.go | 10 +-- .../httptrace/otelhttptrace/example/go.mod | 10 +-- .../httptrace/otelhttptrace/example/go.sum | 63 ++---------------- .../otelhttptrace/example/server/server.go | 9 ++- .../net/http/httptrace/otelhttptrace/go.mod | 2 +- .../net/http/httptrace/otelhttptrace/go.sum | 4 +- .../http/httptrace/otelhttptrace/httptrace.go | 22 +++---- .../httptrace/otelhttptrace/httptrace_test.go | 18 ++--- instrumentation/net/http/otelhttp/config.go | 10 +-- .../http/otelhttp/example/client/client.go | 6 +- .../net/http/otelhttp/example/go.mod | 8 +-- .../net/http/otelhttp/example/go.sum | 63 ++---------------- .../http/otelhttp/example/server/server.go | 9 ++- instrumentation/net/http/otelhttp/go.mod | 4 +- instrumentation/net/http/otelhttp/go.sum | 4 +- instrumentation/net/http/otelhttp/handler.go | 6 +- .../net/http/otelhttp/handler_test.go | 5 +- .../net/http/otelhttp/transport.go | 10 +-- .../net/http/otelhttp/transport_test.go | 7 +- instrumentation/net/http/otelhttp/wrap.go | 6 +- instrumentation/runtime/example/go.mod | 6 +- instrumentation/runtime/example/go.sum | 61 ++--------------- instrumentation/runtime/go.mod | 4 +- instrumentation/runtime/go.sum | 4 +- propagators/b3/b3_example_test.go | 11 +--- propagators/b3/b3_integration_test.go | 10 ++- propagators/b3/b3_propagator.go | 38 +++++------ propagators/go.mod | 4 +- propagators/go.sum | 4 +- propagators/jaeger/jaeger_example_test.go | 6 +- propagators/jaeger/jaeger_integration_test.go | 4 +- propagators/jaeger/jaeger_propagator.go | 18 ++--- 137 files changed, 549 insertions(+), 1223 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f73b2346892..f6da0ad10b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,16 +8,25 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ## [Unreleased] +## [0.13.0] - 2020-10-09 + +## Added + +- A Jaeger propagator. (#375) + ## Changed -- The `go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc` package instrumentation no longer accepts a `Tracer` as an argument to the interceptor function. +- The `go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc` package instrumentation no longer accepts a `Tracer` as an argument to the interceptor function. Instead, a new `WithTracerProvider` option is added to configure the `TracerProvider` used when creating the `Tracer` for the instrumentation. (#373) +- The `go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron` instrumentation now accepts a `TracerProvider` rather than a `Tracer`. (#374) - Remove `go.opentelemetry.io/otel/sdk` dependency from instrumentation. (#381) +- Use `httpsnoop` in `go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux` to ensure `http.ResponseWriter` additional interfaces are preserved. (#388) ### Fixed - The `go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho.Middleware` no longer sends duplicate errors to the global `ErrorHandler`. (#377, #364) - The import comment in `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp` is now correctly quoted. (#379) +- The B3 propagator sets the sample bitmask when the sampling decision is `debug`. (#369) ## [0.12.0] - 2020-09-25 @@ -200,7 +209,8 @@ First official tagged release of `contrib` repository. - Prefix support for dogstatsd (#34) - Update Go Runtime package to use batch observer (#44) -[Unreleased]: https://github.com/open-telemetry/opentelemetry-go-contrib/compare/v0.12.0...HEAD +[Unreleased]: https://github.com/open-telemetry/opentelemetry-go-contrib/compare/v0.13.0...HEAD +[0.13.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.13.0 [0.12.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.12.0 [0.11.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.11.0 [0.10.1]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.10.1 diff --git a/contrib.go b/contrib.go index ab97820365c..0f288ae7904 100644 --- a/contrib.go +++ b/contrib.go @@ -18,7 +18,7 @@ package contrib // import "go.opentelemetry.io/contrib" // Version is the current release version of OpenTelemetry Contrib in use. func Version() string { - return "0.12.0" + return "0.13.0" // This string is updated by the pre_release.sh script during release } diff --git a/detectors/aws/go.mod b/detectors/aws/go.mod index b736cf0870d..478861f2ade 100644 --- a/detectors/aws/go.mod +++ b/detectors/aws/go.mod @@ -4,6 +4,6 @@ go 1.14 require ( github.com/aws/aws-sdk-go v1.35.2 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/detectors/aws/go.sum b/detectors/aws/go.sum index 996c013426d..5e5b2b6152b 100644 --- a/detectors/aws/go.sum +++ b/detectors/aws/go.sum @@ -1,26 +1,11 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/aws/aws-sdk-go v1.35.2 h1:qK+noh6b9KW+5CP1NmmWsQCUbnzucSGrjHEs69MEl6A= github.com/aws/aws-sdk-go v1.35.2/go.mod h1:H7NKnBqNVzoTJpGfLrQkkD+ytBA93eiDYi/+8rV9s48= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -31,52 +16,24 @@ github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfC github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/detectors/gcp/gce.go b/detectors/gcp/gce.go index 86bcecc0f65..ba7adde7021 100644 --- a/detectors/gcp/gce.go +++ b/detectors/gcp/gce.go @@ -77,7 +77,7 @@ func (gce *GCE) Detect(ctx context.Context) (*resource.Resource, error) { if hostname, err := os.Hostname(); hasProblem(err) { errInfo = append(errInfo, err.Error()) } else if hostname != "" { - labels = append(labels, semconv.HostHostNameKey.String(hostname)) + labels = append(labels, semconv.HostNameKey.String(hostname)) } if hostType, err := metadata.Get("instance/machine-type"); hasProblem(err) { diff --git a/detectors/gcp/go.mod b/detectors/gcp/go.mod index 9be78d2fdf3..e58f1ed44f8 100644 --- a/detectors/gcp/go.mod +++ b/detectors/gcp/go.mod @@ -4,6 +4,6 @@ go 1.14 require ( cloud.google.com/go v0.67.0 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/detectors/gcp/go.sum b/detectors/gcp/go.sum index 5b749827ee6..5b475c5ea94 100644 --- a/detectors/gcp/go.sum +++ b/detectors/gcp/go.sum @@ -136,10 +136,10 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/exporters/metric/cortex/example/go.mod b/exporters/metric/cortex/example/go.mod index 4af6ca1369b..3d50c0db584 100644 --- a/exporters/metric/cortex/example/go.mod +++ b/exporters/metric/cortex/example/go.mod @@ -8,9 +8,9 @@ replace ( ) require ( - go.opentelemetry.io/contrib/exporters/metric/cortex v0.12.0 - go.opentelemetry.io/contrib/exporters/metric/cortex/utils v0.12.0 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/contrib/exporters/metric/cortex v0.13.0 + go.opentelemetry.io/contrib/exporters/metric/cortex/utils v0.13.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 gopkg.in/yaml.v2 v2.2.5 // indirect ) diff --git a/exporters/metric/cortex/example/go.sum b/exporters/metric/cortex/example/go.sum index 1c62175abac..cf91b163441 100644 --- a/exporters/metric/cortex/example/go.sum +++ b/exporters/metric/cortex/example/go.sum @@ -76,7 +76,6 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -210,10 +209,10 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -335,9 +334,8 @@ google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= diff --git a/exporters/metric/cortex/go.mod b/exporters/metric/cortex/go.mod index 370b93839ca..065d077b1b1 100644 --- a/exporters/metric/cortex/go.mod +++ b/exporters/metric/cortex/go.mod @@ -9,6 +9,6 @@ require ( github.com/grpc-ecosystem/grpc-gateway v1.14.6 // indirect github.com/prometheus/prometheus v2.5.0+incompatible github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/exporters/metric/cortex/go.sum b/exporters/metric/cortex/go.sum index 599302e4fd8..8f201e33dc3 100644 --- a/exporters/metric/cortex/go.sum +++ b/exporters/metric/cortex/go.sum @@ -27,7 +27,6 @@ github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaW github.com/golang/snappy v0.0.2 h1:aeE13tS0IiQgFjYdoL8qN3K1N2bXXtI6Vi51/y7BpMw= github.com/golang/snappy v0.0.2/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -46,10 +45,10 @@ github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -90,9 +89,8 @@ google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZi google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/exporters/metric/cortex/utils/go.mod b/exporters/metric/cortex/utils/go.mod index 537106eb70b..bd059d47f31 100644 --- a/exporters/metric/cortex/utils/go.mod +++ b/exporters/metric/cortex/utils/go.mod @@ -8,5 +8,5 @@ require ( github.com/spf13/afero v1.4.0 github.com/spf13/viper v1.7.1 github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib/exporters/metric/cortex v0.12.0 + go.opentelemetry.io/contrib/exporters/metric/cortex v0.13.0 ) diff --git a/exporters/metric/cortex/utils/go.sum b/exporters/metric/cortex/utils/go.sum index 4bb0422d5e2..96d66a84ad0 100644 --- a/exporters/metric/cortex/utils/go.sum +++ b/exporters/metric/cortex/utils/go.sum @@ -76,7 +76,6 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -210,10 +209,10 @@ github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= @@ -336,9 +335,8 @@ google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ij google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= diff --git a/exporters/metric/datadog/go.mod b/exporters/metric/datadog/go.mod index cb2938db81d..ea19ea81724 100644 --- a/exporters/metric/datadog/go.mod +++ b/exporters/metric/datadog/go.mod @@ -5,6 +5,6 @@ go 1.14 require ( github.com/DataDog/datadog-go v3.7.2+incompatible github.com/DataDog/sketches-go v0.0.1 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/exporters/metric/datadog/go.sum b/exporters/metric/datadog/go.sum index f9807a41202..13b0cfb00c3 100644 --- a/exporters/metric/datadog/go.sum +++ b/exporters/metric/datadog/go.sum @@ -1,76 +1,28 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/datadog-go v3.7.2+incompatible h1:o4QtYjBU/rG58VPh8Ne6F65YiMY5/v5q4WdY/HvRYMQ= github.com/DataDog/datadog-go v3.7.2+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8= github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/exporters/metric/dogstatsd/go.mod b/exporters/metric/dogstatsd/go.mod index 80a490f998c..4249c74f8a4 100644 --- a/exporters/metric/dogstatsd/go.mod +++ b/exporters/metric/dogstatsd/go.mod @@ -4,6 +4,6 @@ go 1.14 require ( github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/exporters/metric/dogstatsd/go.sum b/exporters/metric/dogstatsd/go.sum index a94400d55f3..c9bf6170204 100644 --- a/exporters/metric/dogstatsd/go.sum +++ b/exporters/metric/dogstatsd/go.sum @@ -1,74 +1,26 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8= github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/go.mod b/go.mod index 305f9837b74..9b514238e15 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,6 @@ go 1.14 require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/kr/pretty v0.1.0 // indirect - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/otel v0.13.0 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect ) diff --git a/go.sum b/go.sum index feb0fd86f6d..f6d2c5e2280 100644 --- a/go.sum +++ b/go.sum @@ -14,8 +14,8 @@ github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/consumer_test.go b/instrumentation/github.com/Shopify/sarama/otelsarama/consumer_test.go index c472c207467..e3b5c2fb280 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/consumer_test.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/consumer_test.go @@ -24,10 +24,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "go.opentelemetry.io/otel/api/global" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" + otelpropagators "go.opentelemetry.io/otel/propagators" "go.opentelemetry.io/otel/semconv" mocktracer "go.opentelemetry.io/contrib/internal/trace" @@ -37,11 +36,8 @@ const ( topic = "test-topic" ) -var ( - propagators = global.Propagators() -) - func TestWrapPartitionConsumer(t *testing.T) { + propagators := otelpropagators.TraceContext{} // Mock provider provider, mt := NewTracerProviderAndTracer() @@ -53,12 +49,13 @@ func TestWrapPartitionConsumer(t *testing.T) { partitionConsumer, err := consumer.ConsumePartition(topic, 0, 0) require.NoError(t, err) - partitionConsumer = WrapPartitionConsumer(partitionConsumer, WithTracerProvider(provider)) + partitionConsumer = WrapPartitionConsumer(partitionConsumer, WithTracerProvider(provider), WithPropagators(propagators)) consumeAndCheck(t, mt, mockPartitionConsumer, partitionConsumer) } func TestWrapConsumer(t *testing.T) { + propagators := otelpropagators.TraceContext{} // Mock provider provider, mt := NewTracerProviderAndTracer() @@ -67,7 +64,7 @@ func TestWrapConsumer(t *testing.T) { mockPartitionConsumer := mockConsumer.ExpectConsumePartition(topic, 0, 0) // Wrap consumer - consumer := WrapConsumer(mockConsumer, WithTracerProvider(provider)) + consumer := WrapConsumer(mockConsumer, WithTracerProvider(provider), WithPropagators(propagators)) // Create partition consumer partitionConsumer, err := consumer.ConsumePartition(topic, 0, 0) @@ -80,7 +77,8 @@ func consumeAndCheck(t *testing.T, mt *mocktracer.Tracer, mockPartitionConsumer // Create message with span context ctx, _ := mt.Start(context.Background(), "") message := sarama.ConsumerMessage{Key: []byte("foo")} - propagation.InjectHTTP(ctx, propagators, NewConsumerMessageCarrier(&message)) + propagators := otelpropagators.TraceContext{} + propagators.Inject(ctx, NewConsumerMessageCarrier(&message)) // Produce message mockPartitionConsumer.YieldMessage(&message) @@ -137,7 +135,7 @@ func consumeAndCheck(t *testing.T, mt *mocktracer.Tracer, mockPartitionConsumer assert.Equal(t, expected.parentSpanID, span.ParentSpanID) - remoteSpanFromMessage := trace.RemoteSpanContextFromContext(propagation.ExtractHTTP(context.Background(), propagators, NewConsumerMessageCarrier(msgList[i]))) + remoteSpanFromMessage := trace.RemoteSpanContextFromContext(propagators.Extract(context.Background(), NewConsumerMessageCarrier(msgList[i]))) assert.Equal(t, span.SpanContext(), remoteSpanFromMessage, "span context should be injected into the consumer message headers") diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/dispatcher.go b/instrumentation/github.com/Shopify/sarama/otelsarama/dispatcher.go index 420f3e7a24e..15733a903ef 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/dispatcher.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/dispatcher.go @@ -20,7 +20,6 @@ import ( "github.com/Shopify/sarama" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" "go.opentelemetry.io/otel/semconv" @@ -57,7 +56,7 @@ func (w *consumerMessagesDispatcherWrapper) Run() { for msg := range msgs { // Extract a span context from message to link. carrier := NewConsumerMessageCarrier(msg) - parentSpanContext := propagation.ExtractHTTP(context.Background(), w.cfg.Propagators, carrier) + parentSpanContext := w.cfg.Propagators.Extract(context.Background(), carrier) // Create a span. attrs := []label.KeyValue{ @@ -75,7 +74,7 @@ func (w *consumerMessagesDispatcherWrapper) Run() { newCtx, span := w.cfg.Tracer.Start(parentSpanContext, "kafka.consume", opts...) // Inject current span context, so consumers can use it to propagate span. - propagation.InjectHTTP(newCtx, w.cfg.Propagators, carrier) + w.cfg.Propagators.Inject(newCtx, carrier) // Send messages back to user. w.messages <- msg diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/example/consumer/consumer.go b/instrumentation/github.com/Shopify/sarama/otelsarama/example/consumer/consumer.go index af814d25be3..a78aafcacc2 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/example/consumer/consumer.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/example/consumer/consumer.go @@ -25,7 +25,6 @@ import ( "github.com/Shopify/sarama" "go.opentelemetry.io/otel/api/global" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/semconv" @@ -77,7 +76,7 @@ func startConsumerGroup(brokerList []string) { func printMessage(msg *sarama.ConsumerMessage) { // Extract tracing info from message - ctx := propagation.ExtractHTTP(context.Background(), global.Propagators(), otelsarama.NewConsumerMessageCarrier(msg)) + ctx := global.TextMapPropagator().Extract(context.Background(), otelsarama.NewConsumerMessageCarrier(msg)) tr := global.Tracer("consumer") _, span := tr.Start(ctx, "consume message", trace.WithAttributes( diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.mod b/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.mod index aa8d8b90755..8746e898a04 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.mod +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.mod @@ -9,8 +9,8 @@ replace ( require ( github.com/Shopify/sarama v1.27.0 - go.opentelemetry.io/contrib/instrumentation/github.com/Shopify/sarama/otelsarama v0.12.0 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/exporters/stdout v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/contrib/instrumentation/github.com/Shopify/sarama/otelsarama v0.13.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/exporters/stdout v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.sum b/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.sum index b3d6197b758..0c77d3c2477 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.sum +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/example/go.sum @@ -1,5 +1,3 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8= github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/Shopify/sarama v1.27.0 h1:tqo2zmyzPf1+gwTTwhI6W+EXDw4PVSczynpHKFtVAmo= @@ -8,9 +6,6 @@ github.com/Shopify/toxiproxy v2.1.4+incompatible h1:TKdv8HiTLgE5wdJuEML90aBgNWso github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -21,22 +16,12 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8 github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/frankban/quicktest v1.10.0 h1:Gfh+GAJZOAoKZsIZeZbdn2JF10kN1XHNvjsvQK8gVkE= github.com/frankban/quicktest v1.10.0/go.mod h1:ui7WezCLWMWxVWr1GETZY3smRy0G4KWq9vcPtJmFl7Y= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= @@ -63,7 +48,6 @@ github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUM github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 h1:MkV+77GLUNo5oJ0jf870itWm3D0Sjh7+Za9gazKc5LQ= github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -72,53 +56,26 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/exporters/stdout v0.12.0 h1:ji9VVPmKg+oONcqwULcO0AHZseGU6CFOIdvwKCxNZ9Y= -go.opentelemetry.io/otel/exporters/stdout v0.12.0/go.mod h1:IGUi+IGDXlxXo7nYuPrxfAEpqTcKsWqFtflwFMGGPZQ= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/exporters/stdout v0.13.0 h1:A+XiGIPQbGoJoBOJfKAKnZyiUSjSWvL3XWETUvtom5k= +go.opentelemetry.io/otel/exporters/stdout v0.13.0/go.mod h1:JJt8RpNY6K+ft9ir3iKpceCvT/rhzJXEExGrWFCbv1o= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200528225125-3c3fba18258b h1:IYiJPiJfzktmDAO1HQiwjMjwjlYKHAL7KzeD544RJPs= golang.org/x/net v0.0.0-20200528225125-3c3fba18258b/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -138,5 +95,3 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20200601152816-913338de1bd2 h1:VEmvx0P+GVTgkNu2EdTN988YCZPcD3lo9AoczZpucwc= gopkg.in/yaml.v3 v3.0.0-20200601152816-913338de1bd2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/example/init.go b/instrumentation/github.com/Shopify/sarama/otelsarama/example/init.go index d2147e5bb9a..07a1cb95a78 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/example/init.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/example/init.go @@ -17,8 +17,10 @@ package example import ( "log" + "go.opentelemetry.io/otel" otelglobal "go.opentelemetry.io/otel/api/global" "go.opentelemetry.io/otel/exporters/stdout" + "go.opentelemetry.io/otel/propagators" sdktrace "go.opentelemetry.io/otel/sdk/trace" ) @@ -42,4 +44,5 @@ func InitTracer() { log.Fatal(err) } otelglobal.SetTracerProvider(tp) + otelglobal.SetTextMapPropagator(otel.NewCompositeTextMapPropagator(propagators.TraceContext{})) } diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/example/producer/producer.go b/instrumentation/github.com/Shopify/sarama/otelsarama/example/producer/producer.go index 393dd785ea2..b5de265c999 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/example/producer/producer.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/example/producer/producer.go @@ -29,7 +29,6 @@ import ( "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/api/global" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/contrib/instrumentation/github.com/Shopify/sarama/otelsarama" "go.opentelemetry.io/contrib/instrumentation/github.com/Shopify/sarama/otelsarama/example" @@ -66,7 +65,7 @@ func main() { Key: sarama.StringEncoder("random_number"), Value: sarama.StringEncoder(fmt.Sprintf("%d", rand.Intn(1000))), } - propagation.InjectHTTP(ctx, global.Propagators(), otelsarama.NewProducerMessageCarrier(&msg)) + global.TextMapPropagator().Inject(ctx, otelsarama.NewProducerMessageCarrier(&msg)) producer.Input() <- &msg successMsg := <-producer.Successes() @@ -74,7 +73,7 @@ func main() { err := producer.Close() if err != nil { - span.SetStatus(codes.Internal, err.Error()) + span.SetStatus(codes.Error, err.Error()) log.Fatalln("Failed to close producer:", err) } } diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/go.mod b/instrumentation/github.com/Shopify/sarama/otelsarama/go.mod index d8e80caa090..dd93a8875fa 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/go.mod +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/go.mod @@ -7,6 +7,6 @@ replace go.opentelemetry.io/contrib => ../../../../.. require ( github.com/Shopify/sarama v1.27.0 github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/otel v0.13.0 ) diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/go.sum b/instrumentation/github.com/Shopify/sarama/otelsarama/go.sum index e87df13d94f..554854e9eaa 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/go.sum +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/go.sum @@ -51,8 +51,8 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37 h1:cg5LA/zNPRzIXIWSCxQW10Rvpy94aQh3LT/ShoCpkHw= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/message.go b/instrumentation/github.com/Shopify/sarama/otelsarama/message.go index 25bfecee661..343ab0493e6 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/message.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/message.go @@ -17,11 +17,11 @@ package otelsarama import ( "github.com/Shopify/sarama" - "go.opentelemetry.io/otel/api/propagation" + "go.opentelemetry.io/otel" ) -var _ propagation.HTTPSupplier = (*ProducerMessageCarrier)(nil) -var _ propagation.HTTPSupplier = (*ConsumerMessageCarrier)(nil) +var _ otel.TextMapCarrier = (*ProducerMessageCarrier)(nil) +var _ otel.TextMapCarrier = (*ConsumerMessageCarrier)(nil) // ProducerMessageCarrier injects and extracts traces from a sarama.ProducerMessage. type ProducerMessageCarrier struct { diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/option.go b/instrumentation/github.com/Shopify/sarama/otelsarama/option.go index 9116dd4546a..40d4322ae74 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/option.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/option.go @@ -15,8 +15,8 @@ package otelsarama import ( + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/global" - otelpropagation "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" ) @@ -29,7 +29,7 @@ const ( type config struct { TracerProvider trace.TracerProvider - Propagators otelpropagation.Propagators + Propagators otel.TextMapPropagator Tracer trace.Tracer } @@ -37,7 +37,7 @@ type config struct { // newConfig returns a config with all Options set. func newConfig(opts ...Option) config { cfg := config{ - Propagators: global.Propagators(), + Propagators: global.TextMapPropagator(), TracerProvider: global.TracerProvider(), } for _, opt := range opts { @@ -63,7 +63,7 @@ func WithTracerProvider(provider trace.TracerProvider) Option { // WithPropagators specifies propagators to use for extracting // information from the HTTP requests. If none are specified, global // ones will be used. -func WithPropagators(propagators otelpropagation.Propagators) Option { +func WithPropagators(propagators otel.TextMapPropagator) Option { return func(cfg *config) { cfg.Propagators = propagators } diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/option_test.go b/instrumentation/github.com/Shopify/sarama/otelsarama/option_test.go index f1f2ab6a613..bb1a3cb5209 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/option_test.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/option_test.go @@ -36,7 +36,7 @@ func TestNewConfig(t *testing.T) { expected: config{ TracerProvider: global.TracerProvider(), Tracer: global.TracerProvider().Tracer(defaultTracerName), - Propagators: global.Propagators(), + Propagators: global.TextMapPropagator(), }, }, { diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/producer.go b/instrumentation/github.com/Shopify/sarama/otelsarama/producer.go index ed148331b88..4b1361985e4 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/producer.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/producer.go @@ -22,7 +22,6 @@ import ( "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" "go.opentelemetry.io/otel/semconv" @@ -231,7 +230,7 @@ func WrapAsyncProducer(saramaConfig *sarama.Config, p sarama.AsyncProducer, opts func startProducerSpan(cfg config, version sarama.KafkaVersion, msg *sarama.ProducerMessage) trace.Span { // If there's a span context in the message, use that as the parent context. carrier := NewProducerMessageCarrier(msg) - ctx := propagation.ExtractHTTP(context.Background(), cfg.Propagators, carrier) + ctx := cfg.Propagators.Extract(context.Background(), carrier) // Create a span. attrs := []label.KeyValue{ @@ -247,7 +246,7 @@ func startProducerSpan(cfg config, version sarama.KafkaVersion, msg *sarama.Prod if version.IsAtLeast(sarama.V0_11_0_0) { // Inject current span context, so consumers can use it to propagate span. - propagation.InjectHTTP(ctx, cfg.Propagators, carrier) + cfg.Propagators.Inject(ctx, carrier) } return span @@ -259,7 +258,7 @@ func finishProducerSpan(span trace.Span, partition int32, offset int64, err erro kafkaPartitionKey.Int32(partition), ) if err != nil { - span.SetStatus(codes.Internal, err.Error()) + span.SetStatus(codes.Error, err.Error()) } span.End() } diff --git a/instrumentation/github.com/Shopify/sarama/otelsarama/producer_test.go b/instrumentation/github.com/Shopify/sarama/otelsarama/producer_test.go index 4ffd71336fa..de72ae86c09 100644 --- a/instrumentation/github.com/Shopify/sarama/otelsarama/producer_test.go +++ b/instrumentation/github.com/Shopify/sarama/otelsarama/producer_test.go @@ -26,9 +26,9 @@ import ( "go.opentelemetry.io/otel/codes" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" + otelpropagators "go.opentelemetry.io/otel/propagators" "go.opentelemetry.io/otel/semconv" mocktracer "go.opentelemetry.io/contrib/internal/trace" @@ -42,6 +42,7 @@ func NewTracerProviderAndTracer() (*mocktracer.TracerProvider, *mocktracer.Trace } func TestWrapSyncProducer(t *testing.T) { + propagators := otelpropagators.TraceContext{} var err error // Mock provider @@ -52,12 +53,12 @@ func TestWrapSyncProducer(t *testing.T) { mockSyncProducer := mocks.NewSyncProducer(t, cfg) // Wrap sync producer - syncProducer := WrapSyncProducer(cfg, mockSyncProducer, WithTracerProvider(provider)) + syncProducer := WrapSyncProducer(cfg, mockSyncProducer, WithTracerProvider(provider), WithPropagators(propagators)) // Create message with span context ctx, _ := mt.Start(context.Background(), "") messageWithSpanContext := sarama.ProducerMessage{Topic: topic, Key: sarama.StringEncoder("foo")} - propagation.InjectHTTP(ctx, propagators, NewProducerMessageCarrier(&messageWithSpanContext)) + propagators.Inject(ctx, NewProducerMessageCarrier(&messageWithSpanContext)) // Expected expectedList := []struct { @@ -142,17 +143,18 @@ func TestWrapSyncProducer(t *testing.T) { } // Check tracing propagation - remoteSpanFromMessage := trace.RemoteSpanContextFromContext(propagation.ExtractHTTP(context.Background(), propagators, NewProducerMessageCarrier(msg))) + remoteSpanFromMessage := trace.RemoteSpanContextFromContext(propagators.Extract(context.Background(), NewProducerMessageCarrier(msg))) assert.True(t, remoteSpanFromMessage.IsValid()) } } func TestWrapAsyncProducer(t *testing.T) { + propagators := otelpropagators.TraceContext{} // Create message with span context createMessages := func(mt *mocktracer.Tracer) []*sarama.ProducerMessage { ctx, _ := mt.Start(context.Background(), "") messageWithSpanContext := sarama.ProducerMessage{Topic: topic, Key: sarama.StringEncoder("foo")} - propagation.InjectHTTP(ctx, propagators, NewProducerMessageCarrier(&messageWithSpanContext)) + propagators.Inject(ctx, NewProducerMessageCarrier(&messageWithSpanContext)) mt.EndedSpans() return []*sarama.ProducerMessage{ @@ -167,7 +169,7 @@ func TestWrapAsyncProducer(t *testing.T) { cfg := newSaramaConfig() mockAsyncProducer := mocks.NewAsyncProducer(t, cfg) - ap := WrapAsyncProducer(cfg, mockAsyncProducer, WithTracerProvider(provider)) + ap := WrapAsyncProducer(cfg, mockAsyncProducer, WithTracerProvider(provider), WithPropagators(propagators)) msgList := createMessages(mt) // Send message @@ -223,7 +225,7 @@ func TestWrapAsyncProducer(t *testing.T) { } // Check tracing propagation - remoteSpanFromMessage := trace.RemoteSpanContextFromContext(propagation.ExtractHTTP(context.Background(), propagators, NewProducerMessageCarrier(msg))) + remoteSpanFromMessage := trace.RemoteSpanContextFromContext(propagators.Extract(context.Background(), NewProducerMessageCarrier(msg))) assert.True(t, remoteSpanFromMessage.IsValid()) } }) @@ -237,7 +239,7 @@ func TestWrapAsyncProducer(t *testing.T) { cfg.Producer.Return.Successes = true mockAsyncProducer := mocks.NewAsyncProducer(t, cfg) - ap := WrapAsyncProducer(cfg, mockAsyncProducer, WithTracerProvider(provider)) + ap := WrapAsyncProducer(cfg, mockAsyncProducer, WithTracerProvider(provider), WithPropagators(propagators)) msgList := createMessages(mt) // Send message @@ -300,13 +302,14 @@ func TestWrapAsyncProducer(t *testing.T) { assert.Equal(t, i, msg.Metadata) // Check tracing propagation - remoteSpanFromMessage := trace.RemoteSpanContextFromContext(propagation.ExtractHTTP(context.Background(), propagators, NewProducerMessageCarrier(msg))) + remoteSpanFromMessage := trace.RemoteSpanContextFromContext(propagators.Extract(context.Background(), NewProducerMessageCarrier(msg))) assert.True(t, remoteSpanFromMessage.IsValid()) } }) } func TestWrapAsyncProducerError(t *testing.T) { + propagators := otelpropagators.TraceContext{} // Mock provider provider, mt := NewTracerProviderAndTracer() @@ -315,7 +318,7 @@ func TestWrapAsyncProducerError(t *testing.T) { cfg.Producer.Return.Successes = true mockAsyncProducer := mocks.NewAsyncProducer(t, cfg) - ap := WrapAsyncProducer(cfg, mockAsyncProducer, WithTracerProvider(provider)) + ap := WrapAsyncProducer(cfg, mockAsyncProducer, WithTracerProvider(provider), WithPropagators(propagators)) mockAsyncProducer.ExpectInputAndFail(errors.New("test")) ap.Input() <- &sarama.ProducerMessage{Topic: topic, Key: sarama.StringEncoder("foo2")} @@ -330,7 +333,7 @@ func TestWrapAsyncProducerError(t *testing.T) { span := spanList[0] - assert.Equal(t, codes.Internal, span.Status) + assert.Equal(t, codes.Error, span.Status) assert.Equal(t, "test", span.StatusMessage) } diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/beego.go b/instrumentation/github.com/astaxie/beego/otelbeego/beego.go index 5a32722bd98..1d9cdd4e5f1 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/beego.go +++ b/instrumentation/github.com/astaxie/beego/otelbeego/beego.go @@ -103,7 +103,7 @@ func Render(c *beego.Controller) error { err := c.Render() if err != nil { span.RecordError(ctx, err) - span.SetStatus(codes.Internal, "template failure") + span.SetStatus(codes.Error, "template failure") } return err } @@ -118,7 +118,7 @@ func RenderString(c *beego.Controller) (string, error) { str, err := c.RenderString() if err != nil { span.RecordError(ctx, err) - span.SetStatus(codes.Internal, "render string failure") + span.SetStatus(codes.Error, "render string failure") } return str, err } @@ -133,7 +133,7 @@ func RenderBytes(c *beego.Controller) ([]byte, error) { bytes, err := c.RenderBytes() if err != nil { span.RecordError(ctx, err) - span.SetStatus(codes.Internal, "render bytes failure") + span.SetStatus(codes.Error, "render bytes failure") } return bytes, err } diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/beego_test.go b/instrumentation/github.com/astaxie/beego/otelbeego/beego_test.go index 824b8e11ae0..cc63fa781db 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/beego_test.go +++ b/instrumentation/github.com/astaxie/beego/otelbeego/beego_test.go @@ -26,8 +26,8 @@ import ( "strings" "testing" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/global" - prop "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" "go.opentelemetry.io/otel/semconv" @@ -503,10 +503,7 @@ var testCases = []*testCase{ method: http.MethodGet, path: "/", options: []Option{ - WithPropagators(prop.New( - prop.WithExtractors(b3.B3{}), - prop.WithInjectors(b3.B3{}), - )), + WithPropagators(otel.NewCompositeTextMapPropagator(b3.B3{})), }, hasSpan: true, expectedSpanName: "/", diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/config.go b/instrumentation/github.com/astaxie/beego/otelbeego/config.go index ac56efb5297..76b3c41c2f1 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/config.go +++ b/instrumentation/github.com/astaxie/beego/otelbeego/config.go @@ -15,9 +15,9 @@ package otelbeego import ( + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/global" "go.opentelemetry.io/otel/api/metric" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" ) @@ -26,7 +26,7 @@ import ( type config struct { tracerProvider trace.TracerProvider meterProvider metric.MeterProvider - propagators propagation.Propagators + propagators otel.TextMapPropagator filters []Filter formatter SpanNameFormatter } @@ -65,7 +65,7 @@ func WithMeterProvider(provider metric.MeterProvider) Option { // WithPropagators sets the propagators used in the middleware. // Defaults to global.Propagators(). -func WithPropagators(propagators propagation.Propagators) OptionFunc { +func WithPropagators(propagators otel.TextMapPropagator) OptionFunc { return OptionFunc(func(c *config) { c.propagators = propagators }) @@ -93,7 +93,7 @@ func newConfig(options ...Option) *config { config := &config{ tracerProvider: global.TracerProvider(), meterProvider: global.MeterProvider(), - propagators: global.Propagators(), + propagators: global.TextMapPropagator(), filters: []Filter{}, formatter: defaultSpanNameFormatter, } diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/example/go.mod b/instrumentation/github.com/astaxie/beego/otelbeego/example/go.mod index 9960a1ee846..f0a687fa178 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/example/go.mod +++ b/instrumentation/github.com/astaxie/beego/otelbeego/example/go.mod @@ -11,8 +11,8 @@ replace ( require ( github.com/astaxie/beego v1.12.2 - go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego v0.12.0 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/exporters/stdout v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego v0.13.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/exporters/stdout v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/example/go.sum b/instrumentation/github.com/astaxie/beego/otelbeego/example/go.sum index 9f494ce6d4d..973b9e02589 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/example/go.sum +++ b/instrumentation/github.com/astaxie/beego/otelbeego/example/go.sum @@ -26,7 +26,6 @@ github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+ github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/couchbase/go-couchbase v0.0.0-20200519150804-63f3cdb75e0d/go.mod h1:TWI8EKQMs5u5jLKW/tsb9VwauIrMIxQG1r5fMsswK5U= github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:srVSlQLB8iXBVXHgnqemxUXqN6FCvClgCMPCsjBDR7c= github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs= @@ -38,9 +37,7 @@ github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI= github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk= github.com/elazarl/go-bindata-assetfs v1.0.0/go.mod h1:v+YaWX3bdea5J/mo8dSETolEo7R71Vk1u8bnjau5yw4= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= @@ -59,7 +56,6 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -151,12 +147,12 @@ github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2K github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc= github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/exporters/stdout v0.12.0 h1:ji9VVPmKg+oONcqwULcO0AHZseGU6CFOIdvwKCxNZ9Y= -go.opentelemetry.io/otel/exporters/stdout v0.12.0/go.mod h1:IGUi+IGDXlxXo7nYuPrxfAEpqTcKsWqFtflwFMGGPZQ= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/exporters/stdout v0.13.0 h1:A+XiGIPQbGoJoBOJfKAKnZyiUSjSWvL3XWETUvtom5k= +go.opentelemetry.io/otel/exporters/stdout v0.13.0/go.mod h1:JJt8RpNY6K+ft9ir3iKpceCvT/rhzJXEExGrWFCbv1o= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= @@ -221,10 +217,7 @@ google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaR google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/example/server/server.go b/instrumentation/github.com/astaxie/beego/otelbeego/example/server/server.go index dcb2f03afa4..c3b62c530ce 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/example/server/server.go +++ b/instrumentation/github.com/astaxie/beego/otelbeego/example/server/server.go @@ -21,9 +21,11 @@ import ( "go.opentelemetry.io/contrib/instrumentation/github.com/astaxie/beego/otelbeego" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/global" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/exporters/stdout" + "go.opentelemetry.io/otel/propagators" "go.opentelemetry.io/otel/sdk/resource" sdktrace "go.opentelemetry.io/otel/sdk/trace" "go.opentelemetry.io/otel/semconv" @@ -65,6 +67,7 @@ func initTracer() { log.Fatal(err) } global.SetTracerProvider(tp) + global.SetTextMapPropagator(otel.NewCompositeTextMapPropagator(propagators.TraceContext{}, propagators.Baggage{})) } func main() { diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/go.mod b/instrumentation/github.com/astaxie/beego/otelbeego/go.mod index 4083bdacfd0..022a1158703 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/go.mod +++ b/instrumentation/github.com/astaxie/beego/otelbeego/go.mod @@ -11,10 +11,10 @@ replace ( require ( github.com/astaxie/beego v1.12.2 github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.12.0 - go.opentelemetry.io/contrib/propagators v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.13.0 + go.opentelemetry.io/contrib/propagators v0.13.0 + go.opentelemetry.io/otel v0.13.0 golang.org/x/net v0.0.0-20200707034311-ab3426394381 // indirect golang.org/x/sys v0.0.0-20200803210538-64077c9b5642 // indirect golang.org/x/text v0.3.3 // indirect diff --git a/instrumentation/github.com/astaxie/beego/otelbeego/go.sum b/instrumentation/github.com/astaxie/beego/otelbeego/go.sum index 59074d70f5d..4a4ddab86fc 100644 --- a/instrumentation/github.com/astaxie/beego/otelbeego/go.sum +++ b/instrumentation/github.com/astaxie/beego/otelbeego/go.sum @@ -143,8 +143,8 @@ github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2K github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc= github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= diff --git a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.mod b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.mod index eda6f0ad074..2459951af0e 100644 --- a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.mod +++ b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.mod @@ -9,8 +9,8 @@ replace ( require ( github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b - go.opentelemetry.io/contrib/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache v0.12.0 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/exporters/stdout v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/contrib/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache v0.13.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/exporters/stdout v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.sum b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.sum index b2d348c36b7..9fdfd8d6623 100644 --- a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.sum +++ b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/example/go.sum @@ -1,28 +1,12 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8= github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b h1:L/QXpzIa3pOvUGt1D1lA5KjYhPBAN/3iWdP7xeFS9F0= github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -34,52 +18,19 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/exporters/stdout v0.12.0 h1:ji9VVPmKg+oONcqwULcO0AHZseGU6CFOIdvwKCxNZ9Y= -go.opentelemetry.io/otel/exporters/stdout v0.12.0/go.mod h1:IGUi+IGDXlxXo7nYuPrxfAEpqTcKsWqFtflwFMGGPZQ= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/exporters/stdout v0.13.0 h1:A+XiGIPQbGoJoBOJfKAKnZyiUSjSWvL3XWETUvtom5k= +go.opentelemetry.io/otel/exporters/stdout v0.13.0/go.mod h1:JJt8RpNY6K+ft9ir3iKpceCvT/rhzJXEExGrWFCbv1o= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.mod b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.mod index 50d21dbbcbe..c2e4a98b8d9 100644 --- a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.mod +++ b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.mod @@ -7,6 +7,6 @@ replace go.opentelemetry.io/contrib => ../../../../../../ require ( github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/otel v0.13.0 ) diff --git a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.sum b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.sum index d8bc545463a..05faa66acf8 100644 --- a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.sum +++ b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/go.sum @@ -16,8 +16,8 @@ github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/gomemcache_test.go b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/gomemcache_test.go index bd4ca5eb20d..5e2decbc467 100644 --- a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/gomemcache_test.go +++ b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/gomemcache_test.go @@ -96,7 +96,7 @@ func TestOperationWithCacheMissError(t *testing.T) { } assert.Equal(t, expectedLabelMap, spans[0].Attributes) - assert.Equal(t, codes.NotFound, spans[0].Status) + assert.Equal(t, codes.Error, spans[0].Status) assert.Equal(t, err.Error(), spans[0].StatusMessage) } diff --git a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/status.go b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/status.go index 2b495cf76f1..063f9a41ca2 100644 --- a/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/status.go +++ b/instrumentation/github.com/bradfitz/gomemcache/memcache/otelmemcache/status.go @@ -23,19 +23,19 @@ import ( // maps memcache error to appropriate error code; otherwise returns status OK func memcacheErrToStatusCode(err error) codes.Code { if err == nil { - return codes.OK + return codes.Ok } switch err { case memcache.ErrCacheMiss, memcache.ErrNotStored, memcache.ErrNoStats: - return codes.NotFound + return codes.Error case memcache.ErrCASConflict: - return codes.AlreadyExists + return codes.Error case memcache.ErrServerError: - return codes.Internal + return codes.Error case memcache.ErrMalformedKey: - return codes.InvalidArgument + return codes.Error default: - return codes.Unknown + return codes.Unset } } diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/config.go b/instrumentation/github.com/emicklei/go-restful/otelrestful/config.go index 6c8fdda63d9..0f9b550d792 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/config.go +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/config.go @@ -15,14 +15,14 @@ package otelrestful import ( - otelpropagation "go.opentelemetry.io/otel/api/propagation" + "go.opentelemetry.io/otel" oteltrace "go.opentelemetry.io/otel/api/trace" ) // config is used to configure the go-restful middleware. type config struct { TracerProvider oteltrace.TracerProvider - Propagators otelpropagation.Propagators + Propagators otel.TextMapPropagator } // Option specifies instrumentation configuration options. @@ -31,7 +31,7 @@ type Option func(*config) // WithPropagators specifies propagators to use for extracting // information from the HTTP requests. If none are specified, global // ones will be used. -func WithPropagators(propagators otelpropagation.Propagators) Option { +func WithPropagators(propagators otel.TextMapPropagator) Option { return func(cfg *config) { cfg.Propagators = propagators } diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.mod b/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.mod index 26eff858aaa..a951ca1aa99 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.mod +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.mod @@ -10,8 +10,8 @@ replace ( require ( github.com/emicklei/go-restful/v3 v3.3.1 - go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful v0.12.0 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/exporters/stdout v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful v0.13.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/exporters/stdout v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.sum b/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.sum index 51bbb011607..3afedf4688e 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.sum +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/example/go.sum @@ -1,28 +1,12 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8= github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/emicklei/go-restful/v3 v3.3.1 h1:engBLuFVe3n4ck963X94ZFfauROk9nthZOKilyHLgpM= github.com/emicklei/go-restful/v3 v3.3.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -41,53 +25,20 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLD github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/exporters/stdout v0.12.0 h1:ji9VVPmKg+oONcqwULcO0AHZseGU6CFOIdvwKCxNZ9Y= -go.opentelemetry.io/otel/exporters/stdout v0.12.0/go.mod h1:IGUi+IGDXlxXo7nYuPrxfAEpqTcKsWqFtflwFMGGPZQ= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/exporters/stdout v0.13.0 h1:A+XiGIPQbGoJoBOJfKAKnZyiUSjSWvL3XWETUvtom5k= +go.opentelemetry.io/otel/exporters/stdout v0.13.0/go.mod h1:JJt8RpNY6K+ft9ir3iKpceCvT/rhzJXEExGrWFCbv1o= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/go.mod b/instrumentation/github.com/emicklei/go-restful/otelrestful/go.mod index 29a03e76424..453b4719d7a 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/go.mod +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/go.mod @@ -11,7 +11,7 @@ require ( github.com/emicklei/go-restful/v3 v3.3.1 github.com/json-iterator/go v1.1.10 // indirect github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/contrib/propagators v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/contrib/propagators v0.13.0 + go.opentelemetry.io/otel v0.13.0 ) diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/go.sum b/instrumentation/github.com/emicklei/go-restful/otelrestful/go.sum index b89beda0289..bd034de73ce 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/go.sum +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/go.sum @@ -24,8 +24,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/restful.go b/instrumentation/github.com/emicklei/go-restful/otelrestful/restful.go index a48cedc4962..2c64d1ec819 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/restful.go +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/restful.go @@ -18,7 +18,6 @@ import ( "github.com/emicklei/go-restful/v3" otelglobal "go.opentelemetry.io/otel/api/global" - otelpropagation "go.opentelemetry.io/otel/api/propagation" oteltrace "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/semconv" ) @@ -43,11 +42,11 @@ func OTelFilter(service string, opts ...Option) restful.FilterFunction { } tracer := cfg.TracerProvider.Tracer(tracerName, oteltrace.WithInstrumentationVersion(tracerVersion)) if cfg.Propagators == nil { - cfg.Propagators = otelglobal.Propagators() + cfg.Propagators = otelglobal.TextMapPropagator() } return func(req *restful.Request, resp *restful.Response, chain *restful.FilterChain) { r := req.Request - ctx := otelpropagation.ExtractHTTP(r.Context(), cfg.Propagators, r.Header) + ctx := cfg.Propagators.Extract(r.Context(), r.Header) route := req.SelectedRoutePath() spanName := route diff --git a/instrumentation/github.com/emicklei/go-restful/otelrestful/restful_test.go b/instrumentation/github.com/emicklei/go-restful/otelrestful/restful_test.go index 127d3af780a..1e34f608c71 100644 --- a/instrumentation/github.com/emicklei/go-restful/otelrestful/restful_test.go +++ b/instrumentation/github.com/emicklei/go-restful/otelrestful/restful_test.go @@ -28,10 +28,11 @@ import ( mocktrace "go.opentelemetry.io/contrib/internal/trace" b3prop "go.opentelemetry.io/contrib/propagators/b3" + "go.opentelemetry.io/otel" otelglobal "go.opentelemetry.io/otel/api/global" - otelpropagation "go.opentelemetry.io/otel/api/propagation" oteltrace "go.opentelemetry.io/otel/api/trace" otelkv "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/propagators" ) const tracerName = "go.opentelemetry.io/contrib/instrumentation/github.com/emicklei/go-restful/otelrestful" @@ -156,12 +157,13 @@ func TestGetSpanNotInstrumented(t *testing.T) { func TestPropagationWithGlobalPropagators(t *testing.T) { provider, tracer := mocktrace.NewTracerProviderAndTracer(tracerName) + otelglobal.SetTextMapPropagator(propagators.TraceContext{}) r := httptest.NewRequest("GET", "/user/123", nil) w := httptest.NewRecorder() ctx, pspan := tracer.Start(context.Background(), "test") - otelpropagation.InjectHTTP(ctx, otelglobal.Propagators(), r.Header) + otelglobal.TextMapPropagator().Inject(ctx, r.Header) handlerFunc := func(req *restful.Request, resp *restful.Response) { span := oteltrace.SpanFromContext(req.Request.Context()) @@ -179,21 +181,18 @@ func TestPropagationWithGlobalPropagators(t *testing.T) { container.Add(ws) container.ServeHTTP(w, r) + otelglobal.SetTextMapPropagator(otel.NewCompositeTextMapPropagator()) } func TestPropagationWithCustomPropagators(t *testing.T) { provider, tracer := mocktrace.NewTracerProviderAndTracer(tracerName) b3 := b3prop.B3{} - props := otelpropagation.New( - otelpropagation.WithExtractors(b3), - otelpropagation.WithInjectors(b3), - ) r := httptest.NewRequest("GET", "/user/123", nil) w := httptest.NewRecorder() ctx, pspan := tracer.Start(context.Background(), "test") - otelpropagation.InjectHTTP(ctx, props, r.Header) + b3.Inject(ctx, r.Header) handlerFunc := func(req *restful.Request, resp *restful.Response) { span := oteltrace.SpanFromContext(req.Request.Context()) @@ -209,7 +208,7 @@ func TestPropagationWithCustomPropagators(t *testing.T) { container := restful.NewContainer() container.Filter(otelrestful.OTelFilter("foobar", otelrestful.WithTracerProvider(provider), - otelrestful.WithPropagators(props))) + otelrestful.WithPropagators(b3))) container.Add(ws) container.ServeHTTP(w, r) diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.mod b/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.mod index 5c595189d32..1a17210f65e 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.mod +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.mod @@ -10,8 +10,8 @@ replace ( require ( github.com/gin-gonic/gin v1.6.3 - go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.12.0 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/exporters/stdout v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin v0.13.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/exporters/stdout v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.sum b/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.sum index 8cca7520343..f66c0a9124e 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.sum +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/example/go.sum @@ -1,18 +1,10 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8= github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= @@ -25,14 +17,8 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87 github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -55,7 +41,6 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLD github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -65,48 +50,18 @@ github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/exporters/stdout v0.12.0 h1:ji9VVPmKg+oONcqwULcO0AHZseGU6CFOIdvwKCxNZ9Y= -go.opentelemetry.io/otel/exporters/stdout v0.12.0/go.mod h1:IGUi+IGDXlxXo7nYuPrxfAEpqTcKsWqFtflwFMGGPZQ= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/exporters/stdout v0.13.0 h1:A+XiGIPQbGoJoBOJfKAKnZyiUSjSWvL3XWETUvtom5k= +go.opentelemetry.io/otel/exporters/stdout v0.13.0/go.mod h1:JJt8RpNY6K+ft9ir3iKpceCvT/rhzJXEExGrWFCbv1o= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -115,5 +70,3 @@ gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/example/server.go b/instrumentation/github.com/gin-gonic/gin/otelgin/example/server.go index 6af378a31fd..fcaf658ff69 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/example/server.go +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/example/server.go @@ -22,10 +22,12 @@ import ( "github.com/gin-gonic/gin" "go.opentelemetry.io/contrib/instrumentation/github.com/gin-gonic/gin/otelgin" + "go.opentelemetry.io/otel" otelglobal "go.opentelemetry.io/otel/api/global" oteltrace "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/exporters/stdout" "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/propagators" sdktrace "go.opentelemetry.io/otel/sdk/trace" ) @@ -66,6 +68,7 @@ func initTracer() { log.Fatal(err) } otelglobal.SetTracerProvider(tp) + otelglobal.SetTextMapPropagator(otel.NewCompositeTextMapPropagator(propagators.TraceContext{}, propagators.Baggage{})) } func getUser(c *gin.Context, id string) string { diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/gintrace.go b/instrumentation/github.com/gin-gonic/gin/otelgin/gintrace.go index 9d3d829cfff..0a862e3127b 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/gintrace.go +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/gintrace.go @@ -26,7 +26,6 @@ import ( otelcontrib "go.opentelemetry.io/contrib" otelglobal "go.opentelemetry.io/otel/api/global" - otelpropagation "go.opentelemetry.io/otel/api/propagation" oteltrace "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" "go.opentelemetry.io/otel/semconv" @@ -53,7 +52,7 @@ func Middleware(service string, opts ...Option) gin.HandlerFunc { oteltrace.WithInstrumentationVersion(otelcontrib.SemVersion()), ) if cfg.Propagators == nil { - cfg.Propagators = otelglobal.Propagators() + cfg.Propagators = otelglobal.TextMapPropagator() } return func(c *gin.Context) { c.Set(tracerKey, tracer) @@ -61,7 +60,7 @@ func Middleware(service string, opts ...Option) gin.HandlerFunc { defer func() { c.Request = c.Request.WithContext(savedCtx) }() - ctx := otelpropagation.ExtractHTTP(savedCtx, cfg.Propagators, c.Request.Header) + ctx := cfg.Propagators.Extract(savedCtx, c.Request.Header) opts := []oteltrace.SpanOption{ oteltrace.WithAttributes(semconv.NetAttributesFromHTTPRequest("tcp", c.Request)...), oteltrace.WithAttributes(semconv.EndUserAttributesFromHTTPRequest(c.Request)...), @@ -118,7 +117,7 @@ func HTML(c *gin.Context, code int, name string, obj interface{}) { if r := recover(); r != nil { err := fmt.Errorf("error rendering template:%s: %s", name, r) span.RecordError(ctx, err) - span.SetStatus(codes.Internal, "template failure") + span.SetStatus(codes.Error, "template failure") span.End() panic(r) } else { diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/gintrace_test.go b/instrumentation/github.com/gin-gonic/gin/otelgin/gintrace_test.go index b9df2aa6acd..898033444cc 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/gintrace_test.go +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/gintrace_test.go @@ -28,12 +28,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/codes" mocktrace "go.opentelemetry.io/contrib/internal/trace" b3prop "go.opentelemetry.io/contrib/propagators/b3" otelglobal "go.opentelemetry.io/otel/api/global" - otelpropagation "go.opentelemetry.io/otel/api/propagation" oteltrace "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" ) @@ -146,7 +146,7 @@ func TestError(t *testing.T) { assert.Equal(t, label.IntValue(http.StatusInternalServerError), span.Attributes["http.status_code"]) assert.Equal(t, label.StringValue("Error #01: oh no\n"), span.Attributes["gin.errors"]) // server errors set the status - assert.Equal(t, codes.Internal, span.Status) + assert.Equal(t, codes.Error, span.Status) } func TestHTML(t *testing.T) { @@ -205,12 +205,13 @@ func TestGetSpanNotInstrumented(t *testing.T) { func TestPropagationWithGlobalPropagators(t *testing.T) { provider, tracer := mocktrace.NewTracerProviderAndTracer(tracerName) + otelglobal.SetTextMapPropagator(b3prop.B3{}) r := httptest.NewRequest("GET", "/user/123", nil) w := httptest.NewRecorder() ctx, pspan := tracer.Start(context.Background(), "test") - otelpropagation.InjectHTTP(ctx, otelglobal.Propagators(), r.Header) + otelglobal.TextMapPropagator().Inject(ctx, r.Header) router := gin.New() router.Use(Middleware("foobar", WithTracerProvider(provider))) @@ -223,24 +224,21 @@ func TestPropagationWithGlobalPropagators(t *testing.T) { }) router.ServeHTTP(w, r) + otelglobal.SetTextMapPropagator(otel.NewCompositeTextMapPropagator()) } func TestPropagationWithCustomPropagators(t *testing.T) { provider, tracer := mocktrace.NewTracerProviderAndTracer(tracerName) b3 := b3prop.B3{} - props := otelpropagation.New( - otelpropagation.WithExtractors(b3), - otelpropagation.WithInjectors(b3), - ) r := httptest.NewRequest("GET", "/user/123", nil) w := httptest.NewRecorder() ctx, pspan := tracer.Start(context.Background(), "test") - otelpropagation.InjectHTTP(ctx, props, r.Header) + b3.Inject(ctx, r.Header) router := gin.New() - router.Use(Middleware("foobar", WithTracerProvider(provider), WithPropagators(props))) + router.Use(Middleware("foobar", WithTracerProvider(provider), WithPropagators(b3))) router.GET("/user/:id", func(c *gin.Context) { span := oteltrace.SpanFromContext(c.Request.Context()) mspan, ok := span.(*mocktrace.Span) diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/go.mod b/instrumentation/github.com/gin-gonic/gin/otelgin/go.mod index dfe77bffe80..efc2d310032 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/go.mod +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/go.mod @@ -10,7 +10,7 @@ replace ( require ( github.com/gin-gonic/gin v1.6.3 github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/contrib/propagators v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/contrib/propagators v0.13.0 + go.opentelemetry.io/otel v0.13.0 ) diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/go.sum b/instrumentation/github.com/gin-gonic/gin/otelgin/go.sum index 06865087812..3452ec4ff87 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/go.sum +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/go.sum @@ -47,8 +47,8 @@ github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= diff --git a/instrumentation/github.com/gin-gonic/gin/otelgin/option.go b/instrumentation/github.com/gin-gonic/gin/otelgin/option.go index 06390c075a7..c6d03fb1765 100644 --- a/instrumentation/github.com/gin-gonic/gin/otelgin/option.go +++ b/instrumentation/github.com/gin-gonic/gin/otelgin/option.go @@ -17,13 +17,13 @@ package otelgin import ( - otelpropagation "go.opentelemetry.io/otel/api/propagation" + "go.opentelemetry.io/otel" oteltrace "go.opentelemetry.io/otel/api/trace" ) type config struct { TracerProvider oteltrace.TracerProvider - Propagators otelpropagation.Propagators + Propagators otel.TextMapPropagator } // Option specifies instrumentation configuration options. @@ -32,7 +32,7 @@ type Option func(*config) // WithPropagators specifies propagators to use for extracting // information from the HTTP requests. If none are specified, global // ones will be used. -func WithPropagators(propagators otelpropagation.Propagators) Option { +func WithPropagators(propagators otel.TextMapPropagator) Option { return func(cfg *config) { cfg.Propagators = propagators } diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/example/go.mod b/instrumentation/github.com/gocql/gocql/otelgocql/example/go.mod index c9464383458..41ec1f4f674 100644 --- a/instrumentation/github.com/gocql/gocql/otelgocql/example/go.mod +++ b/instrumentation/github.com/gocql/gocql/otelgocql/example/go.mod @@ -9,9 +9,9 @@ replace ( require ( github.com/gocql/gocql v0.0.0-20200624222514-34081eda590e - go.opentelemetry.io/contrib/instrumentation/github.com/gocql/gocql/otelgocql v0.12.0 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/exporters/metric/prometheus v0.12.0 - go.opentelemetry.io/otel/exporters/trace/zipkin v0.12.0 + go.opentelemetry.io/contrib/instrumentation/github.com/gocql/gocql/otelgocql v0.13.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/exporters/metric/prometheus v0.13.0 + go.opentelemetry.io/otel/exporters/trace/zipkin v0.13.0 golang.org/x/sys v0.0.0-20200722175500-76b94024e4b6 // indirect ) diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/example/go.sum b/instrumentation/github.com/gocql/gocql/otelgocql/example/go.sum index 5cf17f203e2..8c9ad7887bf 100644 --- a/instrumentation/github.com/gocql/gocql/otelgocql/example/go.sum +++ b/instrumentation/github.com/gocql/gocql/otelgocql/example/go.sum @@ -99,8 +99,8 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/openzipkin/zipkin-go v0.2.4 h1:U5TVrlsR1jPV1oJp7XqkC1XDk32tSZGwQIIywTQvQhc= -github.com/openzipkin/zipkin-go v0.2.4/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa4YDFlwRYAMyE= +github.com/openzipkin/zipkin-go v0.2.5 h1:UwtQQx2pyPIgWYHRg+epgdx1/HnBQTgN3/oIYEJTQzU= +github.com/openzipkin/zipkin-go v0.2.5/go.mod h1:KpXfKdgRDnnhsxw4pNIH9Md5lyFqKUa4YDFlwRYAMyE= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -134,14 +134,14 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/exporters/metric/prometheus v0.12.0 h1:QHLoNZWJ5j6Hn8AUV3fe95Qg6khcMx33Gzp9I1tnKlM= -go.opentelemetry.io/otel/exporters/metric/prometheus v0.12.0/go.mod h1:EYhf3CC9yhRMU6csMW2l1B1X7zaikwtd4HR6pJchXhw= -go.opentelemetry.io/otel/exporters/trace/zipkin v0.12.0 h1:PDDkylx7yLRQxu8w8dKD7YdOYuWXNx/EKGciNEaJjhU= -go.opentelemetry.io/otel/exporters/trace/zipkin v0.12.0/go.mod h1:bXGoJoqaBkDnCGMst7DvK97dBBjwJ4rqsOE2YA4PSv8= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/exporters/metric/prometheus v0.13.0 h1:Jf7AdsEoHKtNTWxXLj/g9XGjsGpdk0otEf0lx00r2Ps= +go.opentelemetry.io/otel/exporters/metric/prometheus v0.13.0/go.mod h1:Tyh3ACxU9a1tu1mF4at7xvNu+BaiPThrr5XZmsoIW7g= +go.opentelemetry.io/otel/exporters/trace/zipkin v0.13.0 h1:73mFdDfl5lJrtxxHufQ2tNDYQjAXbfVEgv7eg/e/yP8= +go.opentelemetry.io/otel/exporters/trace/zipkin v0.13.0/go.mod h1:R7bkBdeVhrEWP9L1s7SpVDqVDEI2QbNHrCMdI0OlRzo= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -191,8 +191,6 @@ google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/go.mod b/instrumentation/github.com/gocql/gocql/otelgocql/go.mod index e5edecdeeef..1d130bee962 100644 --- a/instrumentation/github.com/gocql/gocql/otelgocql/go.mod +++ b/instrumentation/github.com/gocql/gocql/otelgocql/go.mod @@ -8,6 +8,6 @@ require ( github.com/gocql/gocql v0.0.0-20200624222514-34081eda590e github.com/golang/snappy v0.0.1 // indirect github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/otel v0.13.0 ) diff --git a/instrumentation/github.com/gocql/gocql/otelgocql/go.sum b/instrumentation/github.com/gocql/gocql/otelgocql/go.sum index bdb6952979c..5af0c278c45 100644 --- a/instrumentation/github.com/gocql/gocql/otelgocql/go.sum +++ b/instrumentation/github.com/gocql/gocql/otelgocql/go.sum @@ -27,8 +27,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/instrumentation/github.com/gorilla/mux/otelmux/config.go b/instrumentation/github.com/gorilla/mux/otelmux/config.go index 5ef79913e4a..ab5323de78a 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/config.go +++ b/instrumentation/github.com/gorilla/mux/otelmux/config.go @@ -15,14 +15,14 @@ package otelmux import ( - otelpropagation "go.opentelemetry.io/otel/api/propagation" + "go.opentelemetry.io/otel" oteltrace "go.opentelemetry.io/otel/api/trace" ) // config is used to configure the mux middleware. type config struct { TracerProvider oteltrace.TracerProvider - Propagators otelpropagation.Propagators + Propagators otel.TextMapPropagator } // Option specifies instrumentation configuration options. @@ -31,7 +31,7 @@ type Option func(*config) // WithPropagators specifies propagators to use for extracting // information from the HTTP requests. If none are specified, global // ones will be used. -func WithPropagators(propagators otelpropagation.Propagators) Option { +func WithPropagators(propagators otel.TextMapPropagator) Option { return func(cfg *config) { cfg.Propagators = propagators } diff --git a/instrumentation/github.com/gorilla/mux/otelmux/example/go.mod b/instrumentation/github.com/gorilla/mux/otelmux/example/go.mod index 40b18ee1eab..09c5b3a2274 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/example/go.mod +++ b/instrumentation/github.com/gorilla/mux/otelmux/example/go.mod @@ -2,12 +2,16 @@ module go.opentelemetry.io/opentelemetry-go-contrib/instrumentation/github.com/g go 1.14 -replace go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux => ../ +replace ( + go.opentelemetry.io/contrib => ../../../../../../ + go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux => ../ + go.opentelemetry.io/contrib/propagators => ../../../../../../propagators +) require ( github.com/gorilla/mux v1.8.0 - go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.12.0 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/exporters/stdout v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux v0.13.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/exporters/stdout v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/instrumentation/github.com/gorilla/mux/otelmux/example/go.sum b/instrumentation/github.com/gorilla/mux/otelmux/example/go.sum index c0ad0687b38..85256ce6dd5 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/example/go.sum +++ b/instrumentation/github.com/gorilla/mux/otelmux/example/go.sum @@ -1,28 +1,12 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8= github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -36,56 +20,19 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/contrib v0.12.0 h1:vLtYifaYQD8i9ncT07vLqUmo2RivECfpNJ2kv3YKnK0= -go.opentelemetry.io/contrib v0.12.0/go.mod h1:onlxH6TKFRkW2Xgc5IO37kPYz3v7wMzh/FrBxsQxCt4= -go.opentelemetry.io/contrib/propagators v0.12.0 h1:X+BFc/3zD/WGrt3rgNdz7/6zqbRdYSjH7+Mv2IAWns4= -go.opentelemetry.io/contrib/propagators v0.12.0/go.mod h1:2cKNY+NJQjmzJkFyf8U4OyHABIxCi53ERyOjV2Tulyc= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/exporters/stdout v0.12.0 h1:ji9VVPmKg+oONcqwULcO0AHZseGU6CFOIdvwKCxNZ9Y= -go.opentelemetry.io/otel/exporters/stdout v0.12.0/go.mod h1:IGUi+IGDXlxXo7nYuPrxfAEpqTcKsWqFtflwFMGGPZQ= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/exporters/stdout v0.13.0 h1:A+XiGIPQbGoJoBOJfKAKnZyiUSjSWvL3XWETUvtom5k= +go.opentelemetry.io/otel/exporters/stdout v0.13.0/go.mod h1:JJt8RpNY6K+ft9ir3iKpceCvT/rhzJXEExGrWFCbv1o= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/instrumentation/github.com/gorilla/mux/otelmux/example/server.go b/instrumentation/github.com/gorilla/mux/otelmux/example/server.go index bef52fe1c94..ed6df7e1c92 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/example/server.go +++ b/instrumentation/github.com/gorilla/mux/otelmux/example/server.go @@ -23,10 +23,12 @@ import ( "github.com/gorilla/mux" "go.opentelemetry.io/contrib/instrumentation/github.com/gorilla/mux/otelmux" + "go.opentelemetry.io/otel" otelglobal "go.opentelemetry.io/otel/api/global" oteltrace "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/exporters/stdout" "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/propagators" sdktrace "go.opentelemetry.io/otel/sdk/trace" ) @@ -63,6 +65,7 @@ func initTracer() { log.Fatal(err) } otelglobal.SetTracerProvider(tp) + otelglobal.SetTextMapPropagator(otel.NewCompositeTextMapPropagator(propagators.TraceContext{}, propagators.Baggage{})) } func getUser(ctx context.Context, id string) string { diff --git a/instrumentation/github.com/gorilla/mux/otelmux/go.mod b/instrumentation/github.com/gorilla/mux/otelmux/go.mod index 71839b0535e..eb34b9d8eb9 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/go.mod +++ b/instrumentation/github.com/gorilla/mux/otelmux/go.mod @@ -11,7 +11,7 @@ require ( github.com/felixge/httpsnoop v1.0.1 github.com/gorilla/mux v1.8.0 github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/contrib/propagators v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/contrib/propagators v0.13.0 + go.opentelemetry.io/otel v0.13.0 ) diff --git a/instrumentation/github.com/gorilla/mux/otelmux/go.sum b/instrumentation/github.com/gorilla/mux/otelmux/go.sum index 84e6a410495..cbf8f8d5bf1 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/go.sum +++ b/instrumentation/github.com/gorilla/mux/otelmux/go.sum @@ -18,8 +18,8 @@ github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/instrumentation/github.com/gorilla/mux/otelmux/mux.go b/instrumentation/github.com/gorilla/mux/otelmux/mux.go index b5aa8baefb4..4581c447945 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/mux.go +++ b/instrumentation/github.com/gorilla/mux/otelmux/mux.go @@ -23,9 +23,9 @@ import ( "github.com/gorilla/mux" otelcontrib "go.opentelemetry.io/contrib" + "go.opentelemetry.io/otel" otelglobal "go.opentelemetry.io/otel/api/global" - otelpropagation "go.opentelemetry.io/otel/api/propagation" oteltrace "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/semconv" ) @@ -50,7 +50,7 @@ func Middleware(service string, opts ...Option) mux.MiddlewareFunc { oteltrace.WithInstrumentationVersion(otelcontrib.SemVersion()), ) if cfg.Propagators == nil { - cfg.Propagators = otelglobal.Propagators() + cfg.Propagators = otelglobal.TextMapPropagator() } return func(handler http.Handler) http.Handler { return traceware{ @@ -65,7 +65,7 @@ func Middleware(service string, opts ...Option) mux.MiddlewareFunc { type traceware struct { service string tracer oteltrace.Tracer - propagators otelpropagation.Propagators + propagators otel.TextMapPropagator handler http.Handler } @@ -116,7 +116,7 @@ func putRRW(rrw *recordingResponseWriter) { // ServeHTTP implements the http.Handler interface. It does the actual // tracing of the request. func (tw traceware) ServeHTTP(w http.ResponseWriter, r *http.Request) { - ctx := otelpropagation.ExtractHTTP(r.Context(), tw.propagators, r.Header) + ctx := tw.propagators.Extract(r.Context(), r.Header) spanName := "" route := mux.CurrentRoute(r) if route != nil { diff --git a/instrumentation/github.com/gorilla/mux/otelmux/mux_test.go b/instrumentation/github.com/gorilla/mux/otelmux/mux_test.go index 18cf4089398..10defff740e 100644 --- a/instrumentation/github.com/gorilla/mux/otelmux/mux_test.go +++ b/instrumentation/github.com/gorilla/mux/otelmux/mux_test.go @@ -29,10 +29,11 @@ import ( mocktrace "go.opentelemetry.io/contrib/internal/trace" b3prop "go.opentelemetry.io/contrib/propagators/b3" + "go.opentelemetry.io/otel" otelglobal "go.opentelemetry.io/otel/api/global" - otelpropagation "go.opentelemetry.io/otel/api/propagation" oteltrace "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/propagators" ) func TestChildSpanFromGlobalTracer(t *testing.T) { @@ -137,12 +138,13 @@ func TestGetSpanNotInstrumented(t *testing.T) { func TestPropagationWithGlobalPropagators(t *testing.T) { provider, tracer := mocktrace.NewTracerProviderAndTracer(tracerName) + otelglobal.SetTextMapPropagator(propagators.TraceContext{}) r := httptest.NewRequest("GET", "/user/123", nil) w := httptest.NewRecorder() ctx, pspan := tracer.Start(context.Background(), "test") - otelpropagation.InjectHTTP(ctx, otelglobal.Propagators(), r.Header) + otelglobal.TextMapPropagator().Inject(ctx, r.Header) router := mux.NewRouter() router.Use(Middleware("foobar", WithTracerProvider(provider))) @@ -156,25 +158,22 @@ func TestPropagationWithGlobalPropagators(t *testing.T) { })) router.ServeHTTP(w, r) + otelglobal.SetTextMapPropagator(otel.NewCompositeTextMapPropagator()) } func TestPropagationWithCustomPropagators(t *testing.T) { provider, tracer := mocktrace.NewTracerProviderAndTracer(tracerName) b3 := b3prop.B3{} - props := otelpropagation.New( - otelpropagation.WithExtractors(b3), - otelpropagation.WithInjectors(b3), - ) r := httptest.NewRequest("GET", "/user/123", nil) w := httptest.NewRecorder() ctx, pspan := tracer.Start(context.Background(), "test") - otelpropagation.InjectHTTP(ctx, props, r.Header) + b3.Inject(ctx, r.Header) router := mux.NewRouter() - router.Use(Middleware("foobar", WithTracerProvider(provider), WithPropagators(props))) + router.Use(Middleware("foobar", WithTracerProvider(provider), WithPropagators(b3))) router.HandleFunc("/user/{id}", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { span := oteltrace.SpanFromContext(r.Context()) mspan, ok := span.(*mocktrace.Span) diff --git a/instrumentation/github.com/labstack/echo/otelecho/config.go b/instrumentation/github.com/labstack/echo/otelecho/config.go index ec2e2e4fc9b..3b23509b1e7 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/config.go +++ b/instrumentation/github.com/labstack/echo/otelecho/config.go @@ -15,14 +15,14 @@ package otelecho import ( - otelpropagation "go.opentelemetry.io/otel/api/propagation" + "go.opentelemetry.io/otel" oteltrace "go.opentelemetry.io/otel/api/trace" ) // config is used to configure the mux middleware. type config struct { TracerProvider oteltrace.TracerProvider - Propagators otelpropagation.Propagators + Propagators otel.TextMapPropagator } // Option specifies instrumentation configuration options. @@ -31,7 +31,7 @@ type Option func(*config) // WithPropagators specifies propagators to use for extracting // information from the HTTP requests. If none are specified, global // ones will be used. -func WithPropagators(propagators otelpropagation.Propagators) Option { +func WithPropagators(propagators otel.TextMapPropagator) Option { return func(cfg *config) { cfg.Propagators = propagators } diff --git a/instrumentation/github.com/labstack/echo/otelecho/echo.go b/instrumentation/github.com/labstack/echo/otelecho/echo.go index 1abe0a755ab..c5c7eb99a4b 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/echo.go +++ b/instrumentation/github.com/labstack/echo/otelecho/echo.go @@ -22,7 +22,6 @@ import ( otelcontrib "go.opentelemetry.io/contrib" otelglobal "go.opentelemetry.io/otel/api/global" - otelpropagation "go.opentelemetry.io/otel/api/propagation" oteltrace "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" "go.opentelemetry.io/otel/semconv" @@ -47,7 +46,7 @@ func Middleware(service string, opts ...Option) echo.MiddlewareFunc { oteltrace.WithInstrumentationVersion(otelcontrib.SemVersion()), ) if cfg.Propagators == nil { - cfg.Propagators = otelglobal.Propagators() + cfg.Propagators = otelglobal.TextMapPropagator() } return func(next echo.HandlerFunc) echo.HandlerFunc { return func(c echo.Context) error { @@ -58,7 +57,7 @@ func Middleware(service string, opts ...Option) echo.MiddlewareFunc { request = request.WithContext(savedCtx) c.SetRequest(request) }() - ctx := otelpropagation.ExtractHTTP(savedCtx, cfg.Propagators, request.Header) + ctx := cfg.Propagators.Extract(savedCtx, request.Header) opts := []oteltrace.SpanOption{ oteltrace.WithAttributes(semconv.NetAttributesFromHTTPRequest("tcp", request)...), oteltrace.WithAttributes(semconv.EndUserAttributesFromHTTPRequest(request)...), diff --git a/instrumentation/github.com/labstack/echo/otelecho/echo_test.go b/instrumentation/github.com/labstack/echo/otelecho/echo_test.go index 87155821c3a..1c2c8477b57 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/echo_test.go +++ b/instrumentation/github.com/labstack/echo/otelecho/echo_test.go @@ -28,12 +28,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/propagators" mocktrace "go.opentelemetry.io/contrib/internal/trace" b3prop "go.opentelemetry.io/contrib/propagators/b3" otelglobal "go.opentelemetry.io/otel/api/global" - otelpropagation "go.opentelemetry.io/otel/api/propagation" oteltrace "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" ) @@ -144,7 +145,7 @@ func TestError(t *testing.T) { assert.Equal(t, label.IntValue(http.StatusInternalServerError), span.Attributes["http.status_code"]) assert.Equal(t, label.StringValue("oh no"), span.Attributes["echo.error"]) // server errors set the status - assert.Equal(t, codes.Internal, span.Status) + assert.Equal(t, codes.Error, span.Status) } func TestErrorOnlyHandledOnce(t *testing.T) { @@ -182,12 +183,13 @@ func TestGetSpanNotInstrumented(t *testing.T) { func TestPropagationWithGlobalPropagators(t *testing.T) { provider, tracer := mocktrace.NewTracerProviderAndTracer(tracerName) + otelglobal.SetTextMapPropagator(propagators.TraceContext{}) r := httptest.NewRequest("GET", "/user/123", nil) w := httptest.NewRecorder() ctx, pspan := tracer.Start(context.Background(), "test") - otelpropagation.InjectHTTP(ctx, otelglobal.Propagators(), r.Header) + otelglobal.TextMapPropagator().Inject(ctx, r.Header) router := echo.New() router.Use(Middleware("foobar", WithTracerProvider(provider))) @@ -201,25 +203,22 @@ func TestPropagationWithGlobalPropagators(t *testing.T) { }) router.ServeHTTP(w, r) + otelglobal.SetTextMapPropagator(otel.NewCompositeTextMapPropagator()) } func TestPropagationWithCustomPropagators(t *testing.T) { provider, tracer := mocktrace.NewTracerProviderAndTracer(tracerName) b3 := b3prop.B3{} - props := otelpropagation.New( - otelpropagation.WithExtractors(b3), - otelpropagation.WithInjectors(b3), - ) r := httptest.NewRequest("GET", "/user/123", nil) w := httptest.NewRecorder() ctx, pspan := tracer.Start(context.Background(), "test") - otelpropagation.InjectHTTP(ctx, props, r.Header) + b3.Inject(ctx, r.Header) router := echo.New() - router.Use(Middleware("foobar", WithTracerProvider(provider), WithPropagators(props))) + router.Use(Middleware("foobar", WithTracerProvider(provider), WithPropagators(b3))) router.GET("/user/:id", func(c echo.Context) error { span := oteltrace.SpanFromContext(c.Request().Context()) mspan, ok := span.(*mocktrace.Span) diff --git a/instrumentation/github.com/labstack/echo/otelecho/example/go.mod b/instrumentation/github.com/labstack/echo/otelecho/example/go.mod index b929bfa982a..33dfb6e1e03 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/example/go.mod +++ b/instrumentation/github.com/labstack/echo/otelecho/example/go.mod @@ -10,8 +10,8 @@ replace ( require ( github.com/labstack/echo/v4 v4.1.17 - go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.12.0 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/exporters/stdout v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.13.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/exporters/stdout v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/instrumentation/github.com/labstack/echo/otelecho/example/go.sum b/instrumentation/github.com/labstack/echo/otelecho/example/go.sum index 57490138bae..625b5fab2f5 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/example/go.sum +++ b/instrumentation/github.com/labstack/echo/otelecho/example/go.sum @@ -1,27 +1,11 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8= github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -44,7 +28,6 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= @@ -54,32 +37,19 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/exporters/stdout v0.12.0 h1:ji9VVPmKg+oONcqwULcO0AHZseGU6CFOIdvwKCxNZ9Y= -go.opentelemetry.io/otel/exporters/stdout v0.12.0/go.mod h1:IGUi+IGDXlxXo7nYuPrxfAEpqTcKsWqFtflwFMGGPZQ= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/exporters/stdout v0.13.0 h1:A+XiGIPQbGoJoBOJfKAKnZyiUSjSWvL3XWETUvtom5k= +go.opentelemetry.io/otel/exporters/stdout v0.13.0/go.mod h1:JJt8RpNY6K+ft9ir3iKpceCvT/rhzJXEExGrWFCbv1o= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -93,27 +63,11 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/instrumentation/github.com/labstack/echo/otelecho/example/server.go b/instrumentation/github.com/labstack/echo/otelecho/example/server.go index 913b377f798..da1ab3710eb 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/example/server.go +++ b/instrumentation/github.com/labstack/echo/otelecho/example/server.go @@ -22,10 +22,12 @@ import ( "github.com/labstack/echo/v4" "go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho" + "go.opentelemetry.io/otel" otelglobal "go.opentelemetry.io/otel/api/global" oteltrace "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/exporters/stdout" "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/propagators" sdktrace "go.opentelemetry.io/otel/sdk/trace" ) @@ -66,6 +68,7 @@ func initTracer() { log.Fatal(err) } otelglobal.SetTracerProvider(tp) + otelglobal.SetTextMapPropagator(otel.NewCompositeTextMapPropagator(propagators.TraceContext{}, propagators.Baggage{})) } func getUser(ctx context.Context, id string) string { diff --git a/instrumentation/github.com/labstack/echo/otelecho/go.mod b/instrumentation/github.com/labstack/echo/otelecho/go.mod index 7e9f9867d88..cdf62f1afe9 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/go.mod +++ b/instrumentation/github.com/labstack/echo/otelecho/go.mod @@ -10,7 +10,7 @@ replace ( require ( github.com/labstack/echo/v4 v4.1.17 github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/contrib/propagators v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/contrib/propagators v0.13.0 + go.opentelemetry.io/otel v0.13.0 ) diff --git a/instrumentation/github.com/labstack/echo/otelecho/go.sum b/instrumentation/github.com/labstack/echo/otelecho/go.sum index 08a2f4ebf5f..4e1e204103d 100644 --- a/instrumentation/github.com/labstack/echo/otelecho/go.sum +++ b/instrumentation/github.com/labstack/echo/otelecho/go.sum @@ -33,8 +33,8 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a h1:vclmkQCjlDX5OydZ9wv8rBCcS0QyQY66Mpf/7BZbInM= diff --git a/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.mod b/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.mod index 297a0e3b6eb..292798e684e 100644 --- a/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.mod +++ b/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.mod @@ -8,7 +8,7 @@ require ( github.com/stretchr/testify v1.6.1 github.com/xdg/stringprep v1.0.0 // indirect go.mongodb.org/mongo-driver v1.4.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/otel v0.13.0 golang.org/x/crypto v0.0.0-20191105034135-c7e5f84aec59 // indirect ) diff --git a/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.sum b/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.sum index d2abf20c797..b7bc0719b60 100644 --- a/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.sum +++ b/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo/go.sum @@ -88,8 +88,8 @@ github.com/xdg/stringprep v1.0.0 h1:d9X0esnoa3dFsV0FG35rAT0RIhYFlPq7MiP+DW89La0= github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= go.mongodb.org/mongo-driver v1.4.1 h1:38NSAyDPagwnFpUA/D5SFgbugUYR3NzYRNa4Qk9UxKs= go.mongodb.org/mongo-driver v1.4.1/go.mod h1:llVBH2pkj9HywK0Dtdt6lDikOjFLbceHVu/Rc0iMKLs= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/example/config/config.go b/instrumentation/google.golang.org/grpc/otelgrpc/example/config/config.go index 63e3e1fd9f2..afc1e465b0a 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/example/config/config.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/example/config/config.go @@ -17,8 +17,10 @@ package config import ( "log" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/global" "go.opentelemetry.io/otel/exporters/stdout" + "go.opentelemetry.io/otel/propagators" sdktrace "go.opentelemetry.io/otel/sdk/trace" ) @@ -36,4 +38,5 @@ func Init() { log.Fatal(err) } global.SetTracerProvider(tp) + global.SetTextMapPropagator(otel.NewCompositeTextMapPropagator(propagators.TraceContext{}, propagators.Baggage{})) } diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/example/go.mod b/instrumentation/google.golang.org/grpc/otelgrpc/example/go.mod index 4f49ee2e6c5..4236f7bf83e 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/example/go.mod +++ b/instrumentation/google.golang.org/grpc/otelgrpc/example/go.mod @@ -2,14 +2,17 @@ module go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgr go 1.14 -replace go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc => ../ +replace ( + go.opentelemetry.io/contrib => ../../../../../ + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc => ../ +) require ( github.com/golang/protobuf v1.4.2 - go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.12.0 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/exporters/stdout v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.13.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/exporters/stdout v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 golang.org/x/net v0.0.0-20200707034311-ab3426394381 google.golang.org/grpc v1.32.0 ) diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/example/go.sum b/instrumentation/google.golang.org/grpc/otelgrpc/example/go.sum index 36ad04228da..61ac9bef39d 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/example/go.sum +++ b/instrumentation/google.golang.org/grpc/otelgrpc/example/go.sum @@ -46,14 +46,12 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/contrib v0.12.0 h1:vLtYifaYQD8i9ncT07vLqUmo2RivECfpNJ2kv3YKnK0= -go.opentelemetry.io/contrib v0.12.0/go.mod h1:onlxH6TKFRkW2Xgc5IO37kPYz3v7wMzh/FrBxsQxCt4= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/exporters/stdout v0.12.0 h1:ji9VVPmKg+oONcqwULcO0AHZseGU6CFOIdvwKCxNZ9Y= -go.opentelemetry.io/otel/exporters/stdout v0.12.0/go.mod h1:IGUi+IGDXlxXo7nYuPrxfAEpqTcKsWqFtflwFMGGPZQ= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/exporters/stdout v0.13.0 h1:A+XiGIPQbGoJoBOJfKAKnZyiUSjSWvL3XWETUvtom5k= +go.opentelemetry.io/otel/exporters/stdout v0.13.0/go.mod h1:JJt8RpNY6K+ft9ir3iKpceCvT/rhzJXEExGrWFCbv1o= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/go.mod b/instrumentation/google.golang.org/grpc/otelgrpc/go.mod index 4070dbb8751..7fffe9c8ed1 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/go.mod +++ b/instrumentation/google.golang.org/grpc/otelgrpc/go.mod @@ -7,7 +7,7 @@ replace go.opentelemetry.io/contrib => ../../../../ require ( github.com/golang/protobuf v1.4.2 github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/otel v0.13.0 google.golang.org/grpc v1.32.0 ) diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/go.sum b/instrumentation/google.golang.org/grpc/otelgrpc/go.sum index 709d44005e2..8a80d13a2e4 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/go.sum +++ b/instrumentation/google.golang.org/grpc/otelgrpc/go.sum @@ -40,8 +40,8 @@ github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1: github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/grpctrace.go b/instrumentation/google.golang.org/grpc/otelgrpc/grpctrace.go index ae8e7536aee..f8c1956528c 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/grpctrace.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/grpctrace.go @@ -19,9 +19,8 @@ import ( "google.golang.org/grpc/metadata" - "go.opentelemetry.io/otel/api/baggage" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/global" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" ) @@ -31,7 +30,7 @@ const instrumentationName = "go.opentelemetry.io/contrib/instrumentation/google. // config is a group of options for this instrumentation. type config struct { - Propagators propagation.Propagators + Propagators otel.TextMapPropagator TracerProvider trace.TracerProvider } @@ -43,7 +42,7 @@ type Option interface { // newConfig returns a config configured with all the passed Options. func newConfig(opts []Option) *config { c := &config{ - Propagators: global.Propagators(), + Propagators: global.TextMapPropagator(), TracerProvider: global.TracerProvider(), } for _, o := range opts { @@ -52,7 +51,7 @@ func newConfig(opts []Option) *config { return c } -type propagatorsOption struct{ p propagation.Propagators } +type propagatorsOption struct{ p otel.TextMapPropagator } func (o propagatorsOption) Apply(c *config) { c.Propagators = o.p @@ -60,7 +59,7 @@ func (o propagatorsOption) Apply(c *config) { // WithPropagators returns an Option to use the Propagators when extracting // and injecting trace context from requests. -func WithPropagators(p propagation.Propagators) Option { +func WithPropagators(p otel.TextMapPropagator) Option { return propagatorsOption{p: p} } @@ -97,7 +96,7 @@ func (s *metadataSupplier) Set(key string, value string) { // requests. func Inject(ctx context.Context, metadata *metadata.MD, opts ...Option) { c := newConfig(opts) - propagation.InjectHTTP(ctx, c.Propagators, &metadataSupplier{ + c.Propagators.Inject(ctx, &metadataSupplier{ metadata: metadata, }) } @@ -107,16 +106,11 @@ func Inject(ctx context.Context, metadata *metadata.MD, opts ...Option) { // This function is meant to be used on incoming requests. func Extract(ctx context.Context, metadata *metadata.MD, opts ...Option) ([]label.KeyValue, trace.SpanContext) { c := newConfig(opts) - ctx = propagation.ExtractHTTP(ctx, c.Propagators, &metadataSupplier{ + ctx = c.Propagators.Extract(ctx, &metadataSupplier{ metadata: metadata, }) - spanContext := trace.RemoteSpanContextFromContext(ctx) - var correlationCtxLabels []label.KeyValue - baggage.MapFromContext(ctx).Foreach(func(l label.KeyValue) bool { - correlationCtxLabels = append(correlationCtxLabels, l) - return true - }) + labelSet := otel.Baggage(ctx) - return correlationCtxLabels, spanContext + return (&labelSet).ToSlice(), trace.RemoteSpanContextFromContext(ctx) } diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go b/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go index 0f155ddf324..0a661a0bf09 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go @@ -29,7 +29,7 @@ import ( "google.golang.org/grpc/peer" "google.golang.org/grpc/status" - "go.opentelemetry.io/otel/api/baggage" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/label" @@ -103,7 +103,7 @@ func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor { if err != nil { s, _ := status.FromError(err) - span.SetStatus(codes.Code(s.Code()), s.Message()) + span.SetStatus(codes.Error, s.Message()) } return err @@ -282,7 +282,7 @@ func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor { if err != nil { s, _ := status.FromError(err) - span.SetStatus(codes.Code(s.Code()), s.Message()) + span.SetStatus(codes.Error, s.Message()) } span.End() @@ -305,9 +305,7 @@ func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor { metadataCopy := requestMetadata.Copy() entries, spanCtx := Extract(ctx, &metadataCopy, opts...) - ctx = baggage.ContextWithMap(ctx, baggage.NewMap(baggage.MapUpdate{ - MultiKV: entries, - })) + ctx = otel.ContextWithBaggageValues(ctx, entries...) tracer := newConfig(opts).TracerProvider.Tracer( instrumentationName, @@ -328,7 +326,7 @@ func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor { resp, err := handler(ctx, req) if err != nil { s, _ := status.FromError(err) - span.SetStatus(codes.Code(s.Code()), s.Message()) + span.SetStatus(codes.Error, s.Message()) messageSent.Event(ctx, 1, s.Proto()) } else { messageSent.Event(ctx, 1, resp) @@ -394,9 +392,7 @@ func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor { metadataCopy := requestMetadata.Copy() entries, spanCtx := Extract(ctx, &metadataCopy, opts...) - ctx = baggage.ContextWithMap(ctx, baggage.NewMap(baggage.MapUpdate{ - MultiKV: entries, - })) + ctx = otel.ContextWithBaggageValues(ctx, entries...) tracer := newConfig(opts).TracerProvider.Tracer( instrumentationName, @@ -416,7 +412,7 @@ func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor { if err != nil { s, _ := status.FromError(err) - span.SetStatus(codes.Code(s.Code()), s.Message()) + span.SetStatus(codes.Error, s.Message()) } return err diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/interceptor_test.go b/instrumentation/google.golang.org/grpc/otelgrpc/interceptor_test.go index a78b151d57a..9e822f04faf 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/interceptor_test.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/interceptor_test.go @@ -354,7 +354,7 @@ func TestServerInterceptorError(t *testing.T) { if !ok { t.Fatalf("failed to export error span") } - assert.Equal(t, span.StatusCode(), otelcodes.PermissionDenied) + assert.Equal(t, span.StatusCode(), otelcodes.Error) assert.Contains(t, deniedErr.Error(), span.StatusMessage()) assert.Len(t, span.Events(), 2) assert.Equal(t, map[label.Key]label.Value{ diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/config.go b/instrumentation/gopkg.in/macaron.v1/otelmacaron/config.go index 6e64f621202..0c5c39f3343 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/config.go +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/config.go @@ -15,15 +15,15 @@ package otelmacaron import ( + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/global" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" ) // config is a group of options for this instrumentation. type config struct { TracerProvider trace.TracerProvider - Propagators propagation.Propagators + Propagators otel.TextMapPropagator } // Option applies an option value for a config. @@ -34,7 +34,7 @@ type Option interface { // newConfig returns a config configured with all the passed Options. func newConfig(opts []Option) *config { c := &config{ - Propagators: global.Propagators(), + Propagators: global.TextMapPropagator(), TracerProvider: global.TracerProvider(), } for _, o := range opts { @@ -43,7 +43,7 @@ func newConfig(opts []Option) *config { return c } -type propagatorsOption struct{ p propagation.Propagators } +type propagatorsOption struct{ p otel.TextMapPropagator } func (o propagatorsOption) Apply(c *config) { c.Propagators = o.p @@ -51,7 +51,7 @@ func (o propagatorsOption) Apply(c *config) { // WithPropagators returns an Option to use the Propagators when extracting // and injecting trace context from HTTP requests. -func WithPropagators(p propagation.Propagators) Option { +func WithPropagators(p otel.TextMapPropagator) Option { return propagatorsOption{p: p} } diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.mod b/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.mod index b75b7f643cf..cf812ab6824 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.mod +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.mod @@ -9,9 +9,9 @@ replace ( ) require ( - go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron v0.12.0 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/exporters/stdout v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron v0.13.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/exporters/stdout v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 gopkg.in/macaron.v1 v1.3.9 ) diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.sum b/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.sum index 63dc489d28b..93a167b972a 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.sum +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/go.sum @@ -1,28 +1,12 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8= github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/go-macaron/inject v0.0.0-20160627170012-d8a0b8677191 h1:NjHlg70DuOkcAMqgt0+XA+NHwtu66MkTVVgR4fFWbcI= github.com/go-macaron/inject v0.0.0-20160627170012-d8a0b8677191/go.mod h1:VFI2o2q9kYsC4o7VP1HrEVosiZZTd+MVT3YZx4gqvJw= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -41,7 +25,6 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v0.0.0-20190116191733-b6c0e53d7304/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.1 h1:voD4ITNjPL5jjBfgR/r8fPIIBrliWrWHeiJApdr3r4w= @@ -54,49 +37,23 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e h1:GSGeB9EAKY2spCABz6xOX5DbxZEXolK+nBSvmsQwRjM= github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/exporters/stdout v0.12.0 h1:ji9VVPmKg+oONcqwULcO0AHZseGU6CFOIdvwKCxNZ9Y= -go.opentelemetry.io/otel/exporters/stdout v0.12.0/go.mod h1:IGUi+IGDXlxXo7nYuPrxfAEpqTcKsWqFtflwFMGGPZQ= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/exporters/stdout v0.13.0 h1:A+XiGIPQbGoJoBOJfKAKnZyiUSjSWvL3XWETUvtom5k= +go.opentelemetry.io/otel/exporters/stdout v0.13.0/go.mod h1:JJt8RpNY6K+ft9ir3iKpceCvT/rhzJXEExGrWFCbv1o= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -106,5 +63,3 @@ gopkg.in/macaron.v1 v1.3.9 h1:Dw+DDRYdXgQyEsPlfAfKz+UA5qVUrH3KPD7JhmZ9MFc= gopkg.in/macaron.v1 v1.3.9/go.mod h1:uMZCFccv9yr5TipIalVOyAyZQuOH3OkmXvgcWwhJuP4= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/server.go b/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/server.go index 8e88083939b..75769572e27 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/server.go +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/example/server.go @@ -22,10 +22,12 @@ import ( "go.opentelemetry.io/contrib/instrumentation/gopkg.in/macaron.v1/otelmacaron" + "go.opentelemetry.io/otel" otelglobal "go.opentelemetry.io/otel/api/global" oteltrace "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/exporters/stdout" "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/propagators" sdktrace "go.opentelemetry.io/otel/sdk/trace" ) @@ -59,6 +61,7 @@ func initTracer() { log.Fatal(err) } otelglobal.SetTracerProvider(tp) + otelglobal.SetTextMapPropagator(otel.NewCompositeTextMapPropagator(propagators.TraceContext{}, propagators.Baggage{})) } func getUser(ctx context.Context, id string) string { diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.mod b/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.mod index 4fe3d9e09d5..5c6ae62eed2 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.mod +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.mod @@ -9,8 +9,8 @@ replace ( require ( github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/contrib/propagators v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/contrib/propagators v0.13.0 + go.opentelemetry.io/otel v0.13.0 gopkg.in/macaron.v1 v1.3.9 ) diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.sum b/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.sum index 71e205ad330..fe8eea0c5fa 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.sum +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/go.sum @@ -32,8 +32,8 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e h1:GSGeB9EAKY2spCABz6xOX5DbxZEXolK+nBSvmsQwRjM= github.com/unknwon/com v0.0.0-20190804042917-757f69c95f3e/go.mod h1:tOOxU81rwgoCLoOVVPHb6T/wt8HZygqH5id+GNnlCXM= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/macaron.go b/instrumentation/gopkg.in/macaron.v1/otelmacaron/macaron.go index a058c977aba..bbbddb45b37 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/macaron.go +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/macaron.go @@ -20,7 +20,6 @@ import ( "gopkg.in/macaron.v1" - otelpropagation "go.opentelemetry.io/otel/api/propagation" oteltrace "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/semconv" @@ -43,7 +42,7 @@ func Middleware(service string, opts ...Option) macaron.Handler { c.Req.Request = c.Req.Request.WithContext(savedCtx) }() - ctx := otelpropagation.ExtractHTTP(savedCtx, cfg.Propagators, c.Req.Header) + ctx := cfg.Propagators.Extract(savedCtx, c.Req.Header) opts := []oteltrace.SpanOption{ oteltrace.WithAttributes(semconv.NetAttributesFromHTTPRequest("tcp", c.Req.Request)...), oteltrace.WithAttributes(semconv.EndUserAttributesFromHTTPRequest(c.Req.Request)...), diff --git a/instrumentation/gopkg.in/macaron.v1/otelmacaron/macaron_test.go b/instrumentation/gopkg.in/macaron.v1/otelmacaron/macaron_test.go index b978a43ffd7..6be35e5c0e9 100644 --- a/instrumentation/gopkg.in/macaron.v1/otelmacaron/macaron_test.go +++ b/instrumentation/gopkg.in/macaron.v1/otelmacaron/macaron_test.go @@ -25,11 +25,12 @@ import ( "gopkg.in/macaron.v1" b3prop "go.opentelemetry.io/contrib/propagators/b3" + "go.opentelemetry.io/otel" otelglobal "go.opentelemetry.io/otel/api/global" - otelpropagation "go.opentelemetry.io/otel/api/propagation" oteltrace "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/api/trace/tracetest" "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/propagators" ) func TestChildSpanFromGlobalTracer(t *testing.T) { @@ -120,12 +121,13 @@ func TestGetSpanNotInstrumented(t *testing.T) { func TestPropagationWithGlobalPropagators(t *testing.T) { tracer := tracetest.NewTracerProvider().Tracer("test-tracer") + otelglobal.SetTextMapPropagator(propagators.TraceContext{}) r := httptest.NewRequest("GET", "/user/123", nil) w := httptest.NewRecorder() ctx, pspan := tracer.Start(context.Background(), "test") - otelpropagation.InjectHTTP(ctx, otelglobal.Propagators(), r.Header) + otelglobal.TextMapPropagator().Inject(ctx, r.Header) m := macaron.Classic() m.Use(Middleware("foobar")) @@ -139,25 +141,22 @@ func TestPropagationWithGlobalPropagators(t *testing.T) { }) m.ServeHTTP(w, r) + otelglobal.SetTextMapPropagator(otel.NewCompositeTextMapPropagator()) } func TestPropagationWithCustomPropagators(t *testing.T) { tp := tracetest.NewTracerProvider() tracer := tp.Tracer("test-tracer") b3 := b3prop.B3{} - props := otelpropagation.New( - otelpropagation.WithExtractors(b3), - otelpropagation.WithInjectors(b3), - ) r := httptest.NewRequest("GET", "/user/123", nil) w := httptest.NewRecorder() ctx, pspan := tracer.Start(context.Background(), "test") - otelpropagation.InjectHTTP(ctx, props, r.Header) + b3.Inject(ctx, r.Header) m := macaron.Classic() - m.Use(Middleware("foobar", WithTracerProvider(tp), WithPropagators(props))) + m.Use(Middleware("foobar", WithTracerProvider(tp), WithPropagators(b3))) m.Get("/user/:id", func(ctx *macaron.Context) { span := oteltrace.SpanFromContext(ctx.Req.Request.Context()) mspan, ok := span.(*tracetest.Span) diff --git a/instrumentation/host/example/go.mod b/instrumentation/host/example/go.mod index cfb7c9c66c9..333bde25fdd 100644 --- a/instrumentation/host/example/go.mod +++ b/instrumentation/host/example/go.mod @@ -8,7 +8,7 @@ replace ( ) require ( - go.opentelemetry.io/contrib/instrumentation/host v0.12.0 - go.opentelemetry.io/otel/exporters/stdout v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/contrib/instrumentation/host v0.13.0 + go.opentelemetry.io/otel/exporters/stdout v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/instrumentation/host/example/go.sum b/instrumentation/host/example/go.sum index fc8e6a507fd..15efd817b27 100644 --- a/instrumentation/host/example/go.sum +++ b/instrumentation/host/example/go.sum @@ -1,30 +1,14 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8= github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk= github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI= github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -36,55 +20,23 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/shirou/gopsutil v2.20.9+incompatible h1:msXs2frUV+O/JLva9EDLpuJ84PrFsdCTCQex8PUdtkQ= github.com/shirou/gopsutil v2.20.9+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/exporters/stdout v0.12.0 h1:ji9VVPmKg+oONcqwULcO0AHZseGU6CFOIdvwKCxNZ9Y= -go.opentelemetry.io/otel/exporters/stdout v0.12.0/go.mod h1:IGUi+IGDXlxXo7nYuPrxfAEpqTcKsWqFtflwFMGGPZQ= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/exporters/stdout v0.13.0 h1:A+XiGIPQbGoJoBOJfKAKnZyiUSjSWvL3XWETUvtom5k= +go.opentelemetry.io/otel/exporters/stdout v0.13.0/go.mod h1:JJt8RpNY6K+ft9ir3iKpceCvT/rhzJXEExGrWFCbv1o= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/instrumentation/host/go.mod b/instrumentation/host/go.mod index 98bc5224a1a..c8fca39a7f5 100644 --- a/instrumentation/host/go.mod +++ b/instrumentation/host/go.mod @@ -9,7 +9,7 @@ require ( github.com/go-ole/go-ole v1.2.4 // indirect github.com/shirou/gopsutil v2.20.9+incompatible github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/otel v0.13.0 golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a // indirect ) diff --git a/instrumentation/host/go.sum b/instrumentation/host/go.sum index b3b5c8f2829..539a393493b 100644 --- a/instrumentation/host/go.sum +++ b/instrumentation/host/go.sum @@ -19,8 +19,8 @@ github.com/shirou/gopsutil v2.20.9+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= diff --git a/instrumentation/net/http/httptrace/otelhttptrace/clienttrace.go b/instrumentation/net/http/httptrace/otelhttptrace/clienttrace.go index 03ceefe5386..4a5ac6bd38c 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/clienttrace.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/clienttrace.go @@ -117,7 +117,7 @@ func (ct *clientTracer) end(hook string, err error, attrs ...label.KeyValue) { if ctx, ok := ct.activeHooks[hook]; ok { span := trace.SpanFromContext(ctx) if err != nil { - span.SetStatus(codes.Unknown, err.Error()) + span.SetStatus(codes.Error, err.Error()) } span.SetAttributes(attrs...) span.End() @@ -128,7 +128,7 @@ func (ct *clientTracer) end(hook string, err error, attrs ...label.KeyValue) { // Yes, it's backwards. v0v ctx, span := ct.tr.Start(ct.getParentContext(hook), hook, trace.WithAttributes(attrs...), trace.WithSpanKind(trace.SpanKindClient)) if err != nil { - span.SetStatus(codes.Unknown, err.Error()) + span.SetStatus(codes.Error, err.Error()) } ct.activeHooks[hook] = ctx } @@ -211,7 +211,7 @@ func (ct *clientTracer) wroteHeaders() { func (ct *clientTracer) wroteRequest(info httptrace.WroteRequestInfo) { if info.Err != nil { - ct.root.SetStatus(codes.Unknown, info.Err.Error()) + ct.root.SetStatus(codes.Error, info.Err.Error()) } ct.end("http.send", info.Err) } diff --git a/instrumentation/net/http/httptrace/otelhttptrace/example/client/client.go b/instrumentation/net/http/httptrace/otelhttptrace/example/client/client.go index 93d171117d1..bafccd82370 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/example/client/client.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/example/client/client.go @@ -28,11 +28,12 @@ import ( "go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace" "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" - "go.opentelemetry.io/otel/api/baggage" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/global" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/exporters/stdout" "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/propagators" sdktrace "go.opentelemetry.io/otel/sdk/trace" "go.opentelemetry.io/otel/semconv" ) @@ -53,6 +54,7 @@ func initTracer() { log.Fatal(err) } global.SetTracerProvider(tp) + global.SetTextMapPropagator(otel.NewCompositeTextMapPropagator(propagators.TraceContext{}, propagators.Baggage{})) } func main() { @@ -62,18 +64,18 @@ func main() { client := http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)} - ctx := baggage.NewContext(context.Background(), + ctx := otel.ContextWithBaggageValues(context.Background(), label.String("username", "donuts"), ) - ctx = httptrace.WithClientTrace(ctx, otelhttptrace.NewClientTrace(ctx)) - var body []byte tr := global.Tracer("example/client") err := func(ctx context.Context) error { ctx, span := tr.Start(ctx, "say hello", trace.WithAttributes(semconv.PeerServiceKey.String("ExampleService"))) defer span.End() + + ctx = httptrace.WithClientTrace(ctx, otelhttptrace.NewClientTrace(ctx)) req, _ := http.NewRequestWithContext(ctx, "GET", *url, nil) fmt.Printf("Sending request...\n") diff --git a/instrumentation/net/http/httptrace/otelhttptrace/example/go.mod b/instrumentation/net/http/httptrace/otelhttptrace/example/go.mod index b030aada8d5..49eff460b89 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/example/go.mod +++ b/instrumentation/net/http/httptrace/otelhttptrace/example/go.mod @@ -9,9 +9,9 @@ replace ( ) require ( - go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.12.0 - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.12.0 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/exporters/stdout v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.13.0 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.13.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/exporters/stdout v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/instrumentation/net/http/httptrace/otelhttptrace/example/go.sum b/instrumentation/net/http/httptrace/otelhttptrace/example/go.sum index 5b84893e729..11a1d38375f 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/example/go.sum +++ b/instrumentation/net/http/httptrace/otelhttptrace/example/go.sum @@ -1,30 +1,12 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8= github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -36,52 +18,19 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/exporters/stdout v0.12.0 h1:ji9VVPmKg+oONcqwULcO0AHZseGU6CFOIdvwKCxNZ9Y= -go.opentelemetry.io/otel/exporters/stdout v0.12.0/go.mod h1:IGUi+IGDXlxXo7nYuPrxfAEpqTcKsWqFtflwFMGGPZQ= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/exporters/stdout v0.13.0 h1:A+XiGIPQbGoJoBOJfKAKnZyiUSjSWvL3XWETUvtom5k= +go.opentelemetry.io/otel/exporters/stdout v0.13.0/go.mod h1:JJt8RpNY6K+ft9ir3iKpceCvT/rhzJXEExGrWFCbv1o= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/instrumentation/net/http/httptrace/otelhttptrace/example/server/server.go b/instrumentation/net/http/httptrace/otelhttptrace/example/server/server.go index 6bf02ae1d51..da22da7d2ce 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/example/server/server.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/example/server/server.go @@ -21,9 +21,12 @@ import ( "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/global" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/exporters/stdout" + "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/propagators" "go.opentelemetry.io/otel/sdk/resource" sdktrace "go.opentelemetry.io/otel/sdk/trace" "go.opentelemetry.io/otel/semconv" @@ -46,15 +49,19 @@ func initTracer() { log.Fatal(err) } global.SetTracerProvider(tp) + global.SetTextMapPropagator(otel.NewCompositeTextMapPropagator(propagators.TraceContext{}, propagators.Baggage{})) } func main() { initTracer() + uk := label.Key("username") + helloHandler := func(w http.ResponseWriter, req *http.Request) { ctx := req.Context() span := trace.SpanFromContext(ctx) - span.AddEvent(ctx, "handling this...") + username := otel.BaggageValue(ctx, uk) + span.AddEvent(ctx, "handling this...", uk.String(username.AsString())) _, _ = io.WriteString(w, "Hello, world!\n") } diff --git a/instrumentation/net/http/httptrace/otelhttptrace/go.mod b/instrumentation/net/http/httptrace/otelhttptrace/go.mod index 65fd87a0551..371b8ce291e 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/go.mod +++ b/instrumentation/net/http/httptrace/otelhttptrace/go.mod @@ -5,5 +5,5 @@ go 1.14 require ( github.com/google/go-cmp v0.5.2 github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/otel v0.13.0 ) diff --git a/instrumentation/net/http/httptrace/otelhttptrace/go.sum b/instrumentation/net/http/httptrace/otelhttptrace/go.sum index de18ff70187..3c2067cd595 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/go.sum +++ b/instrumentation/net/http/httptrace/otelhttptrace/go.sum @@ -7,8 +7,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/instrumentation/net/http/httptrace/otelhttptrace/httptrace.go b/instrumentation/net/http/httptrace/otelhttptrace/httptrace.go index 9c3b5961f00..7b6a121a2ac 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/httptrace.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/httptrace.go @@ -18,9 +18,8 @@ import ( "context" "net/http" - "go.opentelemetry.io/otel/api/baggage" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/global" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" "go.opentelemetry.io/otel/semconv" @@ -31,11 +30,11 @@ import ( type Option func(*config) type config struct { - propagators propagation.Propagators + propagators otel.TextMapPropagator } func newConfig(opts []Option) *config { - c := &config{propagators: global.Propagators()} + c := &config{propagators: global.TextMapPropagator()} for _, o := range opts { o(c) } @@ -43,7 +42,7 @@ func newConfig(opts []Option) *config { } // WithPropagators sets the propagators to use for Extraction and Injection -func WithPropagators(props propagation.Propagators) Option { +func WithPropagators(props otel.TextMapPropagator) Option { return func(c *config) { c.propagators = props } @@ -52,23 +51,18 @@ func WithPropagators(props propagation.Propagators) Option { // Returns the Attributes, Context Entries, and SpanContext that were encoded by Inject. func Extract(ctx context.Context, req *http.Request, opts ...Option) ([]label.KeyValue, []label.KeyValue, trace.SpanContext) { c := newConfig(opts) - ctx = propagation.ExtractHTTP(ctx, c.propagators, req.Header) + ctx = c.propagators.Extract(ctx, req.Header) attrs := append( semconv.HTTPServerAttributesFromHTTPRequest("", "", req), semconv.NetAttributesFromHTTPRequest("tcp", req)..., ) - var correlationCtxLabels []label.KeyValue - baggage.MapFromContext(ctx).Foreach(func(lbl label.KeyValue) bool { - correlationCtxLabels = append(correlationCtxLabels, lbl) - return true - }) - - return attrs, correlationCtxLabels, trace.RemoteSpanContextFromContext(ctx) + labels := otel.Baggage(ctx) + return attrs, (&labels).ToSlice(), trace.RemoteSpanContextFromContext(ctx) } func Inject(ctx context.Context, req *http.Request, opts ...Option) { c := newConfig(opts) - propagation.InjectHTTP(ctx, c.propagators, req.Header) + c.propagators.Inject(ctx, req.Header) } diff --git a/instrumentation/net/http/httptrace/otelhttptrace/httptrace_test.go b/instrumentation/net/http/httptrace/otelhttptrace/httptrace_test.go index 36fc470bf7f..bac1284f696 100644 --- a/instrumentation/net/http/httptrace/otelhttptrace/httptrace_test.go +++ b/instrumentation/net/http/httptrace/otelhttptrace/httptrace_test.go @@ -24,10 +24,10 @@ import ( "github.com/google/go-cmp/cmp" "go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace" - "go.opentelemetry.io/otel/api/baggage" - "go.opentelemetry.io/otel/api/propagation" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/trace/tracetest" "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/propagators" "go.opentelemetry.io/otel/semconv" ) @@ -37,10 +37,12 @@ func TestRoundtrip(t *testing.T) { var expectedAttrs map[label.Key]string expectedCorrs := map[label.Key]string{label.Key("foo"): "bar"} + props := otelhttptrace.WithPropagators(otel.NewCompositeTextMapPropagator(propagators.TraceContext{}, propagators.Baggage{})) + // Mock http server ts := httptest.NewServer( http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - attrs, corrs, span := otelhttptrace.Extract(r.Context(), r) + attrs, corrs, span := otelhttptrace.Extract(r.Context(), r, props) actualAttrs := make(map[label.Key]string) for _, attr := range attrs { @@ -96,9 +98,9 @@ func TestRoundtrip(t *testing.T) { err := func(ctx context.Context) error { ctx, span := tr.Start(ctx, "test") defer span.End() - ctx = baggage.ContextWithMap(ctx, baggage.NewMap(baggage.MapUpdate{SingleKV: label.Key("foo").String("bar")})) + ctx = otel.ContextWithBaggageValues(ctx, label.String("foo", "bar")) req, _ := http.NewRequest("GET", ts.URL, strings.NewReader("foo")) - otelhttptrace.Inject(ctx, req) + otelhttptrace.Inject(ctx, req, props) res, err := client.Do(req) if err != nil { @@ -121,7 +123,7 @@ func TestSpecifyPropagators(t *testing.T) { // Mock http server ts := httptest.NewServer( http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - _, corrs, span := otelhttptrace.Extract(r.Context(), r, otelhttptrace.WithPropagators(propagation.New(propagation.WithExtractors(baggage.DefaultHTTPPropagator())))) + _, corrs, span := otelhttptrace.Extract(r.Context(), r, otelhttptrace.WithPropagators(propagators.Baggage{})) actualCorrs := make(map[label.Key]string) for _, corr := range corrs { @@ -148,9 +150,9 @@ func TestSpecifyPropagators(t *testing.T) { err := func(ctx context.Context) error { ctx, span := tr.Start(ctx, "test") defer span.End() - ctx = baggage.ContextWithMap(ctx, baggage.NewMap(baggage.MapUpdate{SingleKV: label.Key("foo").String("bar")})) + ctx = otel.ContextWithBaggageValues(ctx, label.String("foo", "bar")) req, _ := http.NewRequest("GET", ts.URL, nil) - otelhttptrace.Inject(ctx, req, otelhttptrace.WithPropagators(propagation.New(propagation.WithInjectors(baggage.DefaultHTTPPropagator())))) + otelhttptrace.Inject(ctx, req, otelhttptrace.WithPropagators(propagators.Baggage{})) res, err := client.Do(req) if err != nil { diff --git a/instrumentation/net/http/otelhttp/config.go b/instrumentation/net/http/otelhttp/config.go index cb8dc94305f..35ca06ae1cd 100644 --- a/instrumentation/net/http/otelhttp/config.go +++ b/instrumentation/net/http/otelhttp/config.go @@ -17,9 +17,9 @@ package otelhttp import ( "net/http" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/global" "go.opentelemetry.io/otel/api/metric" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" ) @@ -32,7 +32,7 @@ const ( type config struct { Tracer trace.Tracer Meter metric.Meter - Propagators propagation.Propagators + Propagators otel.TextMapPropagator SpanStartOptions []trace.SpanOption ReadEvent bool WriteEvent bool @@ -59,7 +59,7 @@ func (o OptionFunc) Apply(c *config) { // newConfig creates a new config struct and applies opts to it. func newConfig(opts ...Option) *config { c := &config{ - Propagators: global.Propagators(), + Propagators: global.TextMapPropagator(), TracerProvider: global.TracerProvider(), MeterProvider: global.MeterProvider(), } @@ -100,8 +100,8 @@ func WithPublicEndpoint() Option { // WithPropagators configures specific propagators. If this // option isn't specified then -// go.opentelemetry.io/otel/api/global.Propagators are used. -func WithPropagators(ps propagation.Propagators) Option { +// go.opentelemetry.io/otel/api/global.TextMapPropagator() is used. +func WithPropagators(ps otel.TextMapPropagator) Option { return OptionFunc(func(c *config) { c.Propagators = ps }) diff --git a/instrumentation/net/http/otelhttp/example/client/client.go b/instrumentation/net/http/otelhttp/example/client/client.go index c5264dab84a..9b1e2cdd4e9 100644 --- a/instrumentation/net/http/otelhttp/example/client/client.go +++ b/instrumentation/net/http/otelhttp/example/client/client.go @@ -26,11 +26,12 @@ import ( "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" - "go.opentelemetry.io/otel/api/baggage" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/global" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/exporters/stdout" "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/propagators" sdktrace "go.opentelemetry.io/otel/sdk/trace" "go.opentelemetry.io/otel/semconv" ) @@ -51,6 +52,7 @@ func initTracer() { log.Fatal(err) } global.SetTracerProvider(tp) + global.SetTextMapPropagator(otel.NewCompositeTextMapPropagator(propagators.TraceContext{}, propagators.Baggage{})) } func main() { @@ -60,7 +62,7 @@ func main() { client := http.Client{Transport: otelhttp.NewTransport(http.DefaultTransport)} - ctx := baggage.NewContext(context.Background(), + ctx := otel.ContextWithBaggageValues(context.Background(), label.String("username", "donuts"), ) diff --git a/instrumentation/net/http/otelhttp/example/go.mod b/instrumentation/net/http/otelhttp/example/go.mod index 9227faa97a9..339c3fda830 100644 --- a/instrumentation/net/http/otelhttp/example/go.mod +++ b/instrumentation/net/http/otelhttp/example/go.mod @@ -8,8 +8,8 @@ replace ( ) require ( - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.12.0 - go.opentelemetry.io/otel v0.12.0 - go.opentelemetry.io/otel/exporters/stdout v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.13.0 + go.opentelemetry.io/otel v0.13.0 + go.opentelemetry.io/otel/exporters/stdout v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/instrumentation/net/http/otelhttp/example/go.sum b/instrumentation/net/http/otelhttp/example/go.sum index 5b84893e729..11a1d38375f 100644 --- a/instrumentation/net/http/otelhttp/example/go.sum +++ b/instrumentation/net/http/otelhttp/example/go.sum @@ -1,30 +1,12 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8= github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/felixge/httpsnoop v1.0.1 h1:lvB5Jl89CsZtGIWuTcDM1E/vkVs49/Ml7JJe07l8SPQ= github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -36,52 +18,19 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/exporters/stdout v0.12.0 h1:ji9VVPmKg+oONcqwULcO0AHZseGU6CFOIdvwKCxNZ9Y= -go.opentelemetry.io/otel/exporters/stdout v0.12.0/go.mod h1:IGUi+IGDXlxXo7nYuPrxfAEpqTcKsWqFtflwFMGGPZQ= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/exporters/stdout v0.13.0 h1:A+XiGIPQbGoJoBOJfKAKnZyiUSjSWvL3XWETUvtom5k= +go.opentelemetry.io/otel/exporters/stdout v0.13.0/go.mod h1:JJt8RpNY6K+ft9ir3iKpceCvT/rhzJXEExGrWFCbv1o= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/instrumentation/net/http/otelhttp/example/server/server.go b/instrumentation/net/http/otelhttp/example/server/server.go index 6bf02ae1d51..da22da7d2ce 100644 --- a/instrumentation/net/http/otelhttp/example/server/server.go +++ b/instrumentation/net/http/otelhttp/example/server/server.go @@ -21,9 +21,12 @@ import ( "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/global" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/exporters/stdout" + "go.opentelemetry.io/otel/label" + "go.opentelemetry.io/otel/propagators" "go.opentelemetry.io/otel/sdk/resource" sdktrace "go.opentelemetry.io/otel/sdk/trace" "go.opentelemetry.io/otel/semconv" @@ -46,15 +49,19 @@ func initTracer() { log.Fatal(err) } global.SetTracerProvider(tp) + global.SetTextMapPropagator(otel.NewCompositeTextMapPropagator(propagators.TraceContext{}, propagators.Baggage{})) } func main() { initTracer() + uk := label.Key("username") + helloHandler := func(w http.ResponseWriter, req *http.Request) { ctx := req.Context() span := trace.SpanFromContext(ctx) - span.AddEvent(ctx, "handling this...") + username := otel.BaggageValue(ctx, uk) + span.AddEvent(ctx, "handling this...", uk.String(username.AsString())) _, _ = io.WriteString(w, "Hello, world!\n") } diff --git a/instrumentation/net/http/otelhttp/go.mod b/instrumentation/net/http/otelhttp/go.mod index 6b444a672b9..3542e4e486e 100644 --- a/instrumentation/net/http/otelhttp/go.mod +++ b/instrumentation/net/http/otelhttp/go.mod @@ -7,6 +7,6 @@ replace go.opentelemetry.io/contrib => ../../../.. require ( github.com/felixge/httpsnoop v1.0.1 github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/otel v0.13.0 ) diff --git a/instrumentation/net/http/otelhttp/go.sum b/instrumentation/net/http/otelhttp/go.sum index 14f53cb7e35..2d8036638ec 100644 --- a/instrumentation/net/http/otelhttp/go.sum +++ b/instrumentation/net/http/otelhttp/go.sum @@ -15,8 +15,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/instrumentation/net/http/otelhttp/handler.go b/instrumentation/net/http/otelhttp/handler.go index 78646537c35..3bbb1dabe1c 100644 --- a/instrumentation/net/http/otelhttp/handler.go +++ b/instrumentation/net/http/otelhttp/handler.go @@ -21,9 +21,9 @@ import ( "github.com/felixge/httpsnoop" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/global" "go.opentelemetry.io/otel/api/metric" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" "go.opentelemetry.io/otel/semconv" @@ -41,7 +41,7 @@ type Handler struct { tracer trace.Tracer meter metric.Meter - propagators propagation.Propagators + propagators otel.TextMapPropagator spanStartOptions []trace.SpanOption readEvent bool writeEvent bool @@ -127,7 +127,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { trace.WithAttributes(semconv.HTTPServerAttributesFromHTTPRequest(h.operation, "", r)...), }, h.spanStartOptions...) // start with the configured options - ctx := propagation.ExtractHTTP(r.Context(), h.propagators, r.Header) + ctx := h.propagators.Extract(r.Context(), r.Header) ctx, span := h.tracer.Start(ctx, h.spanNameFormatter(h.operation, r), opts...) defer span.End() diff --git a/instrumentation/net/http/otelhttp/handler_test.go b/instrumentation/net/http/otelhttp/handler_test.go index e479b646489..fbe02859a30 100644 --- a/instrumentation/net/http/otelhttp/handler_test.go +++ b/instrumentation/net/http/otelhttp/handler_test.go @@ -25,6 +25,7 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/otel/codes" + "go.opentelemetry.io/otel/propagators" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/label" @@ -59,6 +60,7 @@ func TestHandlerBasics(t *testing.T) { }), operation, WithTracerProvider(tracerProvider), WithMeterProvider(meterProvider), + WithPropagators(propagators.TraceContext{}), ) r, err := http.NewRequest(http.MethodGet, "http://localhost/", strings.NewReader("foo")) @@ -112,6 +114,7 @@ func TestHandlerNoWrite(t *testing.T) { span = trace.SpanFromContext(r.Context()) }), operation, WithTracerProvider(tracerProvider), + WithPropagators(propagators.TraceContext{}), ) r, err := http.NewRequest(http.MethodGet, "http://localhost/", nil) @@ -130,7 +133,7 @@ func TestHandlerNoWrite(t *testing.T) { t.Fatalf("got %d, expected %d", got, expected) } if mockSpan, ok := span.(*mocktrace.Span); ok { - if got, expected := mockSpan.Status, codes.OK; got != expected { + if got, expected := mockSpan.Status, codes.Unset; got != expected { t.Fatalf("got %q, expected %q", got, expected) } } else { diff --git a/instrumentation/net/http/otelhttp/transport.go b/instrumentation/net/http/otelhttp/transport.go index 378508d7cdc..04ec0d14978 100644 --- a/instrumentation/net/http/otelhttp/transport.go +++ b/instrumentation/net/http/otelhttp/transport.go @@ -19,7 +19,7 @@ import ( "io" "net/http" - "go.opentelemetry.io/otel/api/propagation" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/trace" "go.opentelemetry.io/otel/semconv" @@ -32,7 +32,7 @@ type Transport struct { rt http.RoundTripper tracer trace.Tracer - propagators propagation.Propagators + propagators otel.TextMapPropagator spanStartOptions []trace.SpanOption filters []Filter spanNameFormatter func(string, *http.Request) string @@ -87,11 +87,11 @@ func (t *Transport) RoundTrip(r *http.Request) (*http.Response, error) { r = r.WithContext(ctx) span.SetAttributes(semconv.HTTPClientAttributesFromHTTPRequest(r)...) - propagation.InjectHTTP(ctx, t.propagators, r.Header) + t.propagators.Inject(ctx, r.Header) res, err := t.rt.RoundTrip(r) if err != nil { - span.RecordError(ctx, err, trace.WithErrorStatus(codes.Internal)) + span.RecordError(ctx, err, trace.WithErrorStatus(codes.Error)) span.End() return res, err } @@ -120,7 +120,7 @@ func (wb *wrappedBody) Read(b []byte) (int, error) { case io.EOF: wb.span.End() default: - wb.span.RecordError(wb.ctx, err, trace.WithErrorStatus(codes.Internal)) + wb.span.RecordError(wb.ctx, err, trace.WithErrorStatus(codes.Error)) } return n, err } diff --git a/instrumentation/net/http/otelhttp/transport_test.go b/instrumentation/net/http/otelhttp/transport_test.go index fdce388f43e..27bdca3ac5b 100644 --- a/instrumentation/net/http/otelhttp/transport_test.go +++ b/instrumentation/net/http/otelhttp/transport_test.go @@ -22,19 +22,19 @@ import ( "net/http/httptest" "testing" - "go.opentelemetry.io/otel/api/global" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" + "go.opentelemetry.io/otel/propagators" mocktrace "go.opentelemetry.io/contrib/internal/trace" ) func TestTransportBasics(t *testing.T) { + prop := propagators.TraceContext{} provider, tracer := mocktrace.NewTracerProviderAndTracer(instrumentationName) content := []byte("Hello, world!") ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - ctx := propagation.ExtractHTTP(r.Context(), global.Propagators(), r.Header) + ctx := prop.Extract(r.Context(), r.Header) span := trace.RemoteSpanContextFromContext(ctx) tgtID, err := trace.SpanIDFromHex(fmt.Sprintf("%016x", tracer.StartSpanID)) if err != nil { @@ -57,6 +57,7 @@ func TestTransportBasics(t *testing.T) { tr := NewTransport( http.DefaultTransport, WithTracerProvider(provider), + WithPropagators(prop), ) c := http.Client{Transport: tr} diff --git a/instrumentation/net/http/otelhttp/wrap.go b/instrumentation/net/http/otelhttp/wrap.go index c7a74d32694..11d8538044d 100644 --- a/instrumentation/net/http/otelhttp/wrap.go +++ b/instrumentation/net/http/otelhttp/wrap.go @@ -19,7 +19,7 @@ import ( "io" "net/http" - "go.opentelemetry.io/otel/api/propagation" + "go.opentelemetry.io/otel" ) var _ io.ReadCloser = &bodyWrapper{} @@ -61,7 +61,7 @@ type respWriterWrapper struct { // used to inject the header ctx context.Context - props propagation.Propagators + props otel.TextMapPropagator written int64 statusCode int @@ -91,6 +91,6 @@ func (w *respWriterWrapper) WriteHeader(statusCode int) { } w.wroteHeader = true w.statusCode = statusCode - propagation.InjectHTTP(w.ctx, w.props, w.Header()) + w.props.Inject(w.ctx, w.Header()) w.ResponseWriter.WriteHeader(statusCode) } diff --git a/instrumentation/runtime/example/go.mod b/instrumentation/runtime/example/go.mod index 2febe1a8bb3..a558f658a33 100644 --- a/instrumentation/runtime/example/go.mod +++ b/instrumentation/runtime/example/go.mod @@ -8,7 +8,7 @@ replace ( ) require ( - go.opentelemetry.io/contrib/instrumentation/runtime v0.12.0 - go.opentelemetry.io/otel/exporters/stdout v0.12.0 - go.opentelemetry.io/otel/sdk v0.12.0 + go.opentelemetry.io/contrib/instrumentation/runtime v0.13.0 + go.opentelemetry.io/otel/exporters/stdout v0.13.0 + go.opentelemetry.io/otel/sdk v0.13.0 ) diff --git a/instrumentation/runtime/example/go.sum b/instrumentation/runtime/example/go.sum index 81a5f02cda7..71282d5fdf8 100644 --- a/instrumentation/runtime/example/go.sum +++ b/instrumentation/runtime/example/go.sum @@ -1,26 +1,10 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8= github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= @@ -32,52 +16,19 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= -go.opentelemetry.io/otel/exporters/stdout v0.12.0 h1:ji9VVPmKg+oONcqwULcO0AHZseGU6CFOIdvwKCxNZ9Y= -go.opentelemetry.io/otel/exporters/stdout v0.12.0/go.mod h1:IGUi+IGDXlxXo7nYuPrxfAEpqTcKsWqFtflwFMGGPZQ= -go.opentelemetry.io/otel/sdk v0.12.0 h1:YVUyDXsGvFWjhJxGXT4kBcGdfoTbo1vSGjbGRUdRh5U= -go.opentelemetry.io/otel/sdk v0.12.0/go.mod h1:u3joRdxhrS1hUf9xSFH8vgdXdujQ3jxXxZl3loZFSqs= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel/exporters/stdout v0.13.0 h1:A+XiGIPQbGoJoBOJfKAKnZyiUSjSWvL3XWETUvtom5k= +go.opentelemetry.io/otel/exporters/stdout v0.13.0/go.mod h1:JJt8RpNY6K+ft9ir3iKpceCvT/rhzJXEExGrWFCbv1o= +go.opentelemetry.io/otel/sdk v0.13.0 h1:4VCfpKamZ8GtnepXxMRurSpHpMKkcxhtO33z1S4rGDQ= +go.opentelemetry.io/otel/sdk v0.13.0/go.mod h1:dKvLH8Uu8LcEPlSAUsfW7kMGaJBhk/1NYvpPZ6wIMbU= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= -google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/instrumentation/runtime/go.mod b/instrumentation/runtime/go.mod index b5155df78b2..8b5057d011a 100644 --- a/instrumentation/runtime/go.mod +++ b/instrumentation/runtime/go.mod @@ -6,6 +6,6 @@ replace go.opentelemetry.io/contrib => ../.. require ( github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/otel v0.13.0 ) diff --git a/instrumentation/runtime/go.sum b/instrumentation/runtime/go.sum index feb0fd86f6d..f6d2c5e2280 100644 --- a/instrumentation/runtime/go.sum +++ b/instrumentation/runtime/go.sum @@ -14,8 +14,8 @@ github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/propagators/b3/b3_example_test.go b/propagators/b3/b3_example_test.go index f8d05e538b9..47a55c46c38 100644 --- a/propagators/b3/b3_example_test.go +++ b/propagators/b3/b3_example_test.go @@ -17,16 +17,12 @@ package b3_test import ( "go.opentelemetry.io/contrib/propagators/b3" "go.opentelemetry.io/otel/api/global" - "go.opentelemetry.io/otel/api/propagation" ) func ExampleB3() { b3 := b3.B3{} // Register the B3 propagator globally. - global.SetPropagators(propagation.New( - propagation.WithExtractors(b3), - propagation.WithInjectors(b3), - )) + global.SetTextMapPropagator(b3) } func ExampleB3_injectEncoding() { @@ -35,8 +31,5 @@ func ExampleB3_injectEncoding() { b3 := b3.B3{ InjectEncoding: b3.B3MultipleHeader | b3.B3SingleHeader, } - global.SetPropagators(propagation.New( - propagation.WithExtractors(b3), - propagation.WithInjectors(b3), - )) + global.SetTextMapPropagator(b3) } diff --git a/propagators/b3/b3_integration_test.go b/propagators/b3/b3_integration_test.go index eaeda28cd3a..d9145141e51 100644 --- a/propagators/b3/b3_integration_test.go +++ b/propagators/b3/b3_integration_test.go @@ -23,7 +23,6 @@ import ( mocktracer "go.opentelemetry.io/contrib/internal/trace" "go.opentelemetry.io/contrib/propagators/b3" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" ) @@ -49,7 +48,6 @@ func TestExtractB3(t *testing.T) { for _, tg := range testGroup { propagator := b3.B3{} - props := propagation.New(propagation.WithExtractors(propagator)) for _, tt := range tg.tests { t.Run(tt.name, func(t *testing.T) { @@ -59,7 +57,7 @@ func TestExtractB3(t *testing.T) { } ctx := context.Background() - ctx = propagation.ExtractHTTP(ctx, props, req.Header) + ctx = propagator.Extract(ctx, req.Header) gotSc := trace.RemoteSpanContextFromContext(ctx) if diff := cmp.Diff(gotSc, tt.wantSc); diff != "" { t.Errorf("%s: %s: -got +want %s", tg.name, tt.name, diff) @@ -124,7 +122,7 @@ func TestInjectB3(t *testing.T) { } } -func TestB3Propagator_GetAllKeys(t *testing.T) { +func TestB3Propagator_Fields(t *testing.T) { tests := []struct { name string propagator b3.B3 @@ -171,8 +169,8 @@ func TestB3Propagator_GetAllKeys(t *testing.T) { } for _, test := range tests { - if diff := cmp.Diff(test.propagator.GetAllKeys(), test.want); diff != "" { - t.Errorf("%s: GetAllKeys: -got +want %s", test.name, diff) + if diff := cmp.Diff(test.propagator.Fields(), test.want); diff != "" { + t.Errorf("%s: Fields: -got +want %s", test.name, diff) } } } diff --git a/propagators/b3/b3_propagator.go b/propagators/b3/b3_propagator.go index 50aebf78114..99a581d0bc3 100644 --- a/propagators/b3/b3_propagator.go +++ b/propagators/b3/b3_propagator.go @@ -19,7 +19,7 @@ import ( "errors" "strings" - "go.opentelemetry.io/otel/api/propagation" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/trace" ) @@ -96,12 +96,12 @@ type B3 struct { InjectEncoding Encoding } -var _ propagation.HTTPPropagator = B3{} +var _ otel.TextMapPropagator = B3{} -// Inject injects a context into the supplier as B3 headers. +// Inject injects a context into the carrier as B3 headers. // The parent span ID is omitted because it is not tracked in the // SpanContext. -func (b3 B3) Inject(ctx context.Context, supplier propagation.HTTPSupplier) { +func (b3 B3) Inject(ctx context.Context, carrier otel.TextMapCarrier) { sc := trace.SpanFromContext(ctx).SpanContext() if b3.InjectEncoding.supports(B3SingleHeader) { @@ -120,37 +120,37 @@ func (b3 B3) Inject(ctx context.Context, supplier propagation.HTTPSupplier) { } } - supplier.Set(b3ContextHeader, strings.Join(header, "-")) + carrier.Set(b3ContextHeader, strings.Join(header, "-")) } if b3.InjectEncoding.supports(B3MultipleHeader) || b3.InjectEncoding == B3Unspecified { if sc.TraceID.IsValid() && sc.SpanID.IsValid() { - supplier.Set(b3TraceIDHeader, sc.TraceID.String()) - supplier.Set(b3SpanIDHeader, sc.SpanID.String()) + carrier.Set(b3TraceIDHeader, sc.TraceID.String()) + carrier.Set(b3SpanIDHeader, sc.SpanID.String()) } if sc.TraceFlags&trace.FlagsDebug == trace.FlagsDebug { // Since Debug implies deferred, don't also send "X-B3-Sampled". - supplier.Set(b3DebugFlagHeader, "1") + carrier.Set(b3DebugFlagHeader, "1") } else if !(sc.TraceFlags&trace.FlagsDeferred == trace.FlagsDeferred) { if sc.IsSampled() { - supplier.Set(b3SampledHeader, "1") + carrier.Set(b3SampledHeader, "1") } else { - supplier.Set(b3SampledHeader, "0") + carrier.Set(b3SampledHeader, "0") } } } } -// Extract extracts a context from the supplier if it contains B3 headers. -func (b3 B3) Extract(ctx context.Context, supplier propagation.HTTPSupplier) context.Context { +// Extract extracts a context from the carrier if it contains B3 headers. +func (b3 B3) Extract(ctx context.Context, carrier otel.TextMapCarrier) context.Context { var ( sc trace.SpanContext err error ) // Default to Single Header if a valid value exists. - if h := supplier.Get(b3ContextHeader); h != "" { + if h := carrier.Get(b3ContextHeader); h != "" { sc, err = extractSingle(h) if err == nil && sc.IsValid() { return trace.ContextWithRemoteSpanContext(ctx, sc) @@ -159,11 +159,11 @@ func (b3 B3) Extract(ctx context.Context, supplier propagation.HTTPSupplier) con } var ( - traceID = supplier.Get(b3TraceIDHeader) - spanID = supplier.Get(b3SpanIDHeader) - parentSpanID = supplier.Get(b3ParentSpanIDHeader) - sampled = supplier.Get(b3SampledHeader) - debugFlag = supplier.Get(b3DebugFlagHeader) + traceID = carrier.Get(b3TraceIDHeader) + spanID = carrier.Get(b3SpanIDHeader) + parentSpanID = carrier.Get(b3ParentSpanIDHeader) + sampled = carrier.Get(b3SampledHeader) + debugFlag = carrier.Get(b3DebugFlagHeader) ) sc, err = extractMultiple(traceID, spanID, parentSpanID, sampled, debugFlag) if err != nil || !sc.IsValid() { @@ -172,7 +172,7 @@ func (b3 B3) Extract(ctx context.Context, supplier propagation.HTTPSupplier) con return trace.ContextWithRemoteSpanContext(ctx, sc) } -func (b3 B3) GetAllKeys() []string { +func (b3 B3) Fields() []string { header := []string{} if b3.InjectEncoding.supports(B3SingleHeader) { header = append(header, b3ContextHeader) diff --git a/propagators/go.mod b/propagators/go.mod index 774630d4def..69aff8419ce 100644 --- a/propagators/go.mod +++ b/propagators/go.mod @@ -7,6 +7,6 @@ replace go.opentelemetry.io/contrib => ./.. require ( github.com/google/go-cmp v0.5.2 github.com/stretchr/testify v1.6.1 - go.opentelemetry.io/contrib v0.12.0 - go.opentelemetry.io/otel v0.12.0 + go.opentelemetry.io/contrib v0.13.0 + go.opentelemetry.io/otel v0.13.0 ) diff --git a/propagators/go.sum b/propagators/go.sum index d09a68edd2e..52c489516c8 100644 --- a/propagators/go.sum +++ b/propagators/go.sum @@ -14,8 +14,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -go.opentelemetry.io/otel v0.12.0 h1:bwWaPd/h2q+U6KdKaAiOS5GLwOMd1LDt9iNaeyIoAI8= -go.opentelemetry.io/otel v0.12.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= +go.opentelemetry.io/otel v0.13.0 h1:2isEnyzjjJZq6r2EKMsFj4TxiQiexsM04AVhwbR/oBA= +go.opentelemetry.io/otel v0.13.0/go.mod h1:dlSNewoRYikTkotEnxdmuBHgzT+k/idJSfDv/FxEnOY= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/propagators/jaeger/jaeger_example_test.go b/propagators/jaeger/jaeger_example_test.go index b67b23721ba..1db824b109f 100644 --- a/propagators/jaeger/jaeger_example_test.go +++ b/propagators/jaeger/jaeger_example_test.go @@ -17,14 +17,10 @@ package jaeger_test import ( "go.opentelemetry.io/contrib/propagators/jaeger" "go.opentelemetry.io/otel/api/global" - "go.opentelemetry.io/otel/api/propagation" ) func ExampleJaeger() { jaeger := jaeger.Jaeger{} // register jaeger propagator - global.SetPropagators(propagation.New( - propagation.WithExtractors(jaeger), - propagation.WithInjectors(jaeger), - )) + global.SetTextMapPropagator(jaeger) } diff --git a/propagators/jaeger/jaeger_integration_test.go b/propagators/jaeger/jaeger_integration_test.go index cb55d15a8cf..212465b0316 100644 --- a/propagators/jaeger/jaeger_integration_test.go +++ b/propagators/jaeger/jaeger_integration_test.go @@ -23,7 +23,6 @@ import ( mocktracer "go.opentelemetry.io/contrib/internal/trace" "go.opentelemetry.io/contrib/propagators/jaeger" - "go.opentelemetry.io/otel/api/propagation" "go.opentelemetry.io/otel/api/trace" ) @@ -49,7 +48,6 @@ func TestExtractJaeger(t *testing.T) { for _, tg := range testGroup { propagator := jaeger.Jaeger{} - props := propagation.New(propagation.WithExtractors(propagator)) for _, tc := range tg.testcases { t.Run(tc.name, func(t *testing.T) { @@ -59,7 +57,7 @@ func TestExtractJaeger(t *testing.T) { } ctx := context.Background() - ctx = propagation.ExtractHTTP(ctx, props, req.Header) + ctx = propagator.Extract(ctx, req.Header) resSc := trace.RemoteSpanContextFromContext(ctx) if diff := cmp.Diff(resSc, tc.expected); diff != "" { t.Errorf("%s: %s: -got +want %s", tg.name, tc.name, diff) diff --git a/propagators/jaeger/jaeger_propagator.go b/propagators/jaeger/jaeger_propagator.go index 0291526f430..4c9809209b6 100644 --- a/propagators/jaeger/jaeger_propagator.go +++ b/propagators/jaeger/jaeger_propagator.go @@ -21,7 +21,7 @@ import ( "strconv" "strings" - "go.opentelemetry.io/otel/api/propagation" + "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/api/trace" ) @@ -59,11 +59,11 @@ var ( // uber-trace-id: {trace-id}:{span-id}:{parent-span-id}:{flags} type Jaeger struct{} -var _ propagation.HTTPPropagator = &Jaeger{} +var _ otel.TextMapPropagator = &Jaeger{} -// Inject injects a context to the supplier following jaeger format. +// Inject injects a context to the carrier following jaeger format. // The parent span ID is set to an dummy parent span id as the most implementations do. -func (jaeger Jaeger) Inject(ctx context.Context, supplier propagation.HTTPSupplier) { +func (jaeger Jaeger) Inject(ctx context.Context, carrier otel.TextMapCarrier) { sc := trace.SpanFromContext(ctx).SpanContext() headers := []string{} if !sc.TraceID.IsValid() || !sc.SpanID.IsValid() { @@ -78,13 +78,13 @@ func (jaeger Jaeger) Inject(ctx context.Context, supplier propagation.HTTPSuppli headers = append(headers, fmt.Sprintf("%x", flagsNotSampled)) } - supplier.Set(jaegerHeader, strings.Join(headers, separator)) + carrier.Set(jaegerHeader, strings.Join(headers, separator)) } -// Extract extracts a context from the supplier if it contains Jaeger headers. -func (jaeger Jaeger) Extract(ctx context.Context, supplier propagation.HTTPSupplier) context.Context { +// Extract extracts a context from the carrier if it contains Jaeger headers. +func (jaeger Jaeger) Extract(ctx context.Context, carrier otel.TextMapCarrier) context.Context { // extract tracing information - if h := supplier.Get(jaegerHeader); h != "" { + if h := carrier.Get(jaegerHeader); h != "" { sc, err := extract(h) if err == nil && sc.IsValid() { return trace.ContextWithRemoteSpanContext(ctx, sc) @@ -155,6 +155,6 @@ func extract(headerVal string) (trace.SpanContext, error) { return sc, nil } -func (jaeger Jaeger) GetAllKeys() []string { +func (jaeger Jaeger) Fields() []string { return []string{jaegerHeader} }