Skip to content

Commit 0fd7687

Browse files
feat: Set sampledToLocalTracing flag to true for all gRPC MethodDescriptors (#3874)
See b/416626151 for more information. Problem: When the sampledToLocalTracing is set to false or not set, the gRPC specific metrics have the `grpc.method` attribute defined as `other` instead of the methodDescriptor's full name. This may be confusing to customers who may expect to see the full gRPC method name. High Level: This flag enables captures for specific method names to help provide more detailed metrics. We do not expect any noticeable performance impact from this change. This does not impact the method name that is already properly captured for Gax Metrics (e.g. Attempt Count, Operation Latency, etc). Specifically, the use must be using grpc-java telemetry module and be using [GrpcOpenTelemetry](https://grpc.github.io/grpc-java/javadoc/io/grpc/opentelemetry/GrpcOpenTelemetry.html) instead of [OpenTelemetry](https://github.com/open-telemetry/opentelemetry-java/blob/main/api/all/src/main/java/io/opentelemetry/api/OpenTelemetry.java). --------- Co-authored-by: cloud-java-bot <cloud-java-bot@google.com>
1 parent dc7f230 commit 0fd7687

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub

java-showcase/gapic-showcase/src/main/java/com/google/showcase/v1beta1/stub/GrpcEchoStub.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ public class GrpcEchoStub extends EchoStub {
119119
ProtoUtils.marshaller(FailEchoWithDetailsRequest.getDefaultInstance()))
120120
.setResponseMarshaller(
121121
ProtoUtils.marshaller(FailEchoWithDetailsResponse.getDefaultInstance()))
122+
.setSampledToLocalTracing(true)
122123
.build();
123124

124125
private static final MethodDescriptor<ExpandRequest, EchoResponse> expandMethodDescriptor =

0 commit comments

Comments
 (0)