我想测量完整请求堆栈的时间。中间件的 New Relic 捕获时间(例如 java、python、ruby)和请求时间(参见https://newrelic.com/docs/features/tracking-front-end-time)。为此,我需要X-Request-Start
在请求通过 HAProxy 负载平衡时配置标头。haproxy.cfg 应如下所示:
backend www
balance roundrobin
mode http
reqadd "X-Request-Start" UNKNOWN_TIME_FUNCTION()
server servername 192.168.0.1:80 weight 1 check
Run Code Online (Sandbox Code Playgroud)
有一个 haproxy 本机函数来替换UNKNOWN_TIME_FUNCTION()
?