Skip to content

Census: enable requestz sampling for generated methods  #3359

@zhangkun83

Description

@zhangkun83

Census has an open-source requestz implementation that can show traces of live, sampled and error RPCs. In order to sample RPCs, gRPC needs to call SampledSpanStore.registerSpanNamesForCollection() with any known method name. This is fairly expensive, thus should not be called on a per-RPC basis. A few options:

  1. In a static initializer in the generated code. If we don't want to call Census directly from the generated code, maybe call Census code in a helper function in ClientCalls and ServerCalls which is called from generated code.
  2. In MethodDescriptor constructor. This will be called once per method, which might slow start-up speed. This would also all custom-created methods to be registered, @bogdandrutu is this desirable, or do you only expect generated methods to be registered?

Option 1 sounds like a better option. @ejona86 WDYT?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions