Skip to content

Commit

Permalink
update otel dependencies to v0.16.0 (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole authored Jan 25, 2021
1 parent ec1e54d commit 3bd6897
Show file tree
Hide file tree
Showing 17 changed files with 81 additions and 89 deletions.
8 changes: 4 additions & 4 deletions example/metric/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"go.opentelemetry.io/otel/label"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/sdk/metric/controller/push"
"go.opentelemetry.io/otel/sdk/metric/controller/basic"
"go.opentelemetry.io/otel/sdk/resource"
)

Expand Down Expand Up @@ -62,18 +62,18 @@ func main() {
// the function to handle the common resource just ignore the passed resource and
// it returned hard coded "global" resource.
// This should be fixed in #29.
resOpt := push.WithResource(resource.NewWithAttributes(
resOpt := basic.WithResource(resource.NewWithAttributes(
label.String("instance_id", "abc123"),
label.String("application", "example-app"),
))
pusher, err := mexporter.InstallNewPipeline(opts, resOpt)
if err != nil {
log.Fatalf("Failed to establish pipeline: %v", err)
}
defer pusher.Stop()
ctx := context.Background()
defer pusher.Stop(ctx)

// Start meter
ctx := context.Background()
meter := pusher.MeterProvider().Meter("cloudmonitoring/example")

// Register counter value
Expand Down
4 changes: 2 additions & 2 deletions example/metric/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ replace github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metr

require (
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.13.0
go.opentelemetry.io/otel v0.15.0
go.opentelemetry.io/otel/sdk v0.15.0
go.opentelemetry.io/otel v0.16.0
go.opentelemetry.io/otel/sdk v0.16.0
)
12 changes: 4 additions & 8 deletions example/metric/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8=
github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60=
github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg=
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
Expand Down Expand Up @@ -96,8 +94,6 @@ github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
Expand Down Expand Up @@ -143,10 +139,10 @@ go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opentelemetry.io/otel v0.15.0 h1:CZFy2lPhxd4HlhZnYK8gRyDotksO3Ip9rBweY1vVYJw=
go.opentelemetry.io/otel v0.15.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
go.opentelemetry.io/otel/sdk v0.15.0 h1:Hf2dl1Ad9Hn03qjcAuAq51GP5Pv1SV5puIkS2nRhdd8=
go.opentelemetry.io/otel/sdk v0.15.0/go.mod h1:Qudkwgq81OcA9GYVlbyZ62wkLieeS1eWxIL0ufxgwoc=
go.opentelemetry.io/otel v0.16.0 h1:uIWEbdeb4vpKPGITLsRVUS44L5oDbDUCZxn8lkxhmgw=
go.opentelemetry.io/otel v0.16.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
go.opentelemetry.io/otel/sdk v0.16.0 h1:5o+fkNsOfH5Mix1bHUApNBqeDcAYczHDa7Ix+R73K2U=
go.opentelemetry.io/otel/sdk v0.16.0/go.mod h1:Jb0B4wrxerxtBeapvstmAZvJGQmvah4dHgKSngDpiCo=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand Down
6 changes: 3 additions & 3 deletions example/trace/http/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ replace github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trac
require (
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/trace v0.13.0
github.com/davecgh/go-spew v1.1.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.15.0
go.opentelemetry.io/otel v0.15.0
go.opentelemetry.io/otel/sdk v0.15.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.16.0
go.opentelemetry.io/otel v0.16.0
go.opentelemetry.io/otel/sdk v0.16.0
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
)
18 changes: 8 additions & 10 deletions example/trace/http/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60=
github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg=
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
Expand Down Expand Up @@ -90,7 +89,6 @@ github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
Expand Down Expand Up @@ -134,14 +132,14 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opentelemetry.io/contrib v0.15.0 h1:PsFV87Cm5OhbO8kIziFlKHLU3Q4EMIldth6IpfuFZ2U=
go.opentelemetry.io/contrib v0.15.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.15.0 h1:wAs8k+Wy1lLsrOZHUIO/GA3W4GtgjBHj65Yx4cWxuuE=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.15.0/go.mod h1:izvp60N3azPQmZ9aa54VoavB9U1RDQanABuW8KXjRkw=
go.opentelemetry.io/otel v0.15.0 h1:CZFy2lPhxd4HlhZnYK8gRyDotksO3Ip9rBweY1vVYJw=
go.opentelemetry.io/otel v0.15.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
go.opentelemetry.io/otel/sdk v0.15.0 h1:Hf2dl1Ad9Hn03qjcAuAq51GP5Pv1SV5puIkS2nRhdd8=
go.opentelemetry.io/otel/sdk v0.15.0/go.mod h1:Qudkwgq81OcA9GYVlbyZ62wkLieeS1eWxIL0ufxgwoc=
go.opentelemetry.io/contrib v0.16.0 h1:cScR/U3bjTjxsBv939wh4miANY/akdP644rsg9msrIA=
go.opentelemetry.io/contrib v0.16.0/go.mod h1:G/EtFaa6qaN7+LxqfIAT3GiZa7Wv5DTBUzl5H4LY0Kc=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.16.0 h1:hPbUH5fugPACtUdBWGL5glNqzowwHvnOdnwvQOATWgM=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.16.0/go.mod h1:dNF4PMGeouMEPAWDwgEjsGFlod9hAU8oj0TU0w2J19g=
go.opentelemetry.io/otel v0.16.0 h1:uIWEbdeb4vpKPGITLsRVUS44L5oDbDUCZxn8lkxhmgw=
go.opentelemetry.io/otel v0.16.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
go.opentelemetry.io/otel/sdk v0.16.0 h1:5o+fkNsOfH5Mix1bHUApNBqeDcAYczHDa7Ix+R73K2U=
go.opentelemetry.io/otel/sdk v0.16.0/go.mod h1:Jb0B4wrxerxtBeapvstmAZvJGQmvah4dHgKSngDpiCo=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand Down
8 changes: 4 additions & 4 deletions exporter/metric/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ package main
import (
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/label"
"go.opentelemetry.io/otel/sdk/metric/controller/push"
"go.opentelemetry.io/otel/sdk/metric/controller/basic"
"go.opentelemetry.io/otel/sdk/resource"

mexporter "github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric"
Expand All @@ -30,17 +30,17 @@ import (
func main() {
// Initialize exporter option.
opts := []mexporter.Option{}
popts:= []push.Option{}
popts:= []basic.Option{}

// Create exporter (collector embedded with the exporter).
pusher, err := mexporter.InstallNewPipeline(opts, popts...)
if err != nil {
log.Fatalf("mexporter.InstallNewPipeline: %v", err)
}
defer pusher.Stop()
ctx := context.Background()
defer pusher.Stop(ctx)

// Start meter
ctx := context.Background()
meter := pusher.Provider().Meter("cloudmonitoring/example")

counter := metric.Must(meter).NewInt64Counter("counter-foo")
Expand Down
4 changes: 2 additions & 2 deletions exporter/metric/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ require (
github.com/golang/protobuf v1.4.2
github.com/googleinterns/cloud-operations-api-mock v0.0.0-20200709193332-a1e58c29bdd3
github.com/stretchr/testify v1.6.1
go.opentelemetry.io/otel v0.15.0
go.opentelemetry.io/otel/sdk v0.15.0
go.opentelemetry.io/otel v0.16.0
go.opentelemetry.io/otel/sdk v0.16.0
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/sys v0.0.0-20200828194041-157a740278f4 // indirect
google.golang.org/api v0.30.0
Expand Down
12 changes: 4 additions & 8 deletions exporter/metric/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DataDog/sketches-go v0.0.1 h1:RtG+76WKgZuz6FIaGsjoPePmadDBkuD/KC6+ZWu78b8=
github.com/DataDog/sketches-go v0.0.1/go.mod h1:Q5DbzQ+3AkgGwymQO7aZFNP7ns2lZKGtvRBzRXfdi60=
github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg=
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
Expand Down Expand Up @@ -101,8 +99,6 @@ github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k=
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
Expand Down Expand Up @@ -149,10 +145,10 @@ go.opencensus.io v0.22.3 h1:8sGtKOrtQqkN1bp2AtX+misvLIlOmsEsNd+9NIcPEm8=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4 h1:LYy1Hy3MJdrCdMwwzxA/dRok4ejH+RwNGbuoD9fCjto=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opentelemetry.io/otel v0.15.0 h1:CZFy2lPhxd4HlhZnYK8gRyDotksO3Ip9rBweY1vVYJw=
go.opentelemetry.io/otel v0.15.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
go.opentelemetry.io/otel/sdk v0.15.0 h1:Hf2dl1Ad9Hn03qjcAuAq51GP5Pv1SV5puIkS2nRhdd8=
go.opentelemetry.io/otel/sdk v0.15.0/go.mod h1:Qudkwgq81OcA9GYVlbyZ62wkLieeS1eWxIL0ufxgwoc=
go.opentelemetry.io/otel v0.16.0 h1:uIWEbdeb4vpKPGITLsRVUS44L5oDbDUCZxn8lkxhmgw=
go.opentelemetry.io/otel v0.16.0/go.mod h1:e4GKElweB8W2gWUqbghw0B8t5MCTccc9212eNHnOHwA=
go.opentelemetry.io/otel/sdk v0.16.0 h1:5o+fkNsOfH5Mix1bHUApNBqeDcAYczHDa7Ix+R73K2U=
go.opentelemetry.io/otel/sdk v0.16.0/go.mod h1:Jb0B4wrxerxtBeapvstmAZvJGQmvah4dHgKSngDpiCo=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand Down
22 changes: 13 additions & 9 deletions exporter/metric/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"fmt"
"log"
"math"
"strings"
"time"

Expand All @@ -28,7 +29,7 @@ import (
"go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue"
"go.opentelemetry.io/otel/sdk/metric/aggregator/minmaxsumcount"
"go.opentelemetry.io/otel/sdk/metric/aggregator/sum"
"go.opentelemetry.io/otel/sdk/metric/controller/push"
controller "go.opentelemetry.io/otel/sdk/metric/controller/basic"
"go.opentelemetry.io/otel/sdk/metric/processor/basic"
"go.opentelemetry.io/otel/sdk/resource"

Expand Down Expand Up @@ -150,7 +151,7 @@ func newMetricExporter(o *options) (*metricExporter, error) {
}

// InstallNewPipeline instantiates a NewExportPipeline and registers it globally.
func InstallNewPipeline(opts []Option, popts ...push.Option) (*push.Controller, error) {
func InstallNewPipeline(opts []Option, popts ...controller.Option) (*controller.Controller, error) {
pusher, err := NewExportPipeline(opts, popts...)
if err != nil {
return nil, err
Expand All @@ -161,7 +162,7 @@ func InstallNewPipeline(opts []Option, popts ...push.Option) (*push.Controller,

// NewExportPipeline sets up a complete export pipeline with the recommended setup,
// chaining a NewRawExporter into the recommended selectors and integrators.
func NewExportPipeline(opts []Option, popts ...push.Option) (*push.Controller, error) {
func NewExportPipeline(opts []Option, popts ...controller.Option) (*controller.Controller, error) {
selector := NewWithCloudMonitoringDistribution()
exporter, err := NewRawExporter(opts...)
if err != nil {
Expand All @@ -170,14 +171,14 @@ func NewExportPipeline(opts []Option, popts ...push.Option) (*push.Controller, e
period := exporter.metricExporter.o.ReportingInterval
checkpointer := basic.New(selector, exporter)

pusher := push.New(
pusher := controller.New(
checkpointer,
exporter,
append([]push.Option{
push.WithPeriod(period),
append([]controller.Option{
controller.WithPusher(exporter),
controller.WithCollectPeriod(period),
}, popts...)...,
)
pusher.Start()
pusher.Start(context.Background())
return pusher, nil
}

Expand Down Expand Up @@ -554,9 +555,12 @@ func countToTypeValueAndTimestamp(count *minmaxsumcount.Aggregator, kind number.
}
switch kind {
case number.Int64Kind:
if value > math.MaxInt64 {
return nil, nil, fmt.Errorf("unable to convert uint64 to int64: uint64 %v exceeds the max for int64: %v", value, string(math.MaxInt64))
}
return &monitoringpb.TypedValue{
Value: &monitoringpb.TypedValue_Int64Value{
Int64Value: value,
Int64Value: int64(value),
},
}, t, nil
case number.Float64Kind:
Expand Down
8 changes: 4 additions & 4 deletions exporter/metric/metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"go.opentelemetry.io/otel/sdk/export/metric/metrictest"
aggtest "go.opentelemetry.io/otel/sdk/metric/aggregator/aggregatortest"
"go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue"
"go.opentelemetry.io/otel/sdk/metric/controller/push"
"go.opentelemetry.io/otel/sdk/metric/controller/basic"
"go.opentelemetry.io/otel/sdk/resource"

"github.com/googleinterns/cloud-operations-api-mock/cloudmock"
Expand Down Expand Up @@ -78,7 +78,7 @@ func TestExportCounter(t *testing.T) {

clientOpt := option.WithGRPCConn(cloudMock.ClientConn())

resOpt := push.WithResource(
resOpt := basic.WithResource(
resource.NewWithAttributes(
label.String("test_id", "abc123"),
),
Expand All @@ -94,10 +94,10 @@ func TestExportCounter(t *testing.T) {
)
assert.NoError(t, err)

defer pusher.Stop()
ctx := context.Background()
defer pusher.Stop(ctx)

// Start meter
ctx := context.Background()
meter := pusher.MeterProvider().Meter("cloudmonitoring/test")

// Register counter value
Expand Down
16 changes: 8 additions & 8 deletions exporter/trace/cloudtrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import (
type Option func(*options)

// DisplayNameFormatter is is a function that produces the display name of a span
// given its SpanData
type DisplayNameFormatter func(*export.SpanData) string
// given its SpanSnapshot
type DisplayNameFormatter func(*export.SpanSnapshot) string

// options contains options for configuring the exporter.
type options struct {
Expand Down Expand Up @@ -131,8 +131,8 @@ type options struct {
ReportingInterval time.Duration

// DisplayNameFormatter is a function that produces the display name of a span
// given its SpanData.
// Optional. Default format for SpanData s is "Span.{s.SpanKind}-{s.Name}"
// given its SpanSnapshot.
// Optional. Default format for SpanSnapshot s is "Span.{s.SpanKind}-{s.Name}"
DisplayNameFormatter

// MaxNumberOfWorkers sets the maximum number of go rountines that send requests
Expand Down Expand Up @@ -238,7 +238,7 @@ func WithTimeout(t time.Duration) func(o *options) {
}

// WithDisplayNameFormatter sets the way span's display names will be
// generated from SpanData
// generated from SpanSnapshot
func WithDisplayNameFormatter(f DisplayNameFormatter) func(o *options) {
return func(o *options) {
o.DisplayNameFormatter = f
Expand Down Expand Up @@ -321,8 +321,8 @@ func newContextWithTimeout(ctx context.Context, timeout time.Duration) (context.
return context.WithTimeout(ctx, timeout)
}

// ExportSpans exports a SpanData to Stackdriver Trace.
func (e *Exporter) ExportSpans(ctx context.Context, spanData []*export.SpanData) error {
// ExportSpans exports a SpanSnapshot to Stackdriver Trace.
func (e *Exporter) ExportSpans(ctx context.Context, spanData []*export.SpanSnapshot) error {
for _, sd := range spanData {
if len(e.traceExporter.o.DefaultTraceAttributes) > 0 {
sd = e.sdWithDefaultTraceAttributes(sd)
Expand All @@ -342,7 +342,7 @@ func (e *Exporter) Shutdown(ctx context.Context) error {
return nil
}

func (e *Exporter) sdWithDefaultTraceAttributes(sd *export.SpanData) *export.SpanData {
func (e *Exporter) sdWithDefaultTraceAttributes(sd *export.SpanSnapshot) *export.SpanSnapshot {
newSD := *sd
for k, v := range e.traceExporter.o.DefaultTraceAttributes {
switch val := v.(type) {
Expand Down
2 changes: 1 addition & 1 deletion exporter/trace/cloudtrace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func TestExporter_DisplayNameFormatter(t *testing.T) {
clientOpt := []option.ClientOption{option.WithGRPCConn(mock.ClientConn())}

spanName := "span1234"
format := func(s *export.SpanData) string {
format := func(s *export.SpanSnapshot) string {
return "TEST_FORMAT" + s.Name
}

Expand Down
4 changes: 2 additions & 2 deletions exporter/trace/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ require (
github.com/golang/protobuf v1.4.2
github.com/googleinterns/cloud-operations-api-mock v0.0.0-20200709193332-a1e58c29bdd3
github.com/stretchr/testify v1.6.1
go.opentelemetry.io/otel v0.15.0
go.opentelemetry.io/otel/sdk v0.15.0
go.opentelemetry.io/otel v0.16.0
go.opentelemetry.io/otel/sdk v0.16.0
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
google.golang.org/api v0.29.0
google.golang.org/genproto v0.0.0-20200715011427-11fb19a81f2c
Expand Down
Loading

0 comments on commit 3bd6897

Please sign in to comment.