-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove WithTelemetry option in favor of connect.WithInterceptors(otelconnect.NewInterceptor()) #60
Conversation
92e89a9
to
cd2b681
Compare
cd2b681
to
e162a92
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me, left some nits for the README.
I'm also generally onboard with New
, although I have a slight preference for NewInterceptor
(but no strong opinions, happy with either).
Co-authored-by: Doria Keung <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two suggestions:
- If Doria leans toward
NewInterceptor
, that's fine with me - let's change. - Let's export an
otelconnect.Interceptor
struct, and have the exported constructor return an*Interceptor
. In general, let's return concrete types instead of interfaces (with the exception of constructors for functional options).
The only use case we have of using this package is using a number of Interceptors instead of just the `WithTelemetry` option. It's anticipated that if a project is using connect-opentelemetry-go the chances are that it's probably also using other interceptors. In that case it makes sense to expose a `New` function that returns an `type interceptor struct` that can be plugged into the existing interceptor plumbing. The only difference this makes to existing projects that are using `WithTelemetry` is that they now need to use `connect.WithInterceptor(otelconnect.New())` Fixes: https://github.com/bufbuild/connect-opentelemetry-go/issues/21
The only use case we have of using this package is using a number of Interceptors instead of just the
WithTelemetry
option. It's anticipated that if a project is using connect-opentelemetry-go the chances are that it's probably also using other interceptors. In that case it makes sense to expose aNew
function that returns antype interceptor struct
that can be plugged into the existing interceptor plumming.The only difference this makes to existing projects that are using
WithTelemetry
is that they now need to useconnect.WithInterceptor(otelconnect.New())
Fixes: https://github.com/bufbuild/connect-opentelemetry-go/issues/21