opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

Builder should provide a more helpful error if you mismatch the module type

Open austinlparker opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. When using the collector builder, the error message when modules are mismatched isn't very helpful. For example, I tried to add an extension to the receiver section and got the following error:

Error: failed to compile the OpenTelemetry Collector distribution: go subcommand failed with args '[build -trimpath -o otelcol -ldflags=-s -w]': exit status 1, error message: # go.opentelemetry.io/collector/cmd/builder
./components.go:70:3: cannot use oauth2clientauthextension.NewFactory() (value of type extension.Factory) as receiver.Factory value in argument to receiver.MakeFactoryMap: extension.Factory does not implement receiver.Factory (missing method CreateLogsReceiver)
./components.go:71:3: cannot use oidcauthextension.NewFactory() (value of type extension.Factory) as receiver.Factory value in argument to receiver.MakeFactoryMap: extension.Factory does not implement receiver.Factory (missing method CreateLogsReceiver)

Describe the solution you'd like It'd be nice if we could infer what the module was supposed to be and tell you that you've put the wrong thing in the wrong place, or perhaps even tell you where it should go based on its interface.

austinlparker avatar May 14 '24 13:05 austinlparker