How to disable tracestate and traceparent headers

One of our services connects to a bank, and the requests are getting blocked because of these additional headers. Is there a way to disable them.

I tried setting the use_elastic_traceparent_header property to false, but the headers are still present in every API call.

Currently the request are made using spring rest client.

APM Agent Version: 1.28.1
Language : Java

Hi @e03c5fccb551b6833a65

Hmmm looking.

Yes that is not the correct setting, that just just add a header for backwards compatibility.

I thought there was a setting to stop the outbound headers...but I don't see it...

We will see if we get any other help.

@Eyal_Koren Any thoughts, I was asked recently about this as well...

Thank you for the reply. I hope there is some way.

There is no way to disable those at the moment.
It's easy to add such basic functionality, however I doubt that having the ability to completely disable trace context headers would be very useful. More likely this will be useful to be done only for specific destinations, and this is a bit more tricky to get right.

Harshith, what exactly would you want to be able to do? Is completely disabling the addition of outgoing headers useful in your case? This means that distributed tracing won't be supported for any outgoing communication from this service. Alternatively, what kind of destination information would be useful for you, for example - destination hostname? Something else?

1 Like

@Eyal_Koren The problem is that it's very hard to convince banks to accept these headers, mostly impossible. We don't use the distributed tracing functionality, so we would need some mechanism to disable these headers.

OK, let me discuss this with the team and get back to you.

Following up on this - we discussed this option.
What we are currently thinking is:

  • adding a boolean config to disable headers injection on all outgoing requests, which means losing the distributed tracing capability on all downstream services (not affecting the ability to connect the transaction of the configured service with the upstream parts of the trace)
  • we currently think that having the ability to configure something similar only for specific outgoing communication may be an overkill, so if this need arises, the workaround would be to set up a proxy that strips off unwanted headers where required

@stephenb you said you were recently asked about this, do think this would be useful?

2 Likes

@Eyal_Koren Yes I think this is a reasonable solution.

What I was asked about was the nearly identical to the use case the OP describes.

Thanks for confirming! :pray:
OK then, I will add such option and share here for testing.

@e03c5fccb551b6833a65 Please replace your current Java agent with this snapshot, add the new configuration option disable_outgoing_tracecontext_headers=true and let me know if this solved the issue for you.

3 Likes

Thank you so much for the quick support :pray: . The config is working as expected.

2 Likes

WOW What service from @Eyal_Koren!!!

Thanks @e03c5fccb551b6833a65 for your time, use case, and testing...

2 Likes

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.