API: Add x-openstack-request-id header
Create a request identifier associated with an API request that crosses OpenStack service boundaries. This will enable more effective debugging of requests that span multiple services. This will first be done in nova; use oslo components where possible so this can be more easily rolled-out to other OpenStack services.
The new header will be introduced for API v3, and will replace x-compute-
Proposal:
- Upon receiving a request, use some middleware to generate a UUID to identify the request.
- This ID and the request ID of the other service will be logged at service boundaries. Create a module to provide a uniform way to the request ID mappings; the changes doing the actual logging will be covered by a future blueprint.
- The middleware used to generate the request ID will attach the x-openstack-
Blueprint information
- Status:
- Complete
- Approver:
- John Garbutt
- Priority:
- Medium
- Drafter:
- Brian Elliott
- Direction:
- Approved
- Assignee:
- Chris Buccella
- Definition:
- Approved
- Series goal:
- Accepted for juno
- Implementation:
- Implemented
- Milestone target:
- 2014.2
- Started by
- Russell Bryant
- Completed by
- Chris Buccella
Related branches
Related bugs
Sprints
Whiteboard
Feb. 10 Update:
We're narrowing the scope of this bp from what it was originally; this will now cover the preparation for logging request ID mappings in nova, but not the logging itself. There are a bunch of client changes that will be required, and those will be covered in a later blueprint. For now we just want to get the necessary middleware components and the x-openstack-
Discussion from the HK Summit:
https:/
Approving this for icehouse since we want to make this the default for v3 API. -- jogo (Feb 10, 2014)
Refinements from the ML:
http://
Summary:
Whenever a service makes a call to another service it logs with both the calling service request id and called service request id in the same log message. This should be a standard format across projects so it can be easily filtered. The request ID from each service will be sent in the x-openstack-
Additionally, there will be an oslo module to log the request ID mapping in a uniform format, which will be used in a future blueprint.
--Chris Buccella
---------------
Apologies, this missed the deadline for Feature Freeze. Please rebase patches as soon as Juno opens, and we will try to get this in during that period. --johnthetubaguy (5th March 2014)
Unapproved - please re-submit via nova-spec --johnthetubagy (20th March 2014)
Marking this blueprint as definition: Drafting. If you are still working on this, please re-submit via nova-specs.
Gerrit topic: https:/
Addressed by: https:/
Add x-openstack-
Approved, now nova-spec is approved. Looks to be ready for review, just needs a rebase. --johnthetubaguy
Merged Patches
==============
Addressed by: https:/
Sync request_id middleware from nova
Addressed by: https:/
Add x-openstack-
------
The change is for V3 only; V2 will not add the new header.
Work Items
Work items:
1.Create a common middleware in the oslo-incubator to set the request id in the request environment: DONE
2. Sync middleware from #1 into nova: DONE
3. Use middleware from #1: DONE