Skip to content

Commit

Permalink
So, who specified the wrong versions? The problem here is that `v0.x.…
Browse files Browse the repository at this point in the history
…x` is "unstable", and as it specifieds a minimum version, that will include "any breaking change after".

try to fix go.opentelemetry.io dependency hell

docker ("indirect") and buildkit ("direct") specify `v0.29.0`;

```bash
go mod graph --modfile=vendor.mod | grep ' go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp'
github.com/docker/docker go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0
github.com/moby/buildkit@v0.11.4 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0
```

containerd specified v0.34.0 for `go.opentelemetry.io/otel/metric`;

```bash
go mod graph --modfile=vendor.mod | grep ' go.opentelemetry.io/otel/metric@'
github.com/docker/docker go.opentelemetry.io/otel/metric@v0.34.0
github.com/containerd/containerd@v1.7.0-rc.2 go.opentelemetry.io/otel/metric@v0.34.0
github.com/moby/buildkit@v0.11.4 go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc@v0.37.0 go.opentelemetry.io/otel/metric@v0.34.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0 go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/otel/internal/metric@v0.27.0 go.opentelemetry.io/otel/metric@v0.27.0
```

But BuildKit uses;

```bash
git checkout v0.11.4

go mod graph | grep ' go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp'
github.com/moby/buildkit go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0
k8s.io/apiserver@v0.22.5 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.20.0
k8s.io/component-base@v0.22.5 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.20.0
```

But looks like BuildKit has older versions of the other packages installed;

```bash
go mod graph | grep ' go.opentelemetry.io/otel/metric@'
github.com/moby/buildkit go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.29.0 go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/otel/internal/metric@v0.27.0 go.opentelemetry.io/otel/metric@v0.27.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel/exporters/otlp@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel/oteltest@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel/sdk/export/metric@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
go.opentelemetry.io/otel/sdk/metric@v0.20.0 go.opentelemetry.io/otel/metric@v0.20.0
```

Looks like `go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0` is the first version taking the new metrics into account;
https://github.com/open-telemetry/opentelemetry-go-contrib/blob/instrumentation/net/http/otelhttp/v0.31.0/instrumentation/net/http/otelhttp/handler.go#L52-L53

Changed in open-telemetry/opentelemetry-go-contrib@a587520 (open-telemetry/opentelemetry-go-contrib#1977)

Unfortunately, updating  these to v0.31.0 works around the other issues, but breaks BuildKit, which doesn't support the newer API;

    go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.31.0 // indirect // updated to v0.31+ to account for moby#44530 (comment)
    go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0 // indirect // updated v0.31+ to account for moby#44530 (comment)

```bash
Building static bundles/binary-daemon/dockerd (linux/arm64)...
vendor/github.com/moby/buildkit/util/tracing/transform/span.go:34:26: sd.InstrumentationLibrarySpans undefined (type *"github.com/docker/docker/vendor/go.opentelemetry.io/proto/otlp/trace/v1".ResourceSpans has no field or method InstrumentationLibrarySpans)
vendor/github.com/moby/buildkit/util/tracing/transform/span.go:56:17: undefined: v11.InstrumentationLibrary
vendor/github.com/moby/buildkit/util/tracing/transform/instrumentation.go:9:42: undefined: commonpb.InstrumentationLibrary
vendor/github.com/moby/buildkit/worker/containerd/containerd.go:56:74: cannot use &gogoptypes.Empty{} (value of type *"github.com/docker/docker/vendor/github.com/gogo/protobuf/types".Empty) as *emptypb.Empty value in argument to client.IntrospectionService().Server
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Mar 8, 2023
1 parent 3eedc19 commit b3bedf1
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 34 deletions.
4 changes: 2 additions & 2 deletions vendor.mod
Expand Up @@ -176,8 +176,8 @@ require (
go.etcd.io/etcd/server/v3 v3.5.6 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.37.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.29.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.31.0 // indirect // updated to v0.31+ to account for https://github.com/moby/moby/pull/44530#issuecomment-1460509785
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0 // indirect // updated v0.31+ to account for https://github.com/moby/moby/pull/44530#issuecomment-1460509785
go.opentelemetry.io/otel v1.12.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.12.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.12.0 // indirect
Expand Down
17 changes: 9 additions & 8 deletions vendor.sum
Expand Up @@ -1300,12 +1300,13 @@ go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.25.0/go.mod h1:E5NNboN0UqSAki0Atn9kVwaN7I+l25gGxDqBueo/74E=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.37.0 h1:+uFejS4DCfNH6d3xODVIGsdhzgzhh45p9gpbHQMbdZI=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.37.0/go.mod h1:HSmzQvagH8pS2/xrK7ScWsk0vAMtRTGbMFgInXCi8Tc=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.29.0 h1:Wjp9vsVSIEyvdiaECfqxY9xBqQ7JaSCGtvHgR4doXZk=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.29.0/go.mod h1:vHItvsnJtp7ES++nFLLFBzUWny7fJQSvTlxFcqQGUr4=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0 h1:SLme4Porm+UwX0DdHMxlwRt7FzPSE0sys81bet2o0pU=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0/go.mod h1:tLYsuf2v8fZreBVwp9gVMhefZlLFZaUiNVSq8QxXRII=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.31.0 h1:lBr/T645/1dty/uEdSeW0gXGn065B7ot0i0eYsHIHYU=
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.31.0/go.mod h1:UmlBhKeBJLuVUTKk6X5SX4/ce6tBvMDPZkEZoxGlVoM=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0 h1:woM+Mb4d0A+Dxa3rYPenSN5ZeS9qHUvE8rlObiLRXTY=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0/go.mod h1:PFmBsWbldL1kiWZk9+0LBZz2brhByaGsvp6pRICMlPE=
go.opentelemetry.io/otel v1.0.1/go.mod h1:OPEOD4jIT2SlZPMmwT6FqZz2C0ZNdQqiWcoK6M0SNFU=
go.opentelemetry.io/otel v1.4.0/go.mod h1:jeAqMFKy2uLIxCtKxoFj0FAL5zAPKQagc3+GtBWakzk=
go.opentelemetry.io/otel v1.6.0/go.mod h1:bfJD2DZVw0LBxghOTlgnlI0CV3hLDu9XF/QKOUXMTQQ=
go.opentelemetry.io/otel v1.6.1/go.mod h1:blzUabWHkX6LJewxvadmzafgh/wnvBSDBdOuwkAtrWQ=
go.opentelemetry.io/otel v1.12.0 h1:IgfC7kqQrRccIKuB7Cl+SRUmsKbEwSGPr0Eu+/ht1SQ=
go.opentelemetry.io/otel v1.12.0/go.mod h1:geaoz0L0r1BEOR81k7/n9W4TCXYCJ7bPO7K374jQHG0=
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.12.0 h1:UfDENi+LTcLjQ/JhaXimjlIgn7wWjwbEMmdREm2Gyng=
Expand All @@ -1318,15 +1319,15 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.12.0 h1:+tsVd
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.12.0/go.mod h1:jSqjV+Knu1Jyvh+l3fx7V210Ev3HHgNQAi8YqpXaQP8=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.12.0 h1:L23MzcHDznr05xOM1Ng1F98L0nVd7hm/S7y2jW9IRB4=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.12.0/go.mod h1:C+onYX2j5QH653b3wGJwowYr8jLMjBJw35QcaCQQK0U=
go.opentelemetry.io/otel/internal/metric v0.27.0/go.mod h1:n1CVxRqKqYZtqyTh9U/onvKapPGv7y/rpyOTI+LFNzw=
go.opentelemetry.io/otel/metric v0.27.0/go.mod h1:raXDJ7uP2/Jc0nVZWQjJtzoyssOYWu/+pjZqRzfvZ7g=
go.opentelemetry.io/otel/metric v0.28.0/go.mod h1:TrzsfQAmQaB1PDcdhBauLMk7nyyg9hm+GoQq/ekE9Iw=
go.opentelemetry.io/otel/metric v0.34.0 h1:MCPoQxcg/26EuuJwpYN1mZTeCYAUGx8ABxfW07YkjP8=
go.opentelemetry.io/otel/metric v0.34.0/go.mod h1:ZFuI4yQGNCupurTXCwkeD/zHBt+C2bR7bw5JqUm/AP8=
go.opentelemetry.io/otel/sdk v1.0.1/go.mod h1:HrdXne+BiwsOHYYkBE5ysIcv2bvdZstxzmCQhxTcZkI=
go.opentelemetry.io/otel/sdk v1.12.0 h1:8npliVYV7qc0t1FKdpU08eMnOjgPFMnriPhn0HH4q3o=
go.opentelemetry.io/otel/sdk v1.12.0/go.mod h1:WYcvtgquYvgODEvxOry5owO2y9MyciW7JqMz6cpXShE=
go.opentelemetry.io/otel/trace v1.0.1/go.mod h1:5g4i4fKLaX2BQpSBsxw8YYcgKpMMSW3x7ZTuYBr3sUk=
go.opentelemetry.io/otel/trace v1.4.0/go.mod h1:uc3eRsqDfWs9R7b92xbQbU42/eTNz4N+gLP8qJCi4aE=
go.opentelemetry.io/otel/trace v1.6.0/go.mod h1:qs7BrU5cZ8dXQHBGxHMOxwME/27YH2qEp4/+tZLLwJE=
go.opentelemetry.io/otel/trace v1.6.1/go.mod h1:RkFRM1m0puWIq10oxImnGEduNBzxiN7TXluRBtE+5j0=
go.opentelemetry.io/otel/trace v1.12.0 h1:p28in++7Kd0r2d8gSt931O57fdjUyWxkVbESuILAeUc=
go.opentelemetry.io/otel/trace v1.12.0/go.mod h1:pHlgBynn6s25qJ2szD+Bv+iwKJttjHSI3lUAyf0GNuQ=
go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/modules.txt
Expand Up @@ -1021,10 +1021,10 @@ go.opencensus.io/trace/tracestate
## explicit; go 1.18
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc/internal
# go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.29.0
# go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.31.0
## explicit; go 1.16
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace
# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.29.0
# go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0
## explicit; go 1.16
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp
# go.opentelemetry.io/otel v1.12.0
Expand Down

0 comments on commit b3bedf1

Please sign in to comment.