-
Notifications
You must be signed in to change notification settings - Fork 3.9k
census: expose client interceptors #12050
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
base: master
Are you sure you want to change the base?
Conversation
/** | ||
* Returns a {@link ServerStreamTracer.Factory} with default stats implementation. | ||
*/ | ||
public static ServerStreamTracer.Factory getServerStreamTracerFactory( |
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.
These boolean arguments were for internal and for testing. The lots-of-args version was for unit testing the class. Let's only have a zero-argument version at this time. Ditto for client-side.
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.
But wouldn't a no arg version restrict the user to not be able to configure it according to their needs ?
Also, I do see the relevant args in ManagedChannelImplBuilder...
* @param serverStreamTracerFactory the server stream tracer factory to configure | ||
*/ | ||
public static void configureServerBuilder(ServerBuilder<?> serverBuilder, | ||
ServerStreamTracer.Factory serverStreamTracerFactory) { |
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.
ServerStreamTracer.Factory
itself is unstable API, so having the user pass in the factory doesn't help at all; they could just call addStreamTracerFactory()
directly at that point. Instead, we'll want this method to create+add the factory, so the user never sees the factory.
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.
Understood. I initially included it as an argument because I was exposing two different versions of ServerStreamTracer.Factory, and I wanted to give users the flexibility to choose which one they needed. But I see your point—if the API itself is unstable, it's better to encapsulate the factory creation and registration so that users don't interact with it directly. I'll revise the method to handle that internally.
/** | ||
* Returns a {@link ServerStreamTracer.Factory} with default stats implementation. | ||
*/ | ||
public static ServerStreamTracer.Factory getServerStreamTracerFactory( |
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.
We need to make clear what is stats and what is tracing.
import io.opencensus.tags.propagation.TagContextBinarySerializer; | ||
import io.opencensus.trace.Tracing; | ||
|
||
public final class GrpcCensus { |
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.
Javadoc
import io.opencensus.tags.propagation.TagContextBinarySerializer; | ||
import io.opencensus.trace.Tracing; | ||
|
||
public final class GrpcCensus { |
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.
Add private constructor to prevent construction.
No description provided.