Project

General

Profile

Actions

Feature #12167

closed

[SDKs] [API] [keepstore] [keepproxy] Facilitate request tracing for all services

Added by Nico César over 6 years ago. Updated over 5 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Story points:
1.0
Release:
Release relationship:
Auto

Description

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.

Specific improvements

  • A request ID looks like "req-" + 20 random alphanum chars, e.g., req-iNjNZUDqU35yxSXFYJ8x
  • (Done) 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).
  • (Done) Each keepstore/keepproxy/API request made by arv-put should include a request header like X-Request-Id: req-iNjNZUDqU35yxSXFYJ8x (no ETag-esque quoting).
  • (Done) When keepproxy receives an X-Request-Id request header, it should propagate that same header when it makes keepstore requests in the course of servicing the incoming request instead of inventing its own. Keepproxy's request log should include whichever request ID was used. Keepproxy's generated IDs should be updated to the above format.
  • keepproxy should also send the X-Request-Id when making API requests.
  • (Done) 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.
  • (Done) 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.
  • (Done) Workbench should include its request ID in an X-Request-Id header instead of a "current_request_id" query parameter. (Current code tries to do this, but it doesn't work. Rails middleware is probably overwriting it.)
  • (Done) Workbench's generated IDs should also be updated to the above format.
  • (Done) When Workbench receives an X-Request-Id request header, it should use that header value instead of generating a new request ID.
  • keep-web, too.

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


Subtasks 6 (0 open6 closed)

Task #12493: Review 12167-workbench-request-idResolvedTom Clegg08/24/2017Actions
Task #12544: Tracing for keepstore, keepproxy, Go & Python SDKsResolvedTom Clegg08/24/2017Actions
Task #12579: Review 12167-keep-request-idResolvedTom Clegg08/24/2017Actions
Task #12777: Review 12167-python-request-idResolvedTom Clegg08/24/2017Actions
Task #13227: Review 12167-arvput-log-on-signalsResolvedTom Clegg08/24/2017Actions
Task #13396: Review 12167-go-request-idResolvedTom Clegg08/24/2017Actions

Related issues

Related to Arvados - Idea #12512: [Workbench] Implement X-Request-ID to enable request tracingResolvedTom Clegg10/30/2017Actions
Related to Arvados - Idea #13147: [arv-put] Add request ID to requests for tracabilityResolvedLucas Di Pentima03/06/2018Actions
Actions

Also available in: Atom PDF