From 8ae0fbb00e8de89046c5f58177d4563df18c8329 Mon Sep 17 00:00:00 2001 From: Sai Ram Kunala Date: Mon, 20 Jul 2020 16:50:21 +0530 Subject: [PATCH] fix syntax for haproxy X-Request-Start configuration source: https://stackoverflow.com/questions/31036893/how-do-i-add-x-request-start-in-haproxy/50060498#50060498 --- docs/deployment.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/deployment.md b/docs/deployment.md index c237f93080..bb12eb8c2e 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -66,7 +66,8 @@ thread to become available. * Have your upstream proxy set a header with the time it received the request: * nginx: `proxy_set_header X-Request-Start "${msec}";` - * haproxy: `http-request set-header X-Request-Start "%t";` + * haproxy >= 1.9: `http-request set-header X-Request-Start t=%[date()]%[date_us()]` + * haproxy < 1.9: `http-request set-header X-Request-Start t=%[date()]` * In your Rack middleware, determine the amount of time elapsed since `X-Request-Start`. * To improve accuracy, you will want to subtract time spent waiting for slow clients: * `env['puma.request_body_wait']` contains the number of milliseconds Puma spent