Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rely on the latest stable otel, not rc2 #1420

Merged
merged 4 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions module/apmotel/gatherer.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ func (e Gatherer) GatherMetrics(ctx context.Context, out *apm.Metrics) error {

for _, sm := range scopeMetrics.Metrics {
switch m := sm.Data.(type) {
case metricdata.Histogram[int64]:
addHistogramMetric(out, sm, m)
case metricdata.Histogram[float64]:
case metricdata.Histogram:
addHistogramMetric(out, sm, m)
case metricdata.Sum[int64]:
for _, dp := range m.DataPoints {
Expand All @@ -89,7 +87,7 @@ func (e Gatherer) GatherMetrics(ctx context.Context, out *apm.Metrics) error {
return nil
}

func addHistogramMetric[N int64 | float64](out *apm.Metrics, sm metricdata.Metrics, m metricdata.Histogram[N]) {
func addHistogramMetric(out *apm.Metrics, sm metricdata.Metrics, m metricdata.Histogram) {
for _, dp := range m.DataPoints {
if len(dp.BucketCounts) != len(dp.Bounds)+1 || len(dp.Bounds) == 0 {
continue
Expand Down
2 changes: 1 addition & 1 deletion module/apmotel/gatherer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/stretchr/testify/assert"

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
metric "go.opentelemetry.io/otel/metric"
sdkmetric "go.opentelemetry.io/otel/sdk/metric"
"go.opentelemetry.io/otel/sdk/metric/aggregation"

Expand Down
10 changes: 5 additions & 5 deletions module/apmotel/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ require (
github.com/stretchr/testify v1.8.2
go.elastic.co/apm/module/apmhttp/v2 v2.4.0
go.elastic.co/apm/v2 v2.4.0
go.opentelemetry.io/otel v1.15.0-rc.2
go.opentelemetry.io/otel/metric v1.15.0-rc.2
go.opentelemetry.io/otel/sdk/metric v0.38.0-rc.2
go.opentelemetry.io/otel/trace v1.15.0-rc.2
go.opentelemetry.io/otel v1.14.0
go.opentelemetry.io/otel/metric v0.37.0
go.opentelemetry.io/otel/sdk/metric v0.37.0
go.opentelemetry.io/otel/trace v1.14.0
)

require (
Expand All @@ -25,7 +25,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
go.opentelemetry.io/otel/sdk v1.15.0-rc.2 // indirect
go.opentelemetry.io/otel/sdk v1.14.0 // indirect
golang.org/x/mod v0.5.1 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/tools v0.1.9 // indirect
Expand Down
21 changes: 11 additions & 10 deletions module/apmotel/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
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.15.0-rc.2 h1:ujPMbp/CAdjMTF9E93fr6X2W7Ub2MulkQAmXcTaNkJI=
go.opentelemetry.io/otel v1.15.0-rc.2/go.mod h1:AMBt1VNvSP4KmoaUOQcTWUVj6Te4ZRmD/v3tu0vfytI=
go.opentelemetry.io/otel/metric v1.15.0-rc.2 h1:MA7asjRHRgVdbvqYLQozHkxViPFZJ21qzi9IOKZVTnQ=
go.opentelemetry.io/otel/metric v1.15.0-rc.2/go.mod h1:/e8iKMaajFDmOXPoQsFrtr+B3XADzJS+HHePsQh2gGs=
go.opentelemetry.io/otel/sdk v1.15.0-rc.2 h1:4t4aauPUWLswNEUXAi5s3X94/kg7+NQY+6CeR9F6nEk=
go.opentelemetry.io/otel/sdk v1.15.0-rc.2/go.mod h1:/dv7lLx8SqyUgUxQeFeUUGvHbl45K4dssbaYjj/ObTQ=
go.opentelemetry.io/otel/sdk/metric v0.38.0-rc.2 h1:0hZK6hT73+T5BNuFW6AsBwfARsgeThwAQ7JagJ1hbYE=
go.opentelemetry.io/otel/sdk/metric v0.38.0-rc.2/go.mod h1:GUyzM862531kqKgJkhS/LIeekJ652QyjN94dzN1zmgQ=
go.opentelemetry.io/otel/trace v1.15.0-rc.2 h1:LizBnU5zjqWkHUlZu0tC2k7qICXqPCJqoDlWdc07uw8=
go.opentelemetry.io/otel/trace v1.15.0-rc.2/go.mod h1:JBu+wEp/Ra+YOzZlvPjE6raGRlrUJE/R8aW7Wucsn/o=
go.opentelemetry.io/otel v1.14.0 h1:/79Huy8wbf5DnIPhemGB+zEPVwnN6fuQybr/SRXa6hM=
go.opentelemetry.io/otel v1.14.0/go.mod h1:o4buv+dJzx8rohcUeRmWUZhqupFvzWis188WlggnNeU=
go.opentelemetry.io/otel/metric v0.37.0 h1:pHDQuLQOZwYD+Km0eb657A25NaRzy0a+eLyKfDXedEs=
go.opentelemetry.io/otel/metric v0.37.0/go.mod h1:DmdaHfGt54iV6UKxsV9slj2bBRJcKC1B1uvDLIioc1s=
go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
go.opentelemetry.io/otel/sdk v1.14.0/go.mod h1:bwIC5TjrNG6QDCHNWvW4HLHtUQ4I+VQDsnjhvyZCALM=
go.opentelemetry.io/otel/sdk/metric v0.37.0 h1:haYBBtZZxiI3ROwSmkZnI+d0+AVzBWeviuYQDeBWosU=
go.opentelemetry.io/otel/sdk/metric v0.37.0/go.mod h1:mO2WV1AZKKwhwHTV3AKOoIEb9LbUaENZDuGUQd+j4A0=
go.opentelemetry.io/otel/trace v1.14.0 h1:wp2Mmvj41tDsyAJXiWDWpfNsOiIyd38fy85pyKcFq/M=
go.opentelemetry.io/otel/trace v1.14.0/go.mod h1:8avnQLK+CG77yNLUae4ea2JDQ6iT+gozhnZjy/rw9G8=
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/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
Expand Down Expand Up @@ -92,6 +92,7 @@ golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211102192858-4dd72447c267/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand Down
6 changes: 0 additions & 6 deletions scripts/genmod/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,6 @@ func updateModule(dir string, gomod *GoMod, modules map[string]*GoMod) error {
args = append(args, "-go", *goVersionFlag)
}
cmd := exec.Command("go", args...)
cmd.Env = append(os.Environ(), "GO111MODULE=on")
cmd.Env = append(cmd.Env, "GOPROXY=http://proxy.invalid", "GOSUMDB=sum.golang.org https://sum.golang.org")
Copy link
Member Author

@dmathieu dmathieu Apr 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to remove this, seemingly because of module version changes, which causes a download (before, the modules were in cache).
I'm not sure what the reasoning for GOPROXY is, and will merge to move forward. But I'm happy to rethink this also.

cmd.Stderr = os.Stderr
cmd.Dir = dir
if err := cmd.Run(); err != nil {
Expand Down Expand Up @@ -227,8 +225,6 @@ func checkModuleComplete(dir string, gomod *GoMod, modules map[string]*GoMod) er
// Check we can build the module's tests and its transitive dependencies
// without updating go.mod.
cmd = exec.Command("go", "test", "-c", "-mod=readonly", "-o", os.DevNull)
cmd.Env = append(os.Environ(), "GO111MODULE=on")
cmd.Env = append(cmd.Env, "GOPROXY=http://proxy.invalid", "GOSUMDB=sum.golang.org https://sum.golang.org")
cmd.Stderr = os.Stderr
cmd.Dir = gomod.dir
if err := cmd.Run(); err != nil {
Expand Down Expand Up @@ -291,8 +287,6 @@ func main() {}
if minorVersion > 16 {
cmd.Args = append(cmd.Args, "-go=1.16")
}
cmd.Env = append(os.Environ(), "GO111MODULE=on")
cmd.Env = append(cmd.Env, "GOPROXY=http://proxy.invalid", "GOSUMDB=sum.golang.org https://sum.golang.org")
cmd.Stderr = os.Stderr
cmd.Dir = tmpdir
if err := cmd.Run(); err != nil {
Expand Down