Page MenuHomePhabricator

Logstash should log varnish XID
Closed, DuplicatePublic

Description

When the backend dies and Varnish generates a nice error page, the footer will contain something like

If you report this error to the Wikimedia System Administrators, please include the details below.

Request from 1.2.3.4 via cp1066 cp1066, Varnish XID 12345678
Error: 500, Internal Server Error at Sat, 03 Mar 2018 19:19:49 GMT

which is not all that useful for tracking down the error (it's possible with the timestamp and IP, but cumbersome). It'd be nice to include the XID in the varnish logs (it's added to responses as X-Varnish, I presume to backend requests too).

Especially important for thumbnailing errors as those are the most frequent sources for this kind of error page.

Event Timeline

Tgr created this task.Mar 3 2018, 7:37 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 3 2018, 7:37 PM
Gilles added a subscriber: Gilles.Mar 14 2018, 8:14 AM

I don't think that's something that can be fixed generically across the board, as logstash entries will be emitted by various backends, which would each be responsible for adding the header they were given by Varnish to the log entries they record.

Actually, from what I can see on Vagrant, Varnish doesn't pass X-Varnish as part of the request to backends.