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

Can we disable injection of DD tracing headers for some requests?

Open milanaleksic opened this issue 3 years ago • 4 comments

Hi, I have a question related to the automatic injection of tracing headers.

I am using Apache HTTP client and I noticed trace agent automatically adds these headers:

X-Datadog-Parent-Id: 920498374318.......
X-Datadog-Sampling-Priority: 1
X-Datadog-Trace-Id: 1844094....

I would like to not have these injected for some requests, going to external parties. How can I achieve that?

I don't want to remove them from all places, mind you, just for this single particular HTTP client meant to be used with external services.

milanaleksic avatar Jul 29 '22 10:07 milanaleksic

@milanaleksic unfortunately this does not exist yet in the Java library. Would a list of http hosts to not send to work for you?

devinsba avatar Aug 01 '22 13:08 devinsba

@milanaleksic unfortunately this does not exist yet in the Java library. Would a list of http hosts to not send to work for you?

Hi @devinsba. It wouldn't help since the target hosts are unknown (our customers are free to enter target 3rd party systems to which these requests will be sent).

milanaleksic avatar Aug 01 '22 14:08 milanaleksic

Ok, good to know. Would a list of allowed hosts work? IE: only send the headers to listed hosts?

devinsba avatar Aug 01 '22 14:08 devinsba

Ok, good to know. Would a list of allowed hosts work? IE: only send the headers to listed hosts?

That would be good enough for sure! Thanks for considering

milanaleksic avatar Aug 09 '22 08:08 milanaleksic