From 6c442e5bac8a026698f61e8634cd804eb052853d Mon Sep 17 00:00:00 2001 From: dmathieu Date: Tue, 29 Aug 2023 09:48:46 +0200 Subject: [PATCH 1/2] upgrade otel dependencies --- module/apmotel/go.mod | 12 ++++++------ module/apmotel/go.sum | 12 ++++++++++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/module/apmotel/go.mod b/module/apmotel/go.mod index c4fde2981..e245a4801 100644 --- a/module/apmotel/go.mod +++ b/module/apmotel/go.mod @@ -4,11 +4,11 @@ require ( github.com/stretchr/testify v1.8.4 go.elastic.co/apm/module/apmhttp/v2 v2.4.3 go.elastic.co/apm/v2 v2.4.3 - go.opentelemetry.io/otel v1.16.0 - go.opentelemetry.io/otel/metric v1.16.0 - go.opentelemetry.io/otel/sdk v1.16.0 - go.opentelemetry.io/otel/sdk/metric v0.39.0 - go.opentelemetry.io/otel/trace v1.16.0 + go.opentelemetry.io/otel v1.17.0 + go.opentelemetry.io/otel/metric v1.17.0 + go.opentelemetry.io/otel/sdk v1.17.0 + go.opentelemetry.io/otel/sdk/metric v0.40.0 + go.opentelemetry.io/otel/trace v1.17.0 ) require ( @@ -24,7 +24,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus/procfs v0.7.3 // indirect go.elastic.co/fastjson v1.1.0 // indirect - golang.org/x/sys v0.8.0 // indirect + golang.org/x/sys v0.11.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect howett.net/plist v1.0.0 // indirect ) diff --git a/module/apmotel/go.sum b/module/apmotel/go.sum index e13262463..1a5240299 100644 --- a/module/apmotel/go.sum +++ b/module/apmotel/go.sum @@ -42,14 +42,24 @@ go.elastic.co/fastjson v1.1.0 h1:3MrGBWWVIxe/xvsbpghtkFoPciPhOCmjsR/HfwEeQR4= go.elastic.co/fastjson v1.1.0/go.mod h1:boNGISWMjQsUPy/t6yqt2/1Wx4YNPSe+mZjlyw9vKKI= go.opentelemetry.io/otel v1.16.0 h1:Z7GVAX/UkAXPKsy94IU+i6thsQS4nb7LviLpnaNeW8s= go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= +go.opentelemetry.io/otel v1.17.0 h1:MW+phZ6WZ5/uk2nd93ANk/6yJ+dVrvNWUjGhnnFU5jM= +go.opentelemetry.io/otel v1.17.0/go.mod h1:I2vmBGtFaODIVMBSTPVDlJSzBDNf93k60E6Ft0nyjo0= go.opentelemetry.io/otel/metric v1.16.0 h1:RbrpwVG1Hfv85LgnZ7+txXioPDoh6EdbZHo26Q3hqOo= go.opentelemetry.io/otel/metric v1.16.0/go.mod h1:QE47cpOmkwipPiefDwo2wDzwJrlfxxNYodqc4xnGCo4= +go.opentelemetry.io/otel/metric v1.17.0 h1:iG6LGVz5Gh+IuO0jmgvpTB6YVrCGngi8QGm+pMd8Pdc= +go.opentelemetry.io/otel/metric v1.17.0/go.mod h1:h4skoxdZI17AxwITdmdZjjYJQH5nzijUUjm+wtPph5o= go.opentelemetry.io/otel/sdk v1.16.0 h1:Z1Ok1YsijYL0CSJpHt4cS3wDDh7p572grzNrBMiMWgE= go.opentelemetry.io/otel/sdk v1.16.0/go.mod h1:tMsIuKXuuIWPBAOrH+eHtvhTL+SntFtXF9QD68aP6p4= +go.opentelemetry.io/otel/sdk v1.17.0 h1:FLN2X66Ke/k5Sg3V623Q7h7nt3cHXaW1FOvKKrW0IpE= +go.opentelemetry.io/otel/sdk v1.17.0/go.mod h1:U87sE0f5vQB7hwUoW98pW5Rz4ZDuCFBZFNUBlSgmDFQ= go.opentelemetry.io/otel/sdk/metric v0.39.0 h1:Kun8i1eYf48kHH83RucG93ffz0zGV1sh46FAScOTuDI= go.opentelemetry.io/otel/sdk/metric v0.39.0/go.mod h1:piDIRgjcK7u0HCL5pCA4e74qpK/jk3NiUoAHATVAmiI= +go.opentelemetry.io/otel/sdk/metric v0.40.0 h1:qOM29YaGcxipWjL5FzpyZDpCYrDREvX0mVlmXdOjCHU= +go.opentelemetry.io/otel/sdk/metric v0.40.0/go.mod h1:dWxHtdzdJvg+ciJUKLTKwrMe5P6Dv3FyDbh8UkfgkVs= go.opentelemetry.io/otel/trace v1.16.0 h1:8JRpaObFoW0pxuVPapkgH8UhHQj+bJW8jJsCZEu5MQs= go.opentelemetry.io/otel/trace v1.16.0/go.mod h1:Yt9vYq1SdNz3xdjZZK7wcXv1qv2pwLkqr2QVwea0ef0= +go.opentelemetry.io/otel/trace v1.17.0 h1:/SWhSRHmDPOImIAetP1QAeMnZYiQXrTy4fMMYOdSKWQ= +go.opentelemetry.io/otel/trace v1.17.0/go.mod h1:I/4vKTgFclIsXRVucpH25X0mpFSczM7aHeaz0ZBLWjY= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -67,6 +77,8 @@ golang.org/x/sys v0.0.0-20191025021431-6c3a3bfe00ae/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200509030707-2212a7e161a5/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= From 94a13c518e6a32b331b233383defb0285ad650d4 Mon Sep 17 00:00:00 2001 From: dmathieu Date: Tue, 29 Aug 2023 09:48:54 +0200 Subject: [PATCH 2/2] use metric.Aggregation instead of aggregation.Aggregation --- module/apmotel/gatherer_config.go | 5 ++--- module/apmotel/gatherer_config_test.go | 5 ++--- module/apmotel/gatherer_test.go | 3 +-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/module/apmotel/gatherer_config.go b/module/apmotel/gatherer_config.go index 9cea323ab..70ad4629b 100644 --- a/module/apmotel/gatherer_config.go +++ b/module/apmotel/gatherer_config.go @@ -19,7 +19,6 @@ package apmotel // import "go.elastic.co/apm/module/apmotel/v2" import ( "go.opentelemetry.io/otel/sdk/metric" - "go.opentelemetry.io/otel/sdk/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/metricdata" ) @@ -72,10 +71,10 @@ func WithAggregationSelector(agg metric.AggregationSelector) GathererOption { } } -func defaultAggregationSelector(ik metric.InstrumentKind) aggregation.Aggregation { +func defaultAggregationSelector(ik metric.InstrumentKind) metric.Aggregation { switch ik { case metric.InstrumentKindHistogram: - return aggregation.ExplicitBucketHistogram{ + return metric.AggregationExplicitBucketHistogram{ Boundaries: customHistogramBoundaries, NoMinMax: false, } diff --git a/module/apmotel/gatherer_config_test.go b/module/apmotel/gatherer_config_test.go index b6ef6284b..e7daf29c7 100644 --- a/module/apmotel/gatherer_config_test.go +++ b/module/apmotel/gatherer_config_test.go @@ -22,12 +22,11 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/otel/sdk/metric" - "go.opentelemetry.io/otel/sdk/metric/aggregation" "go.opentelemetry.io/otel/sdk/metric/metricdata" ) func TestNewGathererConfig(t *testing.T) { - aggregationSelector := func(metric.InstrumentKind) aggregation.Aggregation { return nil } + aggregationSelector := func(metric.InstrumentKind) metric.Aggregation { return nil } temporalitySelector := func(metric.InstrumentKind) metricdata.Temporality { return metricdata.CumulativeTemporality } testCases := []struct { @@ -68,7 +67,7 @@ func TestNewGathererConfig(t *testing.T) { } func TestConfigManualReaderOptions(t *testing.T) { - aggregationSelector := func(metric.InstrumentKind) aggregation.Aggregation { return nil } + aggregationSelector := func(metric.InstrumentKind) metric.Aggregation { return nil } temporalitySelector := func(metric.InstrumentKind) metricdata.Temporality { return metricdata.CumulativeTemporality } testCases := []struct { diff --git a/module/apmotel/gatherer_test.go b/module/apmotel/gatherer_test.go index d09af3fad..01b201d79 100644 --- a/module/apmotel/gatherer_test.go +++ b/module/apmotel/gatherer_test.go @@ -29,7 +29,6 @@ import ( "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" sdkmetric "go.opentelemetry.io/otel/sdk/metric" - "go.opentelemetry.io/otel/sdk/metric/aggregation" "go.elastic.co/apm/v2" "go.elastic.co/apm/v2/apmtest" @@ -245,7 +244,7 @@ func TestGathererWithCustomView(t *testing.T) { sdkmetric.WithReader(gatherer), sdkmetric.WithView(sdkmetric.NewView( sdkmetric.Instrument{Name: "*"}, - sdkmetric.Stream{Aggregation: aggregation.ExplicitBucketHistogram{ + sdkmetric.Stream{Aggregation: sdkmetric.AggregationExplicitBucketHistogram{ Boundaries: []float64{0, 5, 10, 25, 50, 75, 100, 250, 500, 1000}, }}, )),