Closed olivierboudet closed 2 years ago
We can certainly explore alternatives to calling a non-existent subscription, but I would also like to explore the option to tell OpenTelemetry not to trace this specific API call. Is there such a mechanism in OpenTelemetry? Maybe something like this would work?
Yes, spans can be ignored in OpenTelemetry with otel.integration.grpc.enabled
but it disable gRPC tracing completely (not just for health indicator)
Have you also looked into otel.trace.classes.exclude
?
I tried to set otel.trace.classes.exclude="com.google.cloud.pubsub.v1.stub.SubscriberStub"
and otel.trace.classes.exclude="com.google.cloud.pubsub.v1.stub.GrpcSubscriberStub"
but it does not exclude those traces.
Would you mind posting an issue in opentelemetry-java-instrumentation repo for this specific problem with exclusions? See: https://github.com/open-telemetry/opentelemetry-java-instrumentation/issues
Fixed in GoogleCloudPlatform/spring-cloud-gcp#330 -- custom subscription names are now supported.
Is your feature request related to a problem? Please describe. When using OpenTelemetry Java Instrumentation with spring-cloud-gcp, each call to /actuator/health is sampled because spans are marked as error (because my policy is to save all error traces).
In PubSubHealthIndicator, the check is done pulling a non-existent subscription (
this.pubSubTemplate.pull("subscription-" + UUID.randomUUID().toString(), 1, true);
) which logically throws anot found
error. So, OpenTelemetry gRPC instrumentation catch this error and mark the span as error.Describe the solution you'd like
Would it be possible to avoid to call a random subscription ?