We currently add a unique-id and use it to see a request flow through our backend servers.
Our backend servers will soon communicate also via the haproxy. All should use only one unique-id.
We tested and haproxy adds a new unique-id. This should be avoided.
Would it be possible to add this header only if not yet present?
More simple in fact, unique-id-format pre-dated the set-header rules. Now you don’t need it at all and “http-request set-header” is perfectly fine as a placement. Let’s simply consider that unique-id-format is unconditional while you have the choice with set-header.
The id is logged, but the header is not set. If I replace %ID with a hardcoded string, like “HELLO” it works, I can also other log variables – like %Ts. I can also get rid of the unique-id-format parameter and just pass its parameters to my set-header directive. But then I run into odd logging issues. Is there a recommended way to set a distinct request ID via set-header?