otelconnect-go
otelconnect-go copied to clipboard
example doesn't work
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)
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.
Fixed by #176