Skip to content
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

Merged
merged 7 commits into from
Jan 18, 2023

Conversation

joshcarp
Copy link
Contributor

@joshcarp joshcarp commented Jan 16, 2023

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 plumming.

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

@joshcarp joshcarp force-pushed the feat/interceptor-only branch 2 times, most recently from 92e89a9 to cd2b681 Compare January 17, 2023 15:31
@joshcarp joshcarp force-pushed the feat/interceptor-only branch from cd2b681 to e162a92 Compare January 17, 2023 15:33
@joshcarp joshcarp marked this pull request as ready for review January 17, 2023 15:34
Copy link

@doriable doriable left a 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).

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Co-authored-by: Doria Keung <[email protected]>
Copy link
Member

@akshayjshah akshayjshah left a 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).

@joshcarp joshcarp changed the title Remove WithTelemetry option in favor of connect.WithInterceptors(otelconnect.New()) Remove WithTelemetry option in favor of connect.WithInterceptors(otelconnect.NewInterceptor()) Jan 18, 2023
@joshcarp joshcarp merged commit 967785f into main Jan 18, 2023
@joshcarp joshcarp deleted the feat/interceptor-only branch January 18, 2023 19:43
akshayjshah pushed a commit that referenced this pull request Jul 26, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decide on if WithTelemetry or NewInterceptor is going to be the api that's used before v1.0.0
3 participants