gapic-generator-java icon indicating copy to clipboard operation
gapic-generator-java copied to clipboard

Add "setSampledToLocalTracing" for Method Descriptor

Open surbhigarg92 opened this issue 8 months ago • 2 comments

Is your feature request related to a problem? Please describe. Customer is trying to use Spanner client and enabling gRPC OpenTelemetry Metrics. When trying to do so "Method" Attribute is always reported as "Other".

As per proposal A66 to get these methods to show up in metrics, setSampledToLocalTracing](https://github.com/grpc/grpc-java/blob/master/api/src/main/java/io/grpc/MethodDescriptor.java#L591) needs to set on the builder before registering the method.

Since the code for MethodDescriptor is autogenerated, generator should allow setting setSampledToLocalTracing

Describe the solution you'd like Add setSampledToLocalTracing to the MethodDescriptor autogenerated code.

surbhigarg92 avatar Mar 21 '25 06:03 surbhigarg92

Do you expect it to be always enabled in java-spanner? Or enabled on-demand?

blakeli0 avatar Mar 21 '25 18:03 blakeli0

@blakeli0 I believe it should be enable on-demand, as it will impact all Client using auto-generator, not only Spanne

surbhigarg92 avatar Mar 24 '25 06:03 surbhigarg92