]> git.kaiwu.me - haproxy.git/commit
MINOR: sample: add the "master_id" and "worker_id" sample fetches
authorWilly Tarreau <w@1wt.eu>
Tue, 15 Sep 2026 11:48:11 +0000 (13:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2026 16:00:51 +0000 (18:00 +0200)
commitcca6bb4bf6bb347e6237177ac9bb29052f6be9a7
tree2b81927a312fb8c1a8b1be7659effbbf4d3eb105
parent3639aac31f726a6195bba6dc16d4efb539452bd2
MINOR: sample: add the "master_id" and "worker_id" sample fetches

These two new sample fetch functions return the unique identifiers of the
master and of the current worker process, so that they can be placed in
logs, in response headers, or be used in any other expression.

The "master_id" one fails when there is no master, i.e. when not running
in master-worker mode, so that a log or a header will simply not report
anything there instead of an inaccurate value.

Note that these functions rely on internal storage, not environment
variables, so they are unaffected by "setenv" directives.
doc/configuration.txt
src/sample.c