git-ecosystem / sample-trace2-otel-collector

A sample custom collector to contain trace2receiver and associated config and installer scripts
MIT License
10 stars 2 forks source link

Builder Fails Even With Matching Version #14

Closed hannahchiodo-msft closed 5 months ago

hannahchiodo-msft commented 5 months ago

We noticed this in our fork and replicated it with the sample-trace2-otel-collector. Even with the matching (v0.96.0) version of the builder, I run into a failure seemingly stemming from the trace2receiver component.

PS D:\sample-trace2-otel-collector> C:\Users\hannahchiodo\go\bin\builder.exe --config ./builder-config.yml   
2024-03-27T10:36:26.806-0700    INFO    internal/command.go:123 OpenTelemetry Collector Builder {"version": "", "date": "unknown"}
2024-03-27T10:36:26.813-0700    INFO    internal/command.go:159 Using config file       {"path": "./builder-config.yml"}
2024-03-27T10:36:26.816-0700    INFO    builder/config.go:109   Using go        {"go-executable": "C:\\Program Files\\Go\\bin\\go.exe"}
2024-03-27T10:36:26.819-0700    INFO    builder/main.go:91      Sources created {"path": "."}
2024-03-27T10:36:26.820-0700    INFO    builder/main.go:25      Running go subcommand.  {"arguments": ["get", "cloud.google.com/go"]}
2024-03-27T10:36:27.026-0700    INFO    builder/main.go:25      Running go subcommand.  {"arguments": ["mod", "tidy", "-compat=1.21"]}
2024-03-27T10:36:31.989-0700    INFO    builder/main.go:142     Getting go modules
2024-03-27T10:36:31.989-0700    INFO    builder/main.go:25      Running go subcommand.  {"arguments": ["mod", "download"]}
2024-03-27T10:36:32.084-0700    INFO    builder/main.go:102     Compiling
2024-03-27T10:36:32.084-0700    INFO    builder/main.go:25      Running go subcommand.  {"arguments": ["build", "-trimpath", "-o", "sample-trace2-otel-collector", "-ldflags=-s -w"]}
Error: failed to compile the OpenTelemetry Collector distribution: go subcommand failed with args '[build -trimpath -o sample-trace2-otel-collector -ldflags=-s -w]': exit status 1. Output:
# github.com/git-ecosystem/trace2receiver
C:\Users\hannahchiodo\go\pkg\mod\github.com\git-ecosystem\trace2receiver@v0.5.2\factory.go:36:3: cannot use typeStr (untyped string constant "trace2receiver") as component.Type value in argument to receiver.NewFactory
C:\Users\hannahchiodo\go\pkg\mod\github.com\git-ecosystem\trace2receiver@v0.5.2\platform_windows.go:22:25: undefined: component.ErrNilNextConsumer
jeffhostetler commented 5 months ago

Looks like there was an OTEL receiver API breakage around 0.96 or 0.97. I'll push a new version shortly.

jeffhostetler commented 5 months ago

@hannahchiodo-msft I've fixed the API breakage and updated both components and tags. Please give this a try.