Skip to content

ALB: X-Amzn-Trace-Id header - can it be modified or removed, or supplemented with another header?

0

Hello lovely AWS community!

So, when using an ALB (Application Load Balancer), the ALB adds a header to the request before forwarding it to an origin server. The header is called X-Amzn-Trace-Id. It looks like this:

X-Amzn-Trace-Id: Root=1-67891233-abcdef012345678912345678

Source: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-request-tracing.html

There's a timestamp with one second granularity between the two "-" characters in the header value. I have some questions:

  1. Can the ALB be configured not to add this header at all?
  2. If it cannot be prevented, can the ALB be modified/configured to have different content?
  3. If it can be modified, can the ALB be configured to add this header but with more granularity in the timestamp?

For example, I would like to have the timestamp in DateTime.ticks format, which has microsecond granularity. And finally:

  1. If this header cannot be modified, can the ALB configured to add another header with the required timestamp?

I think this might be possible by adding an additional AWS component to modify the headers - I'm not sure which one - but I really don't want to do that. I just want to configure the ALB to do this itself.

Thanks in advance for your help, and have a lovely day!

1 Answer
0

Short answer to all of your question is "no".

What are you trying to do? Why do you need more granularity in the timestamp?

If you need additional headers you can add them in your back-end application.

AWS
EXPERT
answered a year ago
  • Thanks so much for replying! I really appreciate it!

    If the Short answer is "no", what's the long answer (i.e. why not), pretty please? Is it that there is no way to configure this aspect of ALB functionality at all?

    In answer to your question, I would like to know what time the requests reached the ALB with microsecond accuracy. That matters for my application. I feel confident that you would agree that I can't find that out by adding headers in my back-end application. Thanks again!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.