dd-trace-java icon indicating copy to clipboard operation
dd-trace-java copied to clipboard

Ignore GPRC Health Checks

Open dev-66 opened this issue 4 years ago • 4 comments

Is there any way to prevent tracing for gRPC health checks (grpc.health.v1.Health/Check)?

dev-66 avatar Oct 06 '21 19:10 dev-66

#2482 lets you name specific outbound requests to ignore (see discussion in https://github.com/DataDog/dd-trace-java/issues/2467#issuecomment-796703608)

can be set as system property:

-Ddd.trace.grpc.ignored.outbound.methods=grpc.health.v1.Health/Check

or an environment variable:

DD_TRACE_GRPC_IGNORED_OUTBOUND_METHODS=grpc.health.v1.Health/Check

mcculls avatar Oct 06 '21 20:10 mcculls

If you want to ignore inbound requests then that would require further work, but along the same lines as #2482

mcculls avatar Oct 06 '21 20:10 mcculls

This is for inbound request. These traces are generated by calls from the grpc_health_probe. I also tried DD_APM_IGNORE_RESOURCES with no luck.

dev-66 avatar Oct 06 '21 20:10 dev-66

@mcculls Is it ok for me to contribute a PR (based on #2482) to address this issue? It would use DD_TRACE_GRPC_IGNORED_INBOUND_METHODS and modify TracingServerInterceptor.

dev-66 avatar Oct 15 '21 17:10 dev-66

@dev-66 are you still interested in contributing? If so, we'd be happy to accept it!

bm1549 avatar Nov 17 '23 21:11 bm1549