otelconnect-go icon indicating copy to clipboard operation
otelconnect-go copied to clipboard

example doesn't work

Open domino14 opened this issue 1 year ago • 1 comments


	cs := myconsumer.NewConsumerServer()
	api := http.NewServeMux()
	api.Handle(myconsumerv1connect.NewMyServiceHandler(cs, connect.WithInterceptors(
		otelconnect.NewInterceptor())))

gives me the following error:

cannot use otelconnect.NewInterceptor() (value of type error) as connect.Interceptor value in argument to connect.WithInterceptors: error does not implement connect.Interceptor (missing method WrapStreamingClient)

domino14 avatar Mar 14 '24 16:03 domino14

Thanks for reporting. The example is out of date (will fix). You'll need to declare the interceptor on a new line:

	otelInterceptor, err := otelconnect.NewInterceptor()
	if err != nil {
		log.Fatal(err)
	}

See the godocs.

emcfarlane avatar Mar 18 '24 15:03 emcfarlane

Fixed by #176

emcfarlane avatar Oct 08 '24 21:10 emcfarlane