Skip to content

Commit 65367f2

Browse files
authored
Prepare v0.16.0 release (#523)
* Prepare v0.16.0 release Signed-off-by: Anthony J Mirabella <[email protected]> * Fix Cortex exporter histogram sumamrization Signed-off-by: Anthony J Mirabella <[email protected]> * Avoid double closing a done channel Signed-off-by: Anthony J Mirabella <[email protected]> * Treat cortex histogram bucket counts as floats since they will be coerced to float64 anyways * Remove unused test helper * Fix datadog example test * Fix TraceState comparisons in propagator tests
1 parent cd07cf3 commit 65367f2

File tree

101 files changed

+632
-672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+632
-672
lines changed

CHANGELOG.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
88

99
## [Unreleased]
1010

11+
## [0.16.0] - 2021-01-13
12+
1113
### Fixed
1214

1315
- Fix module path for AWS ECS resource detector (#517)
@@ -256,7 +258,8 @@ First official tagged release of `contrib` repository.
256258
- Prefix support for dogstatsd (#34)
257259
- Update Go Runtime package to use batch observer (#44)
258260

259-
[Unreleased]: https://github.com/open-telemetry/opentelemetry-go-contrib/compare/v0.15.1...HEAD
261+
[Unreleased]: https://github.com/open-telemetry/opentelemetry-go-contrib/compare/v0.16.0...HEAD
262+
[0.16.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.16.0
260263
[0.15.1]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.15.1
261264
[0.15.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.15.0
262265
[0.14.0]: https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v0.14.0

contrib.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package contrib // import "go.opentelemetry.io/contrib"
1818

1919
// Version is the current release version of OpenTelemetry Contrib in use.
2020
func Version() string {
21-
return "0.15.1"
21+
return "0.16.0"
2222
// This string is updated by the pre_release.sh script during release
2323
}
2424

detectors/aws/ecs/go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ require (
66
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869
77
github.com/kr/pretty v0.2.1 // indirect
88
github.com/stretchr/testify v1.6.1
9-
go.opentelemetry.io/otel v0.15.0
10-
go.opentelemetry.io/otel/sdk v0.15.0
9+
go.opentelemetry.io/otel v0.16.0
10+
go.opentelemetry.io/otel/sdk v0.16.0
1111
)

detectors/aws/ecs/go.sum

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60=
21
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
32
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
43
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
54
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
65
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
76
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
87
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
9-
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
108
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
119
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
1210
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -18,10 +16,10 @@ github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
1816
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
1917
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
2018
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
21-
go.opentelemetry.io/otel v0.15.0 h1:CZFy2lPhxd4HlhZnYK8gRyDotksO3Ip9rBweY1vVYJw=
22-
go.opentelemetry.io/otel v0.15.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
23-
go.opentelemetry.io/otel/sdk v0.15.0 h1:Hf2dl1Ad9Hn03qjcAuAq51GP5Pv1SV5puIkS2nRhdd8=
24-
go.opentelemetry.io/otel/sdk v0.15.0/go.mod h1:Qudkwgq81OcA9GYVlbyZ62wkLieeS1eWxIL0ufxgwoc=
19+
go.opentelemetry.io/otel v0.16.0 h1:uIWEbdeb4vpKPGITLsRVUS44L5oDbDUCZxn8lkxhmgw=
20+
go.opentelemetry.io/otel v0.16.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
21+
go.opentelemetry.io/otel/sdk v0.16.0 h1:5o+fkNsOfH5Mix1bHUApNBqeDcAYczHDa7Ix+R73K2U=
22+
go.opentelemetry.io/otel/sdk v0.16.0/go.mod h1:Jb0B4wrxerxtBeapvstmAZvJGQmvah4dHgKSngDpiCo=
2523
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
2624
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
2725
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=

detectors/aws/eks/go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ require (
66
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869
77
github.com/kr/pretty v0.2.1 // indirect
88
github.com/stretchr/testify v1.6.1
9-
go.opentelemetry.io/otel v0.15.0
10-
go.opentelemetry.io/otel/sdk v0.15.0
9+
go.opentelemetry.io/otel v0.16.0
10+
go.opentelemetry.io/otel/sdk v0.16.0
1111
)

detectors/aws/eks/go.sum

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60=
21
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
32
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 h1:DDGfHa7BWjL4YnC6+E63dPcxHo2sUxDIu8g3QgEJdRY=
43
github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4=
54
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
65
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
76
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
87
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
9-
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
108
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
119
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
1210
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -18,10 +16,10 @@ github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
1816
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
1917
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
2018
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
21-
go.opentelemetry.io/otel v0.15.0 h1:CZFy2lPhxd4HlhZnYK8gRyDotksO3Ip9rBweY1vVYJw=
22-
go.opentelemetry.io/otel v0.15.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
23-
go.opentelemetry.io/otel/sdk v0.15.0 h1:Hf2dl1Ad9Hn03qjcAuAq51GP5Pv1SV5puIkS2nRhdd8=
24-
go.opentelemetry.io/otel/sdk v0.15.0/go.mod h1:Qudkwgq81OcA9GYVlbyZ62wkLieeS1eWxIL0ufxgwoc=
19+
go.opentelemetry.io/otel v0.16.0 h1:uIWEbdeb4vpKPGITLsRVUS44L5oDbDUCZxn8lkxhmgw=
20+
go.opentelemetry.io/otel v0.16.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
21+
go.opentelemetry.io/otel/sdk v0.16.0 h1:5o+fkNsOfH5Mix1bHUApNBqeDcAYczHDa7Ix+R73K2U=
22+
go.opentelemetry.io/otel/sdk v0.16.0/go.mod h1:Jb0B4wrxerxtBeapvstmAZvJGQmvah4dHgKSngDpiCo=
2523
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
2624
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
2725
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=

detectors/aws/go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ go 1.14
55
require (
66
github.com/aws/aws-sdk-go v1.36.23
77
github.com/stretchr/testify v1.6.1
8-
go.opentelemetry.io/otel v0.15.0
9-
go.opentelemetry.io/otel/sdk v0.15.0
8+
go.opentelemetry.io/otel v0.16.0
9+
go.opentelemetry.io/otel/sdk v0.16.0
1010
)

detectors/aws/go.sum

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60=
21
github.com/aws/aws-sdk-go v1.36.23 h1:umM44ptMKImsUWLtjGBv/4Ut7Nd99DfqoZDkO0j0/Kc=
32
github.com/aws/aws-sdk-go v1.36.23/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
43
github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg=
@@ -7,7 +6,6 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8
76
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
87
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
98
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
10-
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
119
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
1210
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
1311
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
@@ -18,10 +16,10 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
1816
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
1917
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
2018
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
21-
go.opentelemetry.io/otel v0.15.0 h1:CZFy2lPhxd4HlhZnYK8gRyDotksO3Ip9rBweY1vVYJw=
22-
go.opentelemetry.io/otel v0.15.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
23-
go.opentelemetry.io/otel/sdk v0.15.0 h1:Hf2dl1Ad9Hn03qjcAuAq51GP5Pv1SV5puIkS2nRhdd8=
24-
go.opentelemetry.io/otel/sdk v0.15.0/go.mod h1:Qudkwgq81OcA9GYVlbyZ62wkLieeS1eWxIL0ufxgwoc=
19+
go.opentelemetry.io/otel v0.16.0 h1:uIWEbdeb4vpKPGITLsRVUS44L5oDbDUCZxn8lkxhmgw=
20+
go.opentelemetry.io/otel v0.16.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
21+
go.opentelemetry.io/otel/sdk v0.16.0 h1:5o+fkNsOfH5Mix1bHUApNBqeDcAYczHDa7Ix+R73K2U=
22+
go.opentelemetry.io/otel/sdk v0.16.0/go.mod h1:Jb0B4wrxerxtBeapvstmAZvJGQmvah4dHgKSngDpiCo=
2523
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
2624
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
2725
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=

detectors/gcp/go.mod

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ go 1.14
55
require (
66
cloud.google.com/go v0.74.0
77
github.com/google/go-cmp v0.5.4
8-
go.opentelemetry.io/otel v0.15.0
9-
go.opentelemetry.io/otel/sdk v0.15.0
8+
go.opentelemetry.io/otel v0.16.0
9+
go.opentelemetry.io/otel/sdk v0.16.0
1010
)

detectors/gcp/go.sum

+4-6
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
3939
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
4040
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
4141
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
42-
github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60=
4342
github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg=
4443
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
4544
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@@ -100,7 +99,6 @@ github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
10099
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
101100
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
102101
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
103-
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
104102
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
105103
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
106104
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
@@ -149,10 +147,10 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
149147
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
150148
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
151149
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
152-
go.opentelemetry.io/otel v0.15.0 h1:CZFy2lPhxd4HlhZnYK8gRyDotksO3Ip9rBweY1vVYJw=
153-
go.opentelemetry.io/otel v0.15.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
154-
go.opentelemetry.io/otel/sdk v0.15.0 h1:Hf2dl1Ad9Hn03qjcAuAq51GP5Pv1SV5puIkS2nRhdd8=
155-
go.opentelemetry.io/otel/sdk v0.15.0/go.mod h1:Qudkwgq81OcA9GYVlbyZ62wkLieeS1eWxIL0ufxgwoc=
150+
go.opentelemetry.io/otel v0.16.0 h1:uIWEbdeb4vpKPGITLsRVUS44L5oDbDUCZxn8lkxhmgw=
151+
go.opentelemetry.io/otel v0.16.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
152+
go.opentelemetry.io/otel/sdk v0.16.0 h1:5o+fkNsOfH5Mix1bHUApNBqeDcAYczHDa7Ix+R73K2U=
153+
go.opentelemetry.io/otel/sdk v0.16.0/go.mod h1:Jb0B4wrxerxtBeapvstmAZvJGQmvah4dHgKSngDpiCo=
156154
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
157155
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
158156
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=

exporters/metric/cortex/cortex.go

+13-82
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ import (
3434
"go.opentelemetry.io/otel/sdk/export/metric"
3535
export "go.opentelemetry.io/otel/sdk/export/metric"
3636
"go.opentelemetry.io/otel/sdk/export/metric/aggregation"
37-
"go.opentelemetry.io/otel/sdk/metric/controller/push"
38-
"go.opentelemetry.io/otel/sdk/metric/processor/basic"
37+
controller "go.opentelemetry.io/otel/sdk/metric/controller/basic"
38+
processor "go.opentelemetry.io/otel/sdk/metric/processor/basic"
3939
"go.opentelemetry.io/otel/sdk/metric/selector/simple"
4040
)
4141

@@ -88,26 +88,25 @@ func NewRawExporter(config Config) (*Exporter, error) {
8888

8989
// NewExportPipeline sets up a complete export pipeline with a push Controller and
9090
// Exporter.
91-
func NewExportPipeline(config Config, options ...push.Option) (*push.Controller, error) {
91+
func NewExportPipeline(config Config, options ...controller.Option) (*controller.Controller, error) {
9292
exporter, err := NewRawExporter(config)
9393
if err != nil {
9494
return nil, err
9595
}
9696

97-
pusher := push.New(
98-
basic.New(
97+
pusher := controller.New(
98+
processor.New(
9999
simple.NewWithHistogramDistribution(config.HistogramBoundaries),
100100
exporter,
101101
),
102-
exporter,
103-
options...,
102+
append(options, controller.WithPusher(exporter))...,
104103
)
105-
pusher.Start()
106-
return pusher, nil
104+
105+
return pusher, pusher.Start(context.TODO())
107106
}
108107

109108
// InstallNewPipeline registers a push Controller's MeterProvider globally.
110-
func InstallNewPipeline(config Config, options ...push.Option) (*push.Controller, error) {
109+
func InstallNewPipeline(config Config, options ...controller.Option) (*controller.Controller, error) {
111110
pusher, err := NewExportPipeline(config, options...)
112111
if err != nil {
113112
return nil, err
@@ -130,9 +129,7 @@ func (e *Exporter) ConvertToTimeSeries(checkpointSet export.CheckpointSet) ([]*p
130129

131130
// The following section uses loose type checking to determine how to
132131
// convert aggregations to timeseries. More "expensive" timeseries are
133-
// checked first. For example, because a Distribution has a Sum value,
134-
// we must check for Distribution first or else only the Sum would be
135-
// converted and the other values like Quantiles would not be.
132+
// checked first.
136133
//
137134
// See the Aggregator Kind for more information
138135
// https://github.com/open-telemetry/opentelemetry-go/blob/master/sdk/export/metric/aggregation/aggregation.go#L123-L138
@@ -142,12 +139,6 @@ func (e *Exporter) ConvertToTimeSeries(checkpointSet export.CheckpointSet) ([]*p
142139
return err
143140
}
144141
timeSeries = append(timeSeries, tSeries...)
145-
} else if distribution, ok := agg.(aggregation.Distribution); ok && len(e.config.Quantiles) != 0 {
146-
tSeries, err := convertFromDistribution(record, distribution, e.config.Quantiles)
147-
if err != nil {
148-
return err
149-
}
150-
timeSeries = append(timeSeries, tSeries...)
151142
} else if sum, ok := agg.(aggregation.Sum); ok {
152143
tSeries, err := convertFromSum(record, sum)
153144
if err != nil {
@@ -257,7 +248,7 @@ func convertFromMinMaxSumCount(record metric.Record, minMaxSumCount aggregation.
257248
return nil, err
258249
}
259250
name = sanitize(record.Descriptor().Name() + "_count")
260-
countTimeSeries := createTimeSeries(record, number.NewInt64Number(count), number.Int64Kind, label.String("__name__", name))
251+
countTimeSeries := createTimeSeries(record, number.NewInt64Number(int64(count)), number.Int64Kind, label.String("__name__", name))
261252

262253
// Return all timeSeries
263254
tSeries := []*prompb.TimeSeries{
@@ -267,66 +258,6 @@ func convertFromMinMaxSumCount(record metric.Record, minMaxSumCount aggregation.
267258
return tSeries, nil
268259
}
269260

270-
// convertFromDistribution returns len(quantiles) number of TimeSeries in a distribution.
271-
func convertFromDistribution(record metric.Record, distribution aggregation.Distribution, quantiles []float64) ([]*prompb.TimeSeries, error) {
272-
var timeSeries []*prompb.TimeSeries
273-
metricName := sanitize(record.Descriptor().Name())
274-
numberKind := record.Descriptor().NumberKind()
275-
276-
// Convert Min
277-
min, err := distribution.Min()
278-
if err != nil {
279-
return nil, err
280-
}
281-
name := sanitize(metricName + "_min")
282-
minTimeSeries := createTimeSeries(record, min, numberKind, label.String("__name__", name))
283-
timeSeries = append(timeSeries, minTimeSeries)
284-
285-
// Convert Max
286-
max, err := distribution.Max()
287-
if err != nil {
288-
return nil, err
289-
}
290-
name = sanitize(metricName + "_max")
291-
maxTimeSeries := createTimeSeries(record, max, numberKind, label.String("__name__", name))
292-
timeSeries = append(timeSeries, maxTimeSeries)
293-
294-
// Convert Sum
295-
sum, err := distribution.Sum()
296-
if err != nil {
297-
return nil, err
298-
}
299-
name = sanitize(metricName + "_sum")
300-
sumTimeSeries := createTimeSeries(record, sum, numberKind, label.String("__name__", name))
301-
timeSeries = append(timeSeries, sumTimeSeries)
302-
303-
// Convert Count
304-
count, err := distribution.Count()
305-
if err != nil {
306-
return nil, err
307-
}
308-
name = sanitize(record.Descriptor().Name() + "_count")
309-
countTimeSeries := createTimeSeries(record, number.NewInt64Number(count), number.Int64Kind, label.String("__name__", name))
310-
timeSeries = append(timeSeries, countTimeSeries)
311-
312-
// For each configured quantile, get the value and create a timeseries
313-
for _, q := range quantiles {
314-
value, err := distribution.Quantile(q)
315-
if err != nil {
316-
return nil, err
317-
}
318-
319-
// Add quantile as a label. e.g. {quantile="0.5"}
320-
quantileStr := strconv.FormatFloat(q, 'f', -1, 64)
321-
322-
// Create TimeSeries
323-
tSeries := createTimeSeries(record, value, numberKind, label.String("__name__", metricName), label.String("quantile", quantileStr))
324-
timeSeries = append(timeSeries, tSeries)
325-
}
326-
327-
return timeSeries, nil
328-
}
329-
330261
// convertFromHistogram returns len(histogram.Buckets) timeseries for a histogram aggregation
331262
func convertFromHistogram(record metric.Record, histogram aggregation.Histogram) ([]*prompb.TimeSeries, error) {
332263
var timeSeries []*prompb.TimeSeries
@@ -353,7 +284,7 @@ func convertFromHistogram(record metric.Record, histogram aggregation.Histogram)
353284
counts := make(map[float64]float64, len(buckets.Boundaries))
354285
for i, boundary := range buckets.Boundaries {
355286
// Add bucket count to totalCount and record in map
356-
totalCount += buckets.Counts[i]
287+
totalCount += float64(buckets.Counts[i])
357288
counts[boundary] = totalCount
358289

359290
// Add upper boundary as a label. e.g. {le="5"}
@@ -365,7 +296,7 @@ func convertFromHistogram(record metric.Record, histogram aggregation.Histogram)
365296
}
366297

367298
// Include the +inf boundary in the total count
368-
totalCount += buckets.Counts[len(buckets.Counts)-1]
299+
totalCount += float64(buckets.Counts[len(buckets.Counts)-1])
369300

370301
// Create a timeSeries for the +inf bucket and total count
371302
// These are the same and are both required by Prometheus-based backends

exporters/metric/cortex/cortex_test.go

+2-8
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,6 @@ func TestConvertToTimeSeries(t *testing.T) {
112112
want: wantMMSCCheckpointSet,
113113
wantLength: 4,
114114
},
115-
{
116-
name: "convertFromDistribution",
117-
input: getDistributionCheckpoint(t),
118-
want: wantDistributionCheckpointSet,
119-
wantLength: 7,
120-
},
121115
{
122116
name: "convertFromHistogram",
123117
input: getHistogramCheckpoint(t),
@@ -159,8 +153,8 @@ func TestConvertToTimeSeries(t *testing.T) {
159153
wantSamples[sample.String()] = true
160154
}
161155
}
162-
assert.Equal(t, gotLabels, wantLabels)
163-
assert.Equal(t, gotSamples, wantSamples)
156+
assert.Equal(t, wantLabels, gotLabels)
157+
assert.Equal(t, wantSamples, gotSamples)
164158
})
165159
}
166160
}

0 commit comments

Comments
 (0)