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

census: add interceptor APIs for configuring census features with custom settings on client side #7153

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

voidzcy
Copy link
Contributor

@voidzcy voidzcy commented Jun 23, 2020

Provides a ClientInterceptor in grpc-census that allow users to turn on/off census stats/tracing and customize stats collection settings.

The idea to disable the default census features in grpc-core is to pass a CallOption that turns the default census interceptors to NOOP, when the custom census interceptor is applied.

  • To mitigate the problem of stats/tracing with retry, retry is disabled at ClientCall's level. That is, the channel may still parse service config with retry configuration, but it will not be used by the call, which initiates the retry feature.
  • Testing is subtle, as default census features are applied in channel builder via reflection. Adding an internal API on AbstractManagedChannelImplBuilder to allow inserting an interceptor for testing purposes that will always be the closest to the network (aka, inserted to the front of default census interceptors). This allows tests to capture the effective set of CallOptions passed to the call. This API is only exposed in InProcessChannelBuilder, and it is made public via InternalInProcess accessor.
  • Tests for the custom census interceptor may look shabby, as it inspects the stats tracer's module to check the settings of recordStartedRpcs, recordFinishedRpcs and recordRealTimeMetrics, instead of firing up RPCs to verify its behaviors. But it turns out to be enough, as CensusModulesTest has a comprehensive set of test cases that verified the behaviors.

See discussions in #5624.

@voidzcy voidzcy marked this pull request as ready for review June 23, 2020 18:56
@voidzcy voidzcy force-pushed the impl/client_interceptors_for_custom_census_config branch from 2845bbc to 74f411c Compare June 24, 2020 06:58
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.

1 participant