Project

General

Profile

Feature #12167

Updated by Tom Clegg over 6 years ago

h2. Background 

 When an arv-put process is slow or broken, it is useful to grep logs for related server-side activity. To make this easy, arv-put should generate a "request ID" at startup, and all components should propagate this ID to log files and other Arvados components. 

 h2. Specific improvements 

 * A request ID looks like "req-" + 20 random alphanum chars, e.g., @req-iNjNZUDqU35yxSXFYJ8x@ 
 * If running in --verbose mode, arv-put should log the request ID to stderr as soon as it's generated. 
 * Whether running in --verbose mode or not, arv-put should log the request ID in every error log. Presumably the easiest way to do this is to include it in _every_ log message, just like timestamp and PID. Thus, a failed arv-put will _always_ log its request ID, because every failure mode causes a log (make sure this is true even for SIGINT). 
 * Each keepstore/keepproxy/API request made by arv-put should include a request header like @X-Request-Id: req-iNjNZUDqU35yxSXFYJ8x@ (no ETag-esque quoting). 
 * When keepproxy receives an X-Request-Id request header, it should propagate include that same header when it makes keepstore/API requests in the course of servicing the incoming request instead of inventing its own. Keepproxy's request log request. It should also include whichever the header value in the corresponding request ID was used. Keepproxy's generated IDs should be updated to the above format. log. 
 * When keepstore receives an X-Request-Id request header, it should include the header value in the corresponding request log; otherwise it should generate a random one. log. 
 * When API server receives an X-Request-Id request header, it should include the header value in the corresponding request log; otherwise it should generate a random one. log. 

 Of course, incoming headers can be broken or malicious, so logs should use appropriate quoting. 

 h2. Related 

 * Workbench should include its request ID in an X-Request-Id header instead of a "current_request_id" query parameter. Workbench's generated IDs should also be updated to the above format. This way, API server will always log it. 

Back