summaryrefslogtreecommitdiff
path: root/vendor/go.opencensus.io
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-07-01 19:53:51 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-07-02 17:36:30 +0200
commit924cd37a37f1c58911ce7bc10b82ec9579c5c70e (patch)
tree915c05707555d02ca272036b5bbd55b7d3b41a9a /vendor/go.opencensus.io
parent04209873562dff25c5d6f800e4a535dff18d485a (diff)
downloadpodman-924cd37a37f1c58911ce7bc10b82ec9579c5c70e.tar.gz
podman-924cd37a37f1c58911ce7bc10b82ec9579c5c70e.tar.bz2
podman-924cd37a37f1c58911ce7bc10b82ec9579c5c70e.zip
Bump github.com/spf13/cobra to v1.2.1
Fixes #9730 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'vendor/go.opencensus.io')
-rw-r--r--vendor/go.opencensus.io/.travis.yml17
-rw-r--r--vendor/go.opencensus.io/Makefile27
-rw-r--r--vendor/go.opencensus.io/go.mod15
-rw-r--r--vendor/go.opencensus.io/go.sum82
-rw-r--r--vendor/go.opencensus.io/trace/basetypes.go10
-rw-r--r--vendor/go.opencensus.io/trace/lrumap.go2
-rw-r--r--vendor/go.opencensus.io/trace/spanstore.go14
-rw-r--r--vendor/go.opencensus.io/trace/trace.go187
-rw-r--r--vendor/go.opencensus.io/trace/trace_api.go265
9 files changed, 458 insertions, 161 deletions
diff --git a/vendor/go.opencensus.io/.travis.yml b/vendor/go.opencensus.io/.travis.yml
deleted file mode 100644
index bd6b66ee8..000000000
--- a/vendor/go.opencensus.io/.travis.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-language: go
-
-go_import_path: go.opencensus.io
-
-go:
- - 1.11.x
-
-env:
- global:
- GO111MODULE=on
-
-before_script:
- - make install-tools
-
-script:
- - make travis-ci
- - go run internal/check/version.go # TODO move this to makefile
diff --git a/vendor/go.opencensus.io/Makefile b/vendor/go.opencensus.io/Makefile
index 457866cb1..b3ce3df30 100644
--- a/vendor/go.opencensus.io/Makefile
+++ b/vendor/go.opencensus.io/Makefile
@@ -8,7 +8,7 @@ ALL_PKGS := $(shell go list $(sort $(dir $(ALL_SRC))))
GOTEST_OPT?=-v -race -timeout 30s
GOTEST_OPT_WITH_COVERAGE = $(GOTEST_OPT) -coverprofile=coverage.txt -covermode=atomic
GOTEST=go test
-GOFMT=gofmt
+GOIMPORTS=goimports
GOLINT=golint
GOVET=go vet
EMBEDMD=embedmd
@@ -17,14 +17,14 @@ TRACE_ID_LINT_EXCEPTION="type name will be used as trace.TraceID by other packag
TRACE_OPTION_LINT_EXCEPTION="type name will be used as trace.TraceOptions by other packages"
README_FILES := $(shell find . -name '*README.md' | sort | tr '\n' ' ')
-.DEFAULT_GOAL := fmt-lint-vet-embedmd-test
+.DEFAULT_GOAL := imports-lint-vet-embedmd-test
-.PHONY: fmt-lint-vet-embedmd-test
-fmt-lint-vet-embedmd-test: fmt lint vet embedmd test
+.PHONY: imports-lint-vet-embedmd-test
+imports-lint-vet-embedmd-test: imports lint vet embedmd test
# TODO enable test-with-coverage in tavis
.PHONY: travis-ci
-travis-ci: fmt lint vet embedmd test test-386
+travis-ci: imports lint vet embedmd test test-386
all-pkgs:
@echo $(ALL_PKGS) | tr ' ' '\n' | sort
@@ -44,15 +44,15 @@ test-386:
test-with-coverage:
$(GOTEST) $(GOTEST_OPT_WITH_COVERAGE) $(ALL_PKGS)
-.PHONY: fmt
-fmt:
- @FMTOUT=`$(GOFMT) -s -l $(ALL_SRC) 2>&1`; \
- if [ "$$FMTOUT" ]; then \
- echo "$(GOFMT) FAILED => gofmt the following files:\n"; \
- echo "$$FMTOUT\n"; \
+.PHONY: imports
+imports:
+ @IMPORTSOUT=`$(GOIMPORTS) -l $(ALL_SRC) 2>&1`; \
+ if [ "$$IMPORTSOUT" ]; then \
+ echo "$(GOIMPORTS) FAILED => goimports the following files:\n"; \
+ echo "$$IMPORTSOUT\n"; \
exit 1; \
else \
- echo "Fmt finished successfully"; \
+ echo "Imports finished successfully"; \
fi
.PHONY: lint
@@ -91,6 +91,7 @@ embedmd:
.PHONY: install-tools
install-tools:
- go get -u golang.org/x/tools/cmd/cover
go get -u golang.org/x/lint/golint
+ go get -u golang.org/x/tools/cmd/cover
+ go get -u golang.org/x/tools/cmd/goimports
go get -u github.com/rakyll/embedmd
diff --git a/vendor/go.opencensus.io/go.mod b/vendor/go.opencensus.io/go.mod
index c867df5f5..95b2522a7 100644
--- a/vendor/go.opencensus.io/go.mod
+++ b/vendor/go.opencensus.io/go.mod
@@ -1,15 +1,12 @@
module go.opencensus.io
require (
- github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6
- github.com/golang/protobuf v1.3.1
- github.com/google/go-cmp v0.3.0
- github.com/stretchr/testify v1.4.0
- golang.org/x/net v0.0.0-20190620200207-3b0461eec859
- golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd // indirect
- golang.org/x/text v0.3.2 // indirect
- google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb // indirect
- google.golang.org/grpc v1.20.1
+ github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
+ github.com/golang/protobuf v1.4.3
+ github.com/google/go-cmp v0.5.3
+ github.com/stretchr/testify v1.6.1
+ golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
+ google.golang.org/grpc v1.33.2
)
go 1.13
diff --git a/vendor/go.opencensus.io/go.sum b/vendor/go.opencensus.io/go.sum
index 01c02972c..c97cd1b55 100644
--- a/vendor/go.opencensus.io/go.sum
+++ b/vendor/go.opencensus.io/go.sum
@@ -1,25 +1,47 @@
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/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.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/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
-github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 h1:ZgQEtGgCBiWRM39fZuwSd1LwSqqSW0hOdXCYYDX0R3I=
-github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY=
+github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
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.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
-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.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=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
+github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
+github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/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.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.3 h1:x95R7cp+rSeeqAMI2knLtQ0DKlaBhv2NrtrOvafPHRo=
+github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
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 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
-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=
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=
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=
@@ -30,24 +52,25 @@ golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
-golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI=
-golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME=
+golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI=
-golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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 h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd h1:r7DufRZuZbWB7j439YfAzP8RPDa9unLkpwQKUYbIMPI=
-golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
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/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
-golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
+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-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
@@ -55,20 +78,39 @@ golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
golang.org/x/tools v0.0.0-20190311212946-11955173bddd h1:/e+gpKk9r3dJobndpTytxS2gOy6m5uvpg+ISQoEcusQ=
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 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
-google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb h1:i1Ppqkc3WQXikh8bXiwHqAN5Rv3/qDCcRk0/Otx73BY=
-google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
-google.golang.org/grpc v1.20.1 h1:Hz2g2wirWK7H0qIIhGIqRGTuMwTE8HEKFnDZZ7lm9NU=
-google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
+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.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o=
+google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
+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=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=
+google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
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.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
-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/vendor/go.opencensus.io/trace/basetypes.go b/vendor/go.opencensus.io/trace/basetypes.go
index 0c54492a2..c8e26ed63 100644
--- a/vendor/go.opencensus.io/trace/basetypes.go
+++ b/vendor/go.opencensus.io/trace/basetypes.go
@@ -49,6 +49,16 @@ type Attribute struct {
value interface{}
}
+// Key returns the attribute's key
+func (a *Attribute) Key() string {
+ return a.key
+}
+
+// Value returns the attribute's value
+func (a *Attribute) Value() interface{} {
+ return a.value
+}
+
// BoolAttribute returns a bool-valued attribute.
func BoolAttribute(key string, value bool) Attribute {
return Attribute{key: key, value: value}
diff --git a/vendor/go.opencensus.io/trace/lrumap.go b/vendor/go.opencensus.io/trace/lrumap.go
index dc7a295c7..908c2497e 100644
--- a/vendor/go.opencensus.io/trace/lrumap.go
+++ b/vendor/go.opencensus.io/trace/lrumap.go
@@ -44,7 +44,7 @@ func (lm lruMap) len() int {
}
func (lm lruMap) keys() []interface{} {
- keys := []interface{}{}
+ keys := make([]interface{}, len(lm.cacheKeys))
for k := range lm.cacheKeys {
keys = append(keys, k)
}
diff --git a/vendor/go.opencensus.io/trace/spanstore.go b/vendor/go.opencensus.io/trace/spanstore.go
index c442d9902..e601f76f2 100644
--- a/vendor/go.opencensus.io/trace/spanstore.go
+++ b/vendor/go.opencensus.io/trace/spanstore.go
@@ -48,8 +48,10 @@ func (i internalOnly) ReportActiveSpans(name string) []*SpanData {
var out []*SpanData
s.mu.Lock()
defer s.mu.Unlock()
- for span := range s.active {
- out = append(out, span.makeSpanData())
+ for activeSpan := range s.active {
+ if s, ok := activeSpan.(*span); ok {
+ out = append(out, s.makeSpanData())
+ }
}
return out
}
@@ -185,7 +187,7 @@ func (i internalOnly) ReportSpansByLatency(name string, minLatency, maxLatency t
// bucketed by latency.
type spanStore struct {
mu sync.Mutex // protects everything below.
- active map[*Span]struct{}
+ active map[SpanInterface]struct{}
errors map[int32]*bucket
latency []bucket
maxSpansPerErrorBucket int
@@ -194,7 +196,7 @@ type spanStore struct {
// newSpanStore creates a span store.
func newSpanStore(name string, latencyBucketSize int, errorBucketSize int) *spanStore {
s := &spanStore{
- active: make(map[*Span]struct{}),
+ active: make(map[SpanInterface]struct{}),
latency: make([]bucket, len(defaultLatencies)+1),
maxSpansPerErrorBucket: errorBucketSize,
}
@@ -271,7 +273,7 @@ func (s *spanStore) resize(latencyBucketSize int, errorBucketSize int) {
}
// add adds a span to the active bucket of the spanStore.
-func (s *spanStore) add(span *Span) {
+func (s *spanStore) add(span SpanInterface) {
s.mu.Lock()
s.active[span] = struct{}{}
s.mu.Unlock()
@@ -279,7 +281,7 @@ func (s *spanStore) add(span *Span) {
// finished removes a span from the active set, and adds a corresponding
// SpanData to a latency or error bucket.
-func (s *spanStore) finished(span *Span, sd *SpanData) {
+func (s *spanStore) finished(span SpanInterface, sd *SpanData) {
latency := sd.EndTime.Sub(sd.StartTime)
if latency < 0 {
latency = 0
diff --git a/vendor/go.opencensus.io/trace/trace.go b/vendor/go.opencensus.io/trace/trace.go
index 3f8977b41..861df9d39 100644
--- a/vendor/go.opencensus.io/trace/trace.go
+++ b/vendor/go.opencensus.io/trace/trace.go
@@ -28,12 +28,16 @@ import (
"go.opencensus.io/trace/tracestate"
)
+type tracer struct{}
+
+var _ Tracer = &tracer{}
+
// Span represents a span of a trace. It has an associated SpanContext, and
// stores data accumulated while the span is active.
//
// Ideally users should interact with Spans by calling the functions in this
// package that take a Context parameter.
-type Span struct {
+type span struct {
// data contains information recorded about the span.
//
// It will be non-nil if we are exporting the span or recording events for it.
@@ -66,7 +70,7 @@ type Span struct {
// IsRecordingEvents returns true if events are being recorded for this span.
// Use this check to avoid computing expensive annotations when they will never
// be used.
-func (s *Span) IsRecordingEvents() bool {
+func (s *span) IsRecordingEvents() bool {
if s == nil {
return false
}
@@ -109,13 +113,13 @@ type SpanContext struct {
type contextKey struct{}
// FromContext returns the Span stored in a context, or nil if there isn't one.
-func FromContext(ctx context.Context) *Span {
+func (t *tracer) FromContext(ctx context.Context) *Span {
s, _ := ctx.Value(contextKey{}).(*Span)
return s
}
// NewContext returns a new context with the given Span attached.
-func NewContext(parent context.Context, s *Span) context.Context {
+func (t *tracer) NewContext(parent context.Context, s *Span) context.Context {
return context.WithValue(parent, contextKey{}, s)
}
@@ -166,12 +170,14 @@ func WithSampler(sampler Sampler) StartOption {
//
// Returned context contains the newly created span. You can use it to
// propagate the returned span in process.
-func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Context, *Span) {
+func (t *tracer) StartSpan(ctx context.Context, name string, o ...StartOption) (context.Context, *Span) {
var opts StartOptions
var parent SpanContext
- if p := FromContext(ctx); p != nil {
- p.addChild()
- parent = p.spanContext
+ if p := t.FromContext(ctx); p != nil {
+ if ps, ok := p.internal.(*span); ok {
+ ps.addChild()
+ }
+ parent = p.SpanContext()
}
for _, op := range o {
op(&opts)
@@ -180,7 +186,8 @@ func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Cont
ctx, end := startExecutionTracerTask(ctx, name)
span.executionTracerTaskEnd = end
- return NewContext(ctx, span), span
+ extSpan := NewSpan(span)
+ return t.NewContext(ctx, extSpan), extSpan
}
// StartSpanWithRemoteParent starts a new child span of the span from the given parent.
@@ -190,7 +197,7 @@ func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Cont
//
// Returned context contains the newly created span. You can use it to
// propagate the returned span in process.
-func StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanContext, o ...StartOption) (context.Context, *Span) {
+func (t *tracer) StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanContext, o ...StartOption) (context.Context, *Span) {
var opts StartOptions
for _, op := range o {
op(&opts)
@@ -198,19 +205,24 @@ func StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanCont
span := startSpanInternal(name, parent != SpanContext{}, parent, true, opts)
ctx, end := startExecutionTracerTask(ctx, name)
span.executionTracerTaskEnd = end
- return NewContext(ctx, span), span
+ extSpan := NewSpan(span)
+ return t.NewContext(ctx, extSpan), extSpan
}
-func startSpanInternal(name string, hasParent bool, parent SpanContext, remoteParent bool, o StartOptions) *Span {
- span := &Span{}
- span.spanContext = parent
+func startSpanInternal(name string, hasParent bool, parent SpanContext, remoteParent bool, o StartOptions) *span {
+ s := &span{}
+ s.spanContext = parent
cfg := config.Load().(*Config)
+ if gen, ok := cfg.IDGenerator.(*defaultIDGenerator); ok {
+ // lazy initialization
+ gen.init()
+ }
if !hasParent {
- span.spanContext.TraceID = cfg.IDGenerator.NewTraceID()
+ s.spanContext.TraceID = cfg.IDGenerator.NewTraceID()
}
- span.spanContext.SpanID = cfg.IDGenerator.NewSpanID()
+ s.spanContext.SpanID = cfg.IDGenerator.NewSpanID()
sampler := cfg.DefaultSampler
if !hasParent || remoteParent || o.Sampler != nil {
@@ -222,47 +234,47 @@ func startSpanInternal(name string, hasParent bool, parent SpanContext, remotePa
if o.Sampler != nil {
sampler = o.Sampler
}
- span.spanContext.setIsSampled(sampler(SamplingParameters{
+ s.spanContext.setIsSampled(sampler(SamplingParameters{
ParentContext: parent,
- TraceID: span.spanContext.TraceID,
- SpanID: span.spanContext.SpanID,
+ TraceID: s.spanContext.TraceID,
+ SpanID: s.spanContext.SpanID,
Name: name,
HasRemoteParent: remoteParent}).Sample)
}
- if !internal.LocalSpanStoreEnabled && !span.spanContext.IsSampled() {
- return span
+ if !internal.LocalSpanStoreEnabled && !s.spanContext.IsSampled() {
+ return s
}
- span.data = &SpanData{
- SpanContext: span.spanContext,
+ s.data = &SpanData{
+ SpanContext: s.spanContext,
StartTime: time.Now(),
SpanKind: o.SpanKind,
Name: name,
HasRemoteParent: remoteParent,
}
- span.lruAttributes = newLruMap(cfg.MaxAttributesPerSpan)
- span.annotations = newEvictedQueue(cfg.MaxAnnotationEventsPerSpan)
- span.messageEvents = newEvictedQueue(cfg.MaxMessageEventsPerSpan)
- span.links = newEvictedQueue(cfg.MaxLinksPerSpan)
+ s.lruAttributes = newLruMap(cfg.MaxAttributesPerSpan)
+ s.annotations = newEvictedQueue(cfg.MaxAnnotationEventsPerSpan)
+ s.messageEvents = newEvictedQueue(cfg.MaxMessageEventsPerSpan)
+ s.links = newEvictedQueue(cfg.MaxLinksPerSpan)
if hasParent {
- span.data.ParentSpanID = parent.SpanID
+ s.data.ParentSpanID = parent.SpanID
}
if internal.LocalSpanStoreEnabled {
var ss *spanStore
ss = spanStoreForNameCreateIfNew(name)
if ss != nil {
- span.spanStore = ss
- ss.add(span)
+ s.spanStore = ss
+ ss.add(s)
}
}
- return span
+ return s
}
// End ends the span.
-func (s *Span) End() {
+func (s *span) End() {
if s == nil {
return
}
@@ -292,7 +304,7 @@ func (s *Span) End() {
// makeSpanData produces a SpanData representing the current state of the Span.
// It requires that s.data is non-nil.
-func (s *Span) makeSpanData() *SpanData {
+func (s *span) makeSpanData() *SpanData {
var sd SpanData
s.mu.Lock()
sd = *s.data
@@ -317,7 +329,7 @@ func (s *Span) makeSpanData() *SpanData {
}
// SpanContext returns the SpanContext of the span.
-func (s *Span) SpanContext() SpanContext {
+func (s *span) SpanContext() SpanContext {
if s == nil {
return SpanContext{}
}
@@ -325,7 +337,7 @@ func (s *Span) SpanContext() SpanContext {
}
// SetName sets the name of the span, if it is recording events.
-func (s *Span) SetName(name string) {
+func (s *span) SetName(name string) {
if !s.IsRecordingEvents() {
return
}
@@ -335,7 +347,7 @@ func (s *Span) SetName(name string) {
}
// SetStatus sets the status of the span, if it is recording events.
-func (s *Span) SetStatus(status Status) {
+func (s *span) SetStatus(status Status) {
if !s.IsRecordingEvents() {
return
}
@@ -344,32 +356,32 @@ func (s *Span) SetStatus(status Status) {
s.mu.Unlock()
}
-func (s *Span) interfaceArrayToLinksArray() []Link {
- linksArr := make([]Link, 0)
+func (s *span) interfaceArrayToLinksArray() []Link {
+ linksArr := make([]Link, 0, len(s.links.queue))
for _, value := range s.links.queue {
linksArr = append(linksArr, value.(Link))
}
return linksArr
}
-func (s *Span) interfaceArrayToMessageEventArray() []MessageEvent {
- messageEventArr := make([]MessageEvent, 0)
+func (s *span) interfaceArrayToMessageEventArray() []MessageEvent {
+ messageEventArr := make([]MessageEvent, 0, len(s.messageEvents.queue))
for _, value := range s.messageEvents.queue {
messageEventArr = append(messageEventArr, value.(MessageEvent))
}
return messageEventArr
}
-func (s *Span) interfaceArrayToAnnotationArray() []Annotation {
- annotationArr := make([]Annotation, 0)
+func (s *span) interfaceArrayToAnnotationArray() []Annotation {
+ annotationArr := make([]Annotation, 0, len(s.annotations.queue))
for _, value := range s.annotations.queue {
annotationArr = append(annotationArr, value.(Annotation))
}
return annotationArr
}
-func (s *Span) lruAttributesToAttributeMap() map[string]interface{} {
- attributes := make(map[string]interface{})
+func (s *span) lruAttributesToAttributeMap() map[string]interface{} {
+ attributes := make(map[string]interface{}, s.lruAttributes.len())
for _, key := range s.lruAttributes.keys() {
value, ok := s.lruAttributes.get(key)
if ok {
@@ -380,13 +392,13 @@ func (s *Span) lruAttributesToAttributeMap() map[string]interface{} {
return attributes
}
-func (s *Span) copyToCappedAttributes(attributes []Attribute) {
+func (s *span) copyToCappedAttributes(attributes []Attribute) {
for _, a := range attributes {
s.lruAttributes.add(a.key, a.value)
}
}
-func (s *Span) addChild() {
+func (s *span) addChild() {
if !s.IsRecordingEvents() {
return
}
@@ -398,7 +410,7 @@ func (s *Span) addChild() {
// AddAttributes sets attributes in the span.
//
// Existing attributes whose keys appear in the attributes parameter are overwritten.
-func (s *Span) AddAttributes(attributes ...Attribute) {
+func (s *span) AddAttributes(attributes ...Attribute) {
if !s.IsRecordingEvents() {
return
}
@@ -407,49 +419,27 @@ func (s *Span) AddAttributes(attributes ...Attribute) {
s.mu.Unlock()
}
-// copyAttributes copies a slice of Attributes into a map.
-func copyAttributes(m map[string]interface{}, attributes []Attribute) {
- for _, a := range attributes {
- m[a.key] = a.value
- }
-}
-
-func (s *Span) lazyPrintfInternal(attributes []Attribute, format string, a ...interface{}) {
+func (s *span) printStringInternal(attributes []Attribute, str string) {
now := time.Now()
- msg := fmt.Sprintf(format, a...)
- var m map[string]interface{}
- s.mu.Lock()
+ var am map[string]interface{}
if len(attributes) != 0 {
- m = make(map[string]interface{})
- copyAttributes(m, attributes)
+ am = make(map[string]interface{}, len(attributes))
+ for _, attr := range attributes {
+ am[attr.key] = attr.value
+ }
}
- s.annotations.add(Annotation{
- Time: now,
- Message: msg,
- Attributes: m,
- })
- s.mu.Unlock()
-}
-
-func (s *Span) printStringInternal(attributes []Attribute, str string) {
- now := time.Now()
- var a map[string]interface{}
s.mu.Lock()
- if len(attributes) != 0 {
- a = make(map[string]interface{})
- copyAttributes(a, attributes)
- }
s.annotations.add(Annotation{
Time: now,
Message: str,
- Attributes: a,
+ Attributes: am,
})
s.mu.Unlock()
}
// Annotate adds an annotation with attributes.
// Attributes can be nil.
-func (s *Span) Annotate(attributes []Attribute, str string) {
+func (s *span) Annotate(attributes []Attribute, str string) {
if !s.IsRecordingEvents() {
return
}
@@ -457,11 +447,11 @@ func (s *Span) Annotate(attributes []Attribute, str string) {
}
// Annotatef adds an annotation with attributes.
-func (s *Span) Annotatef(attributes []Attribute, format string, a ...interface{}) {
+func (s *span) Annotatef(attributes []Attribute, format string, a ...interface{}) {
if !s.IsRecordingEvents() {
return
}
- s.lazyPrintfInternal(attributes, format, a...)
+ s.printStringInternal(attributes, fmt.Sprintf(format, a...))
}
// AddMessageSendEvent adds a message send event to the span.
@@ -470,7 +460,7 @@ func (s *Span) Annotatef(attributes []Attribute, format string, a ...interface{}
// unique in this span and the same between the send event and the receive
// event (this allows to identify a message between the sender and receiver).
// For example, this could be a sequence id.
-func (s *Span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64) {
+func (s *span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64) {
if !s.IsRecordingEvents() {
return
}
@@ -492,7 +482,7 @@ func (s *Span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedBy
// unique in this span and the same between the send event and the receive
// event (this allows to identify a message between the sender and receiver).
// For example, this could be a sequence id.
-func (s *Span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64) {
+func (s *span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64) {
if !s.IsRecordingEvents() {
return
}
@@ -509,7 +499,7 @@ func (s *Span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compresse
}
// AddLink adds a link to the span.
-func (s *Span) AddLink(l Link) {
+func (s *span) AddLink(l Link) {
if !s.IsRecordingEvents() {
return
}
@@ -518,7 +508,7 @@ func (s *Span) AddLink(l Link) {
s.mu.Unlock()
}
-func (s *Span) String() string {
+func (s *span) String() string {
if s == nil {
return "<nil>"
}
@@ -534,20 +524,9 @@ func (s *Span) String() string {
var config atomic.Value // access atomically
func init() {
- gen := &defaultIDGenerator{}
- // initialize traceID and spanID generators.
- var rngSeed int64
- for _, p := range []interface{}{
- &rngSeed, &gen.traceIDAdd, &gen.nextSpanID, &gen.spanIDInc,
- } {
- binary.Read(crand.Reader, binary.LittleEndian, p)
- }
- gen.traceIDRand = rand.New(rand.NewSource(rngSeed))
- gen.spanIDInc |= 1
-
config.Store(&Config{
DefaultSampler: ProbabilitySampler(defaultSamplingProbability),
- IDGenerator: gen,
+ IDGenerator: &defaultIDGenerator{},
MaxAttributesPerSpan: DefaultMaxAttributesPerSpan,
MaxAnnotationEventsPerSpan: DefaultMaxAnnotationEventsPerSpan,
MaxMessageEventsPerSpan: DefaultMaxMessageEventsPerSpan,
@@ -571,6 +550,24 @@ type defaultIDGenerator struct {
traceIDAdd [2]uint64
traceIDRand *rand.Rand
+
+ initOnce sync.Once
+}
+
+// init initializes the generator on the first call to avoid consuming entropy
+// unnecessarily.
+func (gen *defaultIDGenerator) init() {
+ gen.initOnce.Do(func() {
+ // initialize traceID and spanID generators.
+ var rngSeed int64
+ for _, p := range []interface{}{
+ &rngSeed, &gen.traceIDAdd, &gen.nextSpanID, &gen.spanIDInc,
+ } {
+ binary.Read(crand.Reader, binary.LittleEndian, p)
+ }
+ gen.traceIDRand = rand.New(rand.NewSource(rngSeed))
+ gen.spanIDInc |= 1
+ })
}
// NewSpanID returns a non-zero span ID from a randomly-chosen sequence.
diff --git a/vendor/go.opencensus.io/trace/trace_api.go b/vendor/go.opencensus.io/trace/trace_api.go
new file mode 100644
index 000000000..9e2c3a999
--- /dev/null
+++ b/vendor/go.opencensus.io/trace/trace_api.go
@@ -0,0 +1,265 @@
+// Copyright 2020, OpenCensus Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package trace
+
+import (
+ "context"
+)
+
+// DefaultTracer is the tracer used when package-level exported functions are invoked.
+var DefaultTracer Tracer = &tracer{}
+
+// Tracer can start spans and access context functions.
+type Tracer interface {
+
+ // StartSpan starts a new child span of the current span in the context. If
+ // there is no span in the context, creates a new trace and span.
+ //
+ // Returned context contains the newly created span. You can use it to
+ // propagate the returned span in process.
+ StartSpan(ctx context.Context, name string, o ...StartOption) (context.Context, *Span)
+
+ // StartSpanWithRemoteParent starts a new child span of the span from the given parent.
+ //
+ // If the incoming context contains a parent, it ignores. StartSpanWithRemoteParent is
+ // preferred for cases where the parent is propagated via an incoming request.
+ //
+ // Returned context contains the newly created span. You can use it to
+ // propagate the returned span in process.
+ StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanContext, o ...StartOption) (context.Context, *Span)
+
+ // FromContext returns the Span stored in a context, or nil if there isn't one.
+ FromContext(ctx context.Context) *Span
+
+ // NewContext returns a new context with the given Span attached.
+ NewContext(parent context.Context, s *Span) context.Context
+}
+
+// StartSpan starts a new child span of the current span in the context. If
+// there is no span in the context, creates a new trace and span.
+//
+// Returned context contains the newly created span. You can use it to
+// propagate the returned span in process.
+func StartSpan(ctx context.Context, name string, o ...StartOption) (context.Context, *Span) {
+ return DefaultTracer.StartSpan(ctx, name, o...)
+}
+
+// StartSpanWithRemoteParent starts a new child span of the span from the given parent.
+//
+// If the incoming context contains a parent, it ignores. StartSpanWithRemoteParent is
+// preferred for cases where the parent is propagated via an incoming request.
+//
+// Returned context contains the newly created span. You can use it to
+// propagate the returned span in process.
+func StartSpanWithRemoteParent(ctx context.Context, name string, parent SpanContext, o ...StartOption) (context.Context, *Span) {
+ return DefaultTracer.StartSpanWithRemoteParent(ctx, name, parent, o...)
+}
+
+// FromContext returns the Span stored in a context, or a Span that is not
+// recording events if there isn't one.
+func FromContext(ctx context.Context) *Span {
+ return DefaultTracer.FromContext(ctx)
+}
+
+// NewContext returns a new context with the given Span attached.
+func NewContext(parent context.Context, s *Span) context.Context {
+ return DefaultTracer.NewContext(parent, s)
+}
+
+// SpanInterface represents a span of a trace. It has an associated SpanContext, and
+// stores data accumulated while the span is active.
+//
+// Ideally users should interact with Spans by calling the functions in this
+// package that take a Context parameter.
+type SpanInterface interface {
+
+ // IsRecordingEvents returns true if events are being recorded for this span.
+ // Use this check to avoid computing expensive annotations when they will never
+ // be used.
+ IsRecordingEvents() bool
+
+ // End ends the span.
+ End()
+
+ // SpanContext returns the SpanContext of the span.
+ SpanContext() SpanContext
+
+ // SetName sets the name of the span, if it is recording events.
+ SetName(name string)
+
+ // SetStatus sets the status of the span, if it is recording events.
+ SetStatus(status Status)
+
+ // AddAttributes sets attributes in the span.
+ //
+ // Existing attributes whose keys appear in the attributes parameter are overwritten.
+ AddAttributes(attributes ...Attribute)
+
+ // Annotate adds an annotation with attributes.
+ // Attributes can be nil.
+ Annotate(attributes []Attribute, str string)
+
+ // Annotatef adds an annotation with attributes.
+ Annotatef(attributes []Attribute, format string, a ...interface{})
+
+ // AddMessageSendEvent adds a message send event to the span.
+ //
+ // messageID is an identifier for the message, which is recommended to be
+ // unique in this span and the same between the send event and the receive
+ // event (this allows to identify a message between the sender and receiver).
+ // For example, this could be a sequence id.
+ AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64)
+
+ // AddMessageReceiveEvent adds a message receive event to the span.
+ //
+ // messageID is an identifier for the message, which is recommended to be
+ // unique in this span and the same between the send event and the receive
+ // event (this allows to identify a message between the sender and receiver).
+ // For example, this could be a sequence id.
+ AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64)
+
+ // AddLink adds a link to the span.
+ AddLink(l Link)
+
+ // String prints a string representation of a span.
+ String() string
+}
+
+// NewSpan is a convenience function for creating a *Span out of a *span
+func NewSpan(s SpanInterface) *Span {
+ return &Span{internal: s}
+}
+
+// Span is a struct wrapper around the SpanInt interface, which allows correctly handling
+// nil spans, while also allowing the SpanInterface implementation to be swapped out.
+type Span struct {
+ internal SpanInterface
+}
+
+// Internal returns the underlying implementation of the Span
+func (s *Span) Internal() SpanInterface {
+ return s.internal
+}
+
+// IsRecordingEvents returns true if events are being recorded for this span.
+// Use this check to avoid computing expensive annotations when they will never
+// be used.
+func (s *Span) IsRecordingEvents() bool {
+ if s == nil {
+ return false
+ }
+ return s.internal.IsRecordingEvents()
+}
+
+// End ends the span.
+func (s *Span) End() {
+ if s == nil {
+ return
+ }
+ s.internal.End()
+}
+
+// SpanContext returns the SpanContext of the span.
+func (s *Span) SpanContext() SpanContext {
+ if s == nil {
+ return SpanContext{}
+ }
+ return s.internal.SpanContext()
+}
+
+// SetName sets the name of the span, if it is recording events.
+func (s *Span) SetName(name string) {
+ if !s.IsRecordingEvents() {
+ return
+ }
+ s.internal.SetName(name)
+}
+
+// SetStatus sets the status of the span, if it is recording events.
+func (s *Span) SetStatus(status Status) {
+ if !s.IsRecordingEvents() {
+ return
+ }
+ s.internal.SetStatus(status)
+}
+
+// AddAttributes sets attributes in the span.
+//
+// Existing attributes whose keys appear in the attributes parameter are overwritten.
+func (s *Span) AddAttributes(attributes ...Attribute) {
+ if !s.IsRecordingEvents() {
+ return
+ }
+ s.internal.AddAttributes(attributes...)
+}
+
+// Annotate adds an annotation with attributes.
+// Attributes can be nil.
+func (s *Span) Annotate(attributes []Attribute, str string) {
+ if !s.IsRecordingEvents() {
+ return
+ }
+ s.internal.Annotate(attributes, str)
+}
+
+// Annotatef adds an annotation with attributes.
+func (s *Span) Annotatef(attributes []Attribute, format string, a ...interface{}) {
+ if !s.IsRecordingEvents() {
+ return
+ }
+ s.internal.Annotatef(attributes, format, a...)
+}
+
+// AddMessageSendEvent adds a message send event to the span.
+//
+// messageID is an identifier for the message, which is recommended to be
+// unique in this span and the same between the send event and the receive
+// event (this allows to identify a message between the sender and receiver).
+// For example, this could be a sequence id.
+func (s *Span) AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize int64) {
+ if !s.IsRecordingEvents() {
+ return
+ }
+ s.internal.AddMessageSendEvent(messageID, uncompressedByteSize, compressedByteSize)
+}
+
+// AddMessageReceiveEvent adds a message receive event to the span.
+//
+// messageID is an identifier for the message, which is recommended to be
+// unique in this span and the same between the send event and the receive
+// event (this allows to identify a message between the sender and receiver).
+// For example, this could be a sequence id.
+func (s *Span) AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize int64) {
+ if !s.IsRecordingEvents() {
+ return
+ }
+ s.internal.AddMessageReceiveEvent(messageID, uncompressedByteSize, compressedByteSize)
+}
+
+// AddLink adds a link to the span.
+func (s *Span) AddLink(l Link) {
+ if !s.IsRecordingEvents() {
+ return
+ }
+ s.internal.AddLink(l)
+}
+
+// String prints a string representation of a span.
+func (s *Span) String() string {
+ if s == nil {
+ return "<nil>"
+ }
+ return s.internal.String()
+}