DataDog / dd-trace-java

Datadog APM client for Java
https://docs.datadoghq.com/tracing/languages/java
Apache License 2.0
580 stars 288 forks source link

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

Open milanaleksic opened 2 years ago

milanaleksic commented 2 years ago

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.

devinsba commented 2 years ago

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

milanaleksic commented 2 years ago

@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).

devinsba commented 2 years ago

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

milanaleksic commented 2 years ago

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