Re: Bug#1033442: unblock: golang-go.opencensus/0.24.0-1
On Fri, Mar 24, 2023 at 3:33 PM Anthony Fok <foka@debian.org> wrote:
> [ Checklist ]
> [x] all changes are documented in the d/changelog
> [x] I reviewed all changes and I approve them
> [x] attach debdiff against the package in testing
Sorry, I forgot to actually attach the debdiff file. Attached in this
follow-up message. :-)
Cheers,
Anthony Fok
diff -Nru golang-go.opencensus-0.23.0/debian/changelog golang-go.opencensus-0.24.0/debian/changelog
--- golang-go.opencensus-0.23.0/debian/changelog 2023-01-04 15:26:48.000000000 -0700
+++ golang-go.opencensus-0.24.0/debian/changelog 2023-03-09 02:33:15.000000000 -0700
@@ -1,3 +1,14 @@
+golang-go.opencensus (0.24.0-1) unstable; urgency=medium
+
+ * New upstream version 0.24.0
+ * Reorder fields in debian/control and debian/copyright
+ * Bump versioned dependencies as per go.mod:
+ - golang-github-google-go-cmp-dev (>= 0.5.3)
+ - golang-github-stretchr-testify-dev (>= 1.8.1)
+ - golang-google-grpc-dev (>= 1.33.2)
+
+ -- Anthony Fok <foka@debian.org> Thu, 09 Mar 2023 02:33:15 -0700
+
golang-go.opencensus (0.23.0-4) unstable; urgency=medium
* Team upload
diff -Nru golang-go.opencensus-0.23.0/debian/control golang-go.opencensus-0.24.0/debian/control
--- golang-go.opencensus-0.23.0/debian/control 2023-01-02 09:30:05.000000000 -0700
+++ golang-go.opencensus-0.24.0/debian/control 2023-03-09 02:32:16.000000000 -0700
@@ -1,36 +1,36 @@
Source: golang-go.opencensus
+Section: golang
+Priority: optional
Maintainer: Debian Go Packaging Team <team+pkg-go@tracker.debian.org>
Uploaders: Stephen Gelman <ssgelm@debian.org>,
Anthony Fok <foka@debian.org>
-Section: golang
-Testsuite: autopkgtest-pkg-go
-Priority: optional
+Rules-Requires-Root: no
Build-Depends: debhelper-compat (= 13),
dh-golang,
golang-any,
- golang-github-google-go-cmp-dev (>= 0.3.0),
+ golang-github-google-go-cmp-dev (>= 0.5.3),
golang-github-golang-groupcache-dev,
- golang-github-stretchr-testify-dev (>= 1.4.1),
+ golang-github-stretchr-testify-dev (>= 1.8.1),
golang-golang-x-net-dev,
- golang-google-grpc-dev (>= 1.20.1),
+ golang-google-grpc-dev (>= 1.33.2),
golang-github-golang-protobuf-1-3-dev
+Testsuite: autopkgtest-pkg-go
Standards-Version: 4.6.2
Vcs-Browser: https://salsa.debian.org/go-team/packages/golang-go.opencensus
Vcs-Git: https://salsa.debian.org/go-team/packages/golang-go.opencensus.git
Homepage: https://github.com/census-instrumentation/opencensus-go
-Rules-Requires-Root: no
XS-Go-Import-Path: go.opencensus.io
Package: golang-go.opencensus-dev
Architecture: all
Multi-Arch: foreign
-Depends: ${misc:Depends},
- golang-github-google-go-cmp-dev (>= 0.3.0),
+Depends: golang-github-google-go-cmp-dev (>= 0.5.3),
golang-github-golang-groupcache-dev,
- golang-github-stretchr-testify-dev (>= 1.4.1),
+ golang-github-stretchr-testify-dev (>= 1.8.1),
golang-golang-x-net-dev,
- golang-google-grpc-dev (>= 1.20.1),
- golang-github-golang-protobuf-1-3-dev | golang-github-golang-protobuf-1-5-dev
+ golang-google-grpc-dev (>= 1.33.2),
+ golang-github-golang-protobuf-1-3-dev | golang-github-golang-protobuf-1-5-dev,
+ ${misc:Depends}
Description: Stats collection and distributed tracing framework
OpenCensus Go is a Go implementation of OpenCensus, a toolkit for
collecting application performance and behavior monitoring data.
diff -Nru golang-go.opencensus-0.23.0/debian/copyright golang-go.opencensus-0.24.0/debian/copyright
--- golang-go.opencensus-0.23.0/debian/copyright 2022-12-31 17:30:47.000000000 -0700
+++ golang-go.opencensus-0.24.0/debian/copyright 2023-03-09 02:30:39.000000000 -0700
@@ -1,9 +1,9 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
-Upstream-Name: go.opencensus.io
Source: https://github.com/census-instrumentation/opencensus-go
+Upstream-Name: go.opencensus.io
Files: *
-Copyright: 2017-2019 OpenCensus
+Copyright: 2017-2022 OpenCensus
License: Apache-2.0
Files: debian/*
@@ -23,6 +23,6 @@
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.
- .
+Comment:
On Debian systems, the complete text of the Apache version 2.0 license
can be found in "/usr/share/common-licenses/Apache-2.0".
diff -Nru golang-go.opencensus-0.23.0/examples/derived_gauges/derived_gauge.go golang-go.opencensus-0.24.0/examples/derived_gauges/derived_gauge.go
--- golang-go.opencensus-0.23.0/examples/derived_gauges/derived_gauge.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/examples/derived_gauges/derived_gauge.go 2022-11-03 14:13:50.000000000 -0600
@@ -20,7 +20,7 @@
// items. Consumer randomly consumes 1-5 items in each attempt. It then sleeps randomly
// between 1-10 seconds before the next attempt. Two metrics collected to monitor the queue.
//
-// Metrics
+// # Metrics
//
// * queue_size: It is an instantaneous queue size represented using derived gauge int64.
//
diff -Nru golang-go.opencensus-0.23.0/examples/derived_gauges/README.md golang-go.opencensus-0.24.0/examples/derived_gauges/README.md
--- golang-go.opencensus-0.23.0/examples/derived_gauges/README.md 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/examples/derived_gauges/README.md 2022-11-03 14:13:50.000000000 -0600
@@ -147,7 +147,7 @@
// items. Consumer randomly consumes 1-5 items in each attempt. It then sleeps randomly
// between 1-10 seconds before the next attempt. Two metrics collected to monitor the queue.
//
-// Metrics
+// # Metrics
//
// * queue_size: It is an instantaneous queue size represented using derived gauge int64.
//
diff -Nru golang-go.opencensus-0.23.0/examples/gauges/gauge.go golang-go.opencensus-0.24.0/examples/gauges/gauge.go
--- golang-go.opencensus-0.23.0/examples/gauges/gauge.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/examples/gauges/gauge.go 2022-11-03 14:13:50.000000000 -0600
@@ -17,7 +17,7 @@
// This example shows how to use gauge metrics. The program records two gauges, one to demonstrate
// a gauge with int64 value and the other to demonstrate a gauge with float64 value.
//
-// Metrics
+// # Metrics
//
// 1. process_heap_alloc (int64): Total bytes used by objects allocated in the heap.
// It includes objects currently used and objects that are freed but not garbage collected.
diff -Nru golang-go.opencensus-0.23.0/examples/gauges/README.md golang-go.opencensus-0.24.0/examples/gauges/README.md
--- golang-go.opencensus-0.23.0/examples/gauges/README.md 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/examples/gauges/README.md 2022-11-03 14:13:50.000000000 -0600
@@ -124,7 +124,7 @@
// This example shows how to use gauge metrics. The program records two gauges, one to demonstrate
// a gauge with int64 value and the other to demonstrate a gauge with float64 value.
//
-// Metrics
+// # Metrics
//
// 1. process_heap_alloc (int64): Total bytes used by objects allocated in the heap.
// It includes objects currently used and objects that are freed but not garbage collected.
diff -Nru golang-go.opencensus-0.23.0/examples/grpc/proto/helloworld.pb.go golang-go.opencensus-0.24.0/examples/grpc/proto/helloworld.pb.go
--- golang-go.opencensus-0.23.0/examples/grpc/proto/helloworld.pb.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/examples/grpc/proto/helloworld.pb.go 2022-11-03 14:13:50.000000000 -0600
@@ -5,9 +5,11 @@
Package helloworld is a generated protocol buffer package.
It is generated from these files:
+
helloworld.proto
It has these top-level messages:
+
HelloRequest
HelloReply
*/
diff -Nru golang-go.opencensus-0.23.0/examples/quickstart/stats.go golang-go.opencensus-0.24.0/examples/quickstart/stats.go
--- golang-go.opencensus-0.23.0/examples/quickstart/stats.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/examples/quickstart/stats.go 2022-11-03 14:13:50.000000000 -0600
@@ -13,7 +13,8 @@
// limitations under the License.
// Command stats implements the stats Quick Start example from:
-// https://opencensus.io/quickstart/go/metrics/
+//
+// https://opencensus.io/quickstart/go/metrics/
package main
import (
diff -Nru golang-go.opencensus-0.23.0/.github/CODEOWNERS golang-go.opencensus-0.24.0/.github/CODEOWNERS
--- golang-go.opencensus-0.23.0/.github/CODEOWNERS 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/.github/CODEOWNERS 2022-11-03 14:13:50.000000000 -0600
@@ -2,5 +2,5 @@
# This file controls who is tagged for review for any given pull request.
# For anything not explicitly taken by someone else:
-* @census-instrumentation/global-owners @rakyll @rghetia
+* @census-instrumentation/global-owners @rghetia
diff -Nru golang-go.opencensus-0.23.0/go.mod golang-go.opencensus-0.24.0/go.mod
--- golang-go.opencensus-0.23.0/go.mod 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/go.mod 2022-11-03 14:13:50.000000000 -0600
@@ -4,7 +4,7 @@
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
+ github.com/stretchr/testify v1.8.1
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b
google.golang.org/grpc v1.33.2
)
diff -Nru golang-go.opencensus-0.23.0/go.sum golang-go.opencensus-0.24.0/go.sum
--- golang-go.opencensus-0.23.0/go.sum 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/go.sum 2022-11-03 14:13:50.000000000 -0600
@@ -3,18 +3,17 @@
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/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.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-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.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
@@ -26,7 +25,6 @@
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=
@@ -38,59 +36,50 @@
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=
+github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
+github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
+github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
+github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
+github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
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=
-golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3 h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0=
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 h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
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-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-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-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.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=
-golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
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-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.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
@@ -103,14 +92,14 @@
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.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
+gopkg.in/yaml.v3 v3.0.1/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 -Nru golang-go.opencensus-0.23.0/internal/testpb/test.pb.go golang-go.opencensus-0.24.0/internal/testpb/test.pb.go
--- golang-go.opencensus-0.23.0/internal/testpb/test.pb.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/internal/testpb/test.pb.go 2022-11-03 14:13:50.000000000 -0600
@@ -5,9 +5,11 @@
Package testpb is a generated protocol buffer package.
It is generated from these files:
+
test.proto
It has these top-level messages:
+
FooRequest
FooResponse
*/
diff -Nru golang-go.opencensus-0.23.0/Makefile golang-go.opencensus-0.24.0/Makefile
--- golang-go.opencensus-0.23.0/Makefile 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/Makefile 2022-11-03 14:13:50.000000000 -0600
@@ -91,7 +91,7 @@
.PHONY: install-tools
install-tools:
- 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
+ go install golang.org/x/lint/golint@latest
+ go install golang.org/x/tools/cmd/cover@latest
+ go install golang.org/x/tools/cmd/goimports@latest
+ go install github.com/rakyll/embedmd@latest
diff -Nru golang-go.opencensus-0.23.0/metric/test/exporter.go golang-go.opencensus-0.24.0/metric/test/exporter.go
--- golang-go.opencensus-0.23.0/metric/test/exporter.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/metric/test/exporter.go 2022-11-03 14:13:50.000000000 -0600
@@ -56,7 +56,7 @@
e.metricReader.ReadAndExport(e)
}
-// String defines the ``native'' format for the exporter.
+// String defines the “native” format for the exporter.
func (e *Exporter) String() string {
return fmt.Sprintf("points{%v}", e.points)
}
diff -Nru golang-go.opencensus-0.23.0/opencensus.go golang-go.opencensus-0.24.0/opencensus.go
--- golang-go.opencensus-0.23.0/opencensus.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/opencensus.go 2022-11-03 14:13:50.000000000 -0600
@@ -17,5 +17,5 @@
// Version is the current release version of OpenCensus in use.
func Version() string {
- return "0.23.0"
+ return "0.24.0"
}
diff -Nru golang-go.opencensus-0.23.0/plugin/ocgrpc/client_metrics.go golang-go.opencensus-0.24.0/plugin/ocgrpc/client_metrics.go
--- golang-go.opencensus-0.23.0/plugin/ocgrpc/client_metrics.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/plugin/ocgrpc/client_metrics.go 2022-11-03 14:13:50.000000000 -0600
@@ -28,6 +28,7 @@
ClientReceivedMessagesPerRPC = stats.Int64("grpc.io/client/received_messages_per_rpc", "Number of response messages received per RPC (always 1 for non-streaming RPCs).", stats.UnitDimensionless)
ClientReceivedBytesPerRPC = stats.Int64("grpc.io/client/received_bytes_per_rpc", "Total bytes received across all response messages per RPC.", stats.UnitBytes)
ClientRoundtripLatency = stats.Float64("grpc.io/client/roundtrip_latency", "Time between first byte of request sent to last byte of response received, or terminal error.", stats.UnitMilliseconds)
+ ClientStartedRPCs = stats.Int64("grpc.io/client/started_rpcs", "Number of started client RPCs.", stats.UnitDimensionless)
ClientServerLatency = stats.Float64("grpc.io/client/server_latency", `Propagated from the server and should have the same value as "grpc.io/server/latency".`, stats.UnitMilliseconds)
)
@@ -70,6 +71,14 @@
Aggregation: view.Count(),
}
+ ClientStartedRPCsView = &view.View{
+ Measure: ClientStartedRPCs,
+ Name: "grpc.io/client/started_rpcs",
+ Description: "Number of started client RPCs.",
+ TagKeys: []tag.Key{KeyClientMethod},
+ Aggregation: view.Count(),
+ }
+
ClientSentMessagesPerRPCView = &view.View{
Measure: ClientSentMessagesPerRPC,
Name: "grpc.io/client/sent_messages_per_rpc",
diff -Nru golang-go.opencensus-0.23.0/plugin/ocgrpc/end_to_end_test.go golang-go.opencensus-0.24.0/plugin/ocgrpc/end_to_end_test.go
--- golang-go.opencensus-0.23.0/plugin/ocgrpc/end_to_end_test.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/plugin/ocgrpc/end_to_end_test.go 2022-11-03 14:13:50.000000000 -0600
@@ -40,6 +40,8 @@
ocgrpc.ClientReceivedMessagesPerRPCView,
ocgrpc.ServerSentMessagesPerRPCView,
ocgrpc.ClientSentMessagesPerRPCView,
+ ocgrpc.ServerStartedRPCsView,
+ ocgrpc.ClientStartedRPCsView,
}
view.Register(extraViews...)
defer view.Unregister(extraViews...)
@@ -63,10 +65,14 @@
if err != nil {
t.Fatal(err)
}
+ checkCount(t, ocgrpc.ClientStartedRPCsView, 1, clientMethodTag)
+ checkCount(t, ocgrpc.ServerStartedRPCsView, 1, serverMethodTag)
checkCount(t, ocgrpc.ClientCompletedRPCsView, 1, clientMethodTag, clientStatusOKTag)
checkCount(t, ocgrpc.ServerCompletedRPCsView, 1, serverMethodTag, serverStatusOKTag)
_, _ = client.Single(ctx, &testpb.FooRequest{Fail: true})
+ checkCount(t, ocgrpc.ClientStartedRPCsView, 2, clientMethodTag)
+ checkCount(t, ocgrpc.ServerStartedRPCsView, 2, serverMethodTag)
checkCount(t, ocgrpc.ClientCompletedRPCsView, 1, clientMethodTag, serverStatusUnknownTag)
checkCount(t, ocgrpc.ServerCompletedRPCsView, 1, serverMethodTag, clientStatusUnknownTag)
@@ -101,6 +107,7 @@
func TestEndToEnd_Stream(t *testing.T) {
view.Register(ocgrpc.DefaultClientViews...)
defer view.Unregister(ocgrpc.DefaultClientViews...)
+
view.Register(ocgrpc.DefaultServerViews...)
defer view.Unregister(ocgrpc.DefaultServerViews...)
@@ -109,6 +116,8 @@
ocgrpc.ClientReceivedMessagesPerRPCView,
ocgrpc.ServerSentMessagesPerRPCView,
ocgrpc.ClientSentMessagesPerRPCView,
+ ocgrpc.ClientStartedRPCsView,
+ ocgrpc.ServerStartedRPCsView,
}
view.Register(extraViews...)
defer view.Unregister(extraViews...)
@@ -146,6 +155,8 @@
t.Fatal(err)
}
+ checkCount(t, ocgrpc.ClientStartedRPCsView, 1, clientMethodTag)
+ checkCount(t, ocgrpc.ServerStartedRPCsView, 1, serverMethodTag)
checkCount(t, ocgrpc.ClientCompletedRPCsView, 1, clientMethodTag, clientStatusOKTag)
checkCount(t, ocgrpc.ServerCompletedRPCsView, 1, serverMethodTag, serverStatusOKTag)
@@ -183,6 +194,7 @@
return 0, false
}
}
+
rows, err := view.RetrieveData(v.Name)
if err != nil {
t.Fatal(err)
diff -Nru golang-go.opencensus-0.23.0/plugin/ocgrpc/server_metrics.go golang-go.opencensus-0.24.0/plugin/ocgrpc/server_metrics.go
--- golang-go.opencensus-0.23.0/plugin/ocgrpc/server_metrics.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/plugin/ocgrpc/server_metrics.go 2022-11-03 14:13:50.000000000 -0600
@@ -27,6 +27,7 @@
ServerReceivedBytesPerRPC = stats.Int64("grpc.io/server/received_bytes_per_rpc", "Total bytes received across all messages per RPC.", stats.UnitBytes)
ServerSentMessagesPerRPC = stats.Int64("grpc.io/server/sent_messages_per_rpc", "Number of messages sent in each RPC. Has value 1 for non-streaming RPCs.", stats.UnitDimensionless)
ServerSentBytesPerRPC = stats.Int64("grpc.io/server/sent_bytes_per_rpc", "Total bytes sent in across all response messages per RPC.", stats.UnitBytes)
+ ServerStartedRPCs = stats.Int64("grpc.io/server/started_rpcs", "Number of started server RPCs.", stats.UnitDimensionless)
ServerLatency = stats.Float64("grpc.io/server/server_latency", "Time between first byte of request received to last byte of response sent, or terminal error.", stats.UnitMilliseconds)
)
@@ -73,6 +74,14 @@
Aggregation: view.Count(),
}
+ ServerStartedRPCsView = &view.View{
+ Measure: ServerStartedRPCs,
+ Name: "grpc.io/server/started_rpcs",
+ Description: "Number of started server RPCs.",
+ TagKeys: []tag.Key{KeyServerMethod},
+ Aggregation: view.Count(),
+ }
+
ServerReceivedMessagesPerRPCView = &view.View{
Name: "grpc.io/server/received_messages_per_rpc",
Description: "Distribution of messages received count per RPC, by method.",
diff -Nru golang-go.opencensus-0.23.0/plugin/ocgrpc/stats_common.go golang-go.opencensus-0.24.0/plugin/ocgrpc/stats_common.go
--- golang-go.opencensus-0.23.0/plugin/ocgrpc/stats_common.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/plugin/ocgrpc/stats_common.go 2022-11-03 14:13:50.000000000 -0600
@@ -82,8 +82,10 @@
// statsHandleRPC processes the RPC events.
func statsHandleRPC(ctx context.Context, s stats.RPCStats) {
switch st := s.(type) {
- case *stats.Begin, *stats.OutHeader, *stats.InHeader, *stats.InTrailer, *stats.OutTrailer:
+ case *stats.OutHeader, *stats.InHeader, *stats.InTrailer, *stats.OutTrailer:
// do nothing for client
+ case *stats.Begin:
+ handleRPCBegin(ctx, st)
case *stats.OutPayload:
handleRPCOutPayload(ctx, st)
case *stats.InPayload:
@@ -95,6 +97,25 @@
}
}
+func handleRPCBegin(ctx context.Context, s *stats.Begin) {
+ d, ok := ctx.Value(rpcDataKey).(*rpcData)
+ if !ok {
+ if grpclog.V(2) {
+ grpclog.Infoln("Failed to retrieve *rpcData from context.")
+ }
+ }
+
+ if s.IsClient() {
+ ocstats.RecordWithOptions(ctx,
+ ocstats.WithTags(tag.Upsert(KeyClientMethod, methodName(d.method))),
+ ocstats.WithMeasurements(ClientStartedRPCs.M(1)))
+ } else {
+ ocstats.RecordWithOptions(ctx,
+ ocstats.WithTags(tag.Upsert(KeyClientMethod, methodName(d.method))),
+ ocstats.WithMeasurements(ServerStartedRPCs.M(1)))
+ }
+}
+
func handleRPCOutPayload(ctx context.Context, s *stats.OutPayload) {
d, ok := ctx.Value(rpcDataKey).(*rpcData)
if !ok {
diff -Nru golang-go.opencensus-0.23.0/plugin/ochttp/server.go golang-go.opencensus-0.24.0/plugin/ochttp/server.go
--- golang-go.opencensus-0.23.0/plugin/ochttp/server.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/plugin/ochttp/server.go 2022-11-03 14:13:50.000000000 -0600
@@ -31,14 +31,14 @@
// Handler is an http.Handler wrapper to instrument your HTTP server with
// OpenCensus. It supports both stats and tracing.
//
-// Tracing
+// # Tracing
//
// This handler is aware of the incoming request's span, reading it from request
// headers as configured using the Propagation field.
// The extracted span can be accessed from the incoming request's
// context.
//
-// span := trace.FromContext(r.Context())
+// span := trace.FromContext(r.Context())
//
// The server span will be automatically ended at the end of ServeHTTP.
type Handler struct {
@@ -224,7 +224,9 @@
}
// wrappedResponseWriter returns a wrapped version of the original
-// ResponseWriter and only implements the same combination of additional
+//
+// ResponseWriter and only implements the same combination of additional
+//
// interfaces as the original.
// This implementation is based on https://github.com/felixge/httpsnoop.
func (t *trackingResponseWriter) wrappedResponseWriter() http.ResponseWriter {
diff -Nru golang-go.opencensus-0.23.0/plugin/runmetrics/doc.go golang-go.opencensus-0.24.0/plugin/runmetrics/doc.go
--- golang-go.opencensus-0.23.0/plugin/runmetrics/doc.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/plugin/runmetrics/doc.go 2022-11-03 14:13:50.000000000 -0600
@@ -16,8 +16,8 @@
//
// To enable collecting runtime metrics, just call Enable():
//
-// _ := runmetrics.Enable(runmetrics.RunMetricOptions{
-// EnableCPU: true,
-// EnableMemory: true,
-// })
+// _ := runmetrics.Enable(runmetrics.RunMetricOptions{
+// EnableCPU: true,
+// EnableMemory: true,
+// })
package runmetrics // import "go.opencensus.io/plugin/runmetrics"
diff -Nru golang-go.opencensus-0.23.0/stats/benchmark_test.go golang-go.opencensus-0.24.0/stats/benchmark_test.go
--- golang-go.opencensus-0.23.0/stats/benchmark_test.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/stats/benchmark_test.go 2022-11-03 14:13:50.000000000 -0600
@@ -109,5 +109,13 @@
}
func makeMeasure() *stats.Int64Measure {
- return stats.Int64("m", "test measure", "")
+ m := stats.Int64("m", "test measure", "")
+ v := &view.View{
+ Measure: m,
+ Aggregation: view.Sum(),
+ }
+ if err := view.Register(v); err != nil {
+ panic(err.Error())
+ }
+ return m
}
diff -Nru golang-go.opencensus-0.23.0/stats/doc.go golang-go.opencensus-0.24.0/stats/doc.go
--- golang-go.opencensus-0.23.0/stats/doc.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/stats/doc.go 2022-11-03 14:13:50.000000000 -0600
@@ -19,7 +19,7 @@
OpenCensus allows users to create typed measures, record measurements,
aggregate the collected data, and export the aggregated data.
-Measures
+# Measures
A measure represents a type of data point to be tracked and recorded.
For example, latency, request Mb/s, and response Mb/s are measures
@@ -33,7 +33,7 @@
create views and collect and break down measures by the tags they are
interested in.
-Recording measurements
+# Recording measurements
Measurement is a data point to be collected for a measure. For example,
for a latency (ms) measure, 100 is a measurement that represents a 100ms
@@ -49,7 +49,7 @@
on which measurements they want to collect by registering views. This allows
libraries to turn on the instrumentation by default.
-Exemplars
+# Exemplars
For a given recorded measurement, the associated exemplar is a diagnostic map
that gives more information about the measurement.
@@ -64,6 +64,5 @@
When exported to a supporting back end, you should be able to easily navigate
to example traces that fell into each bucket in the Distribution.
-
*/
package stats // import "go.opencensus.io/stats"
diff -Nru golang-go.opencensus-0.23.0/stats/internal/record.go golang-go.opencensus-0.24.0/stats/internal/record.go
--- golang-go.opencensus-0.23.0/stats/internal/record.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/stats/internal/record.go 2022-11-03 14:13:50.000000000 -0600
@@ -21,5 +21,11 @@
// DefaultRecorder will be called for each Record call.
var DefaultRecorder func(tags *tag.Map, measurement interface{}, attachments map[string]interface{})
+// MeasurementRecorder will be called for each Record call. This is the same as DefaultRecorder but
+// avoids interface{} conversion.
+// This will be a func(tags *tag.Map, measurement []Measurement, attachments map[string]interface{}) type,
+// but is interface{} here to avoid import loops
+var MeasurementRecorder interface{}
+
// SubscriptionReporter reports when a view subscribed with a measure.
var SubscriptionReporter func(measure string)
diff -Nru golang-go.opencensus-0.23.0/stats/record.go golang-go.opencensus-0.24.0/stats/record.go
--- golang-go.opencensus-0.23.0/stats/record.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/stats/record.go 2022-11-03 14:13:50.000000000 -0600
@@ -86,10 +86,29 @@
return o
}
+type measurementRecorder = func(tags *tag.Map, measurement []Measurement, attachments map[string]interface{})
+
// Record records one or multiple measurements with the same context at once.
// If there are any tags in the context, measurements will be tagged with them.
func Record(ctx context.Context, ms ...Measurement) {
- RecordWithOptions(ctx, WithMeasurements(ms...))
+ // Record behaves the same as RecordWithOptions, but because we do not have to handle generic functionality
+ // (RecordOptions) we can reduce some allocations to speed up this hot path
+ if len(ms) == 0 {
+ return
+ }
+ recorder := internal.MeasurementRecorder.(measurementRecorder)
+ record := false
+ for _, m := range ms {
+ if m.desc.subscribed() {
+ record = true
+ break
+ }
+ }
+ if !record {
+ return
+ }
+ recorder(tag.FromContext(ctx), ms, nil)
+ return
}
// RecordWithTags records one or multiple measurements at once.
diff -Nru golang-go.opencensus-0.23.0/stats/view/aggregation.go golang-go.opencensus-0.24.0/stats/view/aggregation.go
--- golang-go.opencensus-0.23.0/stats/view/aggregation.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/stats/view/aggregation.go 2022-11-03 14:13:50.000000000 -0600
@@ -90,9 +90,9 @@
//
// If len(bounds) >= 2 then the boundaries for bucket index i are:
//
-// [-infinity, bounds[i]) for i = 0
-// [bounds[i-1], bounds[i]) for 0 < i < length
-// [bounds[i-1], +infinity) for i = length
+// [-infinity, bounds[i]) for i = 0
+// [bounds[i-1], bounds[i]) for 0 < i < length
+// [bounds[i-1], +infinity) for i = length
//
// If len(bounds) is 0 then there is no histogram associated with the
// distribution. There will be a single bucket with boundaries
diff -Nru golang-go.opencensus-0.23.0/stats/view/collector.go golang-go.opencensus-0.24.0/stats/view/collector.go
--- golang-go.opencensus-0.23.0/stats/view/collector.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/stats/view/collector.go 2022-11-03 14:13:50.000000000 -0600
@@ -59,8 +59,15 @@
// encodeWithKeys encodes the map by using values
// only associated with the keys provided.
func encodeWithKeys(m *tag.Map, keys []tag.Key) []byte {
+ // Compute the buffer length we will need ahead of time to avoid resizing later
+ reqLen := 0
+ for _, k := range keys {
+ s, _ := m.Value(k)
+ // We will store each key + its length
+ reqLen += len(s) + 1
+ }
vb := &tagencoding.Values{
- Buffer: make([]byte, len(keys)),
+ Buffer: make([]byte, reqLen),
}
for _, k := range keys {
v, _ := m.Value(k)
diff -Nru golang-go.opencensus-0.23.0/stats/view/doc.go golang-go.opencensus-0.24.0/stats/view/doc.go
--- golang-go.opencensus-0.23.0/stats/view/doc.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/stats/view/doc.go 2022-11-03 14:13:50.000000000 -0600
@@ -34,7 +34,7 @@
// Libraries can define views but it is recommended that in most cases registering
// views be left up to applications.
//
-// Exporting
+// # Exporting
//
// Collected and aggregated data can be exported to a metric collection
// backend by registering its exporter.
diff -Nru golang-go.opencensus-0.23.0/stats/view/worker.go golang-go.opencensus-0.24.0/stats/view/worker.go
--- golang-go.opencensus-0.23.0/stats/view/worker.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/stats/view/worker.go 2022-11-03 14:13:50.000000000 -0600
@@ -33,6 +33,7 @@
defaultWorker = NewMeter().(*worker)
go defaultWorker.start()
internal.DefaultRecorder = record
+ internal.MeasurementRecorder = recordMeasurement
}
type measureRef struct {
@@ -199,11 +200,21 @@
defaultWorker.Record(tags, ms, attachments)
}
+func recordMeasurement(tags *tag.Map, ms []stats.Measurement, attachments map[string]interface{}) {
+ defaultWorker.recordMeasurement(tags, ms, attachments)
+}
+
// Record records a set of measurements ms associated with the given tags and attachments.
func (w *worker) Record(tags *tag.Map, ms interface{}, attachments map[string]interface{}) {
+ w.recordMeasurement(tags, ms.([]stats.Measurement), attachments)
+}
+
+// recordMeasurement records a set of measurements ms associated with the given tags and attachments.
+// This is the same as Record but without an interface{} type to avoid allocations
+func (w *worker) recordMeasurement(tags *tag.Map, ms []stats.Measurement, attachments map[string]interface{}) {
req := &recordReq{
tm: tags,
- ms: ms.([]stats.Measurement),
+ ms: ms,
attachments: attachments,
t: time.Now(),
}
@@ -221,6 +232,11 @@
defaultWorker.SetReportingPeriod(d)
}
+// Stop stops the default worker.
+func Stop() {
+ defaultWorker.Stop()
+}
+
// SetReportingPeriod sets the interval between reporting aggregated views in
// the program. If duration is less than or equal to zero, it enables the
// default behavior.
@@ -281,7 +297,7 @@
case <-w.quit:
w.timer.Stop()
close(w.c)
- w.done <- true
+ close(w.done)
return
}
}
@@ -290,8 +306,11 @@
func (w *worker) Stop() {
prodMgr := metricproducer.GlobalManager()
prodMgr.DeleteProducer(w)
-
- w.quit <- true
+ select {
+ case <-w.quit:
+ default:
+ close(w.quit)
+ }
<-w.done
}
diff -Nru golang-go.opencensus-0.23.0/stats/view/worker_test.go golang-go.opencensus-0.24.0/stats/view/worker_test.go
--- golang-go.opencensus-0.23.0/stats/view/worker_test.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/stats/view/worker_test.go 2022-11-03 14:13:50.000000000 -0600
@@ -180,14 +180,14 @@
// Format is Resource.Labels encoded as string, then
wantPartialData := map[string][]*Row{
- makeKey(nil, count.Name): []*Row{
+ makeKey(nil, count.Name): {
{[]tag.Tag{{Key: key, Value: "a"}}, &CountData{Value: 2}},
{[]tag.Tag{{Key: key, Value: "b"}}, &CountData{Value: 1}},
},
- makeKey(nil, sum.Name): []*Row{
+ makeKey(nil, sum.Name): {
{nil, &SumData{Value: 7.5}},
},
- makeKey(&extraResource, count.Name): []*Row{
+ makeKey(&extraResource, count.Name): {
{[]tag.Tag{{Key: key, Value: "b"}}, &CountData{Value: 1}},
},
}
diff -Nru golang-go.opencensus-0.23.0/tag/profile_19.go golang-go.opencensus-0.24.0/tag/profile_19.go
--- golang-go.opencensus-0.23.0/tag/profile_19.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/tag/profile_19.go 2022-11-03 14:13:50.000000000 -0600
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+//go:build go1.9
// +build go1.9
package tag
diff -Nru golang-go.opencensus-0.23.0/tag/profile_not19.go golang-go.opencensus-0.24.0/tag/profile_not19.go
--- golang-go.opencensus-0.23.0/tag/profile_not19.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/tag/profile_not19.go 2022-11-03 14:13:50.000000000 -0600
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+//go:build !go1.9
// +build !go1.9
package tag
diff -Nru golang-go.opencensus-0.23.0/trace/doc.go golang-go.opencensus-0.24.0/trace/doc.go
--- golang-go.opencensus-0.23.0/trace/doc.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/trace/doc.go 2022-11-03 14:13:50.000000000 -0600
@@ -18,24 +18,23 @@
The following assumes a basic familiarity with OpenCensus concepts.
See http://opencensus.io
-
-Exporting Traces
+# Exporting Traces
To export collected tracing data, register at least one exporter. You can use
one of the provided exporters or write your own.
- trace.RegisterExporter(exporter)
+ trace.RegisterExporter(exporter)
By default, traces will be sampled relatively rarely. To change the sampling
frequency for your entire program, call ApplyConfig. Use a ProbabilitySampler
to sample a subset of traces, or use AlwaysSample to collect a trace on every run:
- trace.ApplyConfig(trace.Config{DefaultSampler: trace.AlwaysSample()})
+ trace.ApplyConfig(trace.Config{DefaultSampler: trace.AlwaysSample()})
Be careful about using trace.AlwaysSample in a production application with
significant traffic: a new trace will be started and exported for every request.
-Adding Spans to a Trace
+# Adding Spans to a Trace
A trace consists of a tree of spans. In Go, the current span is carried in a
context.Context.
@@ -44,8 +43,8 @@
this to work, the function must take a context.Context as a parameter. Add these two
lines to the top of the function:
- ctx, span := trace.StartSpan(ctx, "example.com/Run")
- defer span.End()
+ ctx, span := trace.StartSpan(ctx, "example.com/Run")
+ defer span.End()
StartSpan will create a new top-level span if the context
doesn't contain another span, otherwise it will create a child span.
diff -Nru golang-go.opencensus-0.23.0/trace/lrumap.go golang-go.opencensus-0.24.0/trace/lrumap.go
--- golang-go.opencensus-0.23.0/trace/lrumap.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/trace/lrumap.go 2022-11-03 14:13:50.000000000 -0600
@@ -44,7 +44,7 @@
}
func (lm lruMap) keys() []interface{} {
- keys := make([]interface{}, len(lm.cacheKeys))
+ keys := make([]interface{}, 0, len(lm.cacheKeys))
for k := range lm.cacheKeys {
keys = append(keys, k)
}
diff -Nru golang-go.opencensus-0.23.0/trace/trace_go11.go golang-go.opencensus-0.24.0/trace/trace_go11.go
--- golang-go.opencensus-0.23.0/trace/trace_go11.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/trace/trace_go11.go 2022-11-03 14:13:50.000000000 -0600
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+//go:build go1.11
// +build go1.11
package trace
diff -Nru golang-go.opencensus-0.23.0/trace/trace_nongo11.go golang-go.opencensus-0.24.0/trace/trace_nongo11.go
--- golang-go.opencensus-0.23.0/trace/trace_nongo11.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/trace/trace_nongo11.go 2022-11-03 14:13:50.000000000 -0600
@@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+//go:build !go1.11
// +build !go1.11
package trace
diff -Nru golang-go.opencensus-0.23.0/zpages/zpages.go golang-go.opencensus-0.24.0/zpages/zpages.go
--- golang-go.opencensus-0.23.0/zpages/zpages.go 2021-02-12 09:50:36.000000000 -0700
+++ golang-go.opencensus-0.24.0/zpages/zpages.go 2022-11-03 14:13:50.000000000 -0600
@@ -22,7 +22,7 @@
// zpages are currrently work-in-process and cannot display minutely and
// hourly stats correctly.
//
-// Performance
+// # Performance
//
// Installing the zpages has a performance overhead because additional traces
// and stats will be collected in-process. In most cases, we expect this
Reply to: