Feature #10029

[Workbench] Send a request ID with each API request so it's visible in the API logs

Added by Tom Clegg over 4 years ago. Updated over 4 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
Workbench
Target version:
Start date:
09/13/2016
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
1.0

Description

The ID should be "timestamp-random" where timestamp is the UNIX epoch when the Workbench Rails server started processing its request and "random" is 9 random digits. This same ID should be included as a "client_session_id" param with every API call that gets made while working on that request.

It should be added to the params hash before real params, so it shows up reliably in the API logs, even params_truncated.

It should also be included as "client_session_id" in Workbench's own request log.


Subtasks

Task #10076: Review 10029-wb-send-request-idResolvedRadhika Chippada


Related issues

Related to Arvados - Story #12512: [Workbench] Implement X-Request-ID to enable request tracingResolved10/30/2017

Associated revisions

Revision 6dea18bd
Added by Lucas Di Pentima over 4 years ago

Merge branch '10029-wb-send-request-id'
Closes #10029

History

#1 Updated by Tom Clegg over 4 years ago

  • Subject changed from [Workbench] Send a request ID to each API request so it's visible in the API logs to [Workbench] Send a request ID with each API request so it's visible in the API logs

#2 Updated by Tom Clegg over 4 years ago

  • Description updated (diff)

#3 Updated by Tom Clegg over 4 years ago

  • Description updated (diff)

#4 Updated by Tom Morris over 4 years ago

  • Target version changed from Arvados Future Sprints to 2016-09-28 sprint

#5 Updated by Lucas Di Pentima over 4 years ago

  • Assigned To set to Lucas Di Pentima

#6 Updated by Lucas Di Pentima over 4 years ago

  • Status changed from New to In Progress

#7 Updated by Lucas Di Pentima over 4 years ago

78fedce

Added session_client_id on workbench's lograge and also on requests to the API server.

Complete tests being run at: https://ci.curoverse.com/job/developer-test-job/197/

#8 Updated by Radhika Chippada over 4 years ago

  • I am wondering if it would be better if we move set_client_session_id filter to come before other filters such as find_object_by_uuid
  • It appears that client_session_id is being sent even without the lograge update. Why do we need this?
  • Please unpyramid the lines in this test
       test "requesting to the API server includes client_session_id param" do
    -    use_token :active do
    +    use_token :active
    
  • Do we need to clear the client_session_id in thread_clear?
  • Nit: As a general practice, I prefer to add new stuff at the bottom of the file, or at an appropriate place to help preserve the flow of the file readability.

#9 Updated by Lucas Di Pentima over 4 years ago

Radhika Chippada wrote:

  • I am wondering if it would be better if we move set_client_session_id filter to come before other filters such as find_object_by_uuid

Changed as a prepend_before_filter as Tom requested.

  • It appears that client_session_id is being sent even without the lograge update. Why do we need this?

Yes, but the log line indicating the currect workbench request didn't include the request_id

  • Please unpyramid the lines in this test

Done

  • Do we need to clear the client_session_id in thread_clear?

Cleared after lograge uses it, thanks to Tom for that idea!

  • Nit: As a general practice, I prefer to add new stuff at the bottom of the file, or at an appropriate place to help preserve the flow of the file readability.

Updated!

Updates at: ff71d32

#10 Updated by Radhika Chippada over 4 years ago

LGTM

#11 Updated by Lucas Di Pentima over 4 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Applied in changeset arvados|commit:6dea18bd99022c09d51ef647482e080b4f316542.

Also available in: Atom PDF