Middleware to ensure request ID for API response

Registered by Akihiro Motoki

According to the thread of request-id [1],
there seems a need for a wsgi middleware which generates request-id
for each REST request and ensures it in a corresponding response.
The middlware is located outer-most of a wsgi pipeline,
catches all kind of exceptions and ensures request-id in a response.
It is the concept swift already has as catch_error middleware.

The feature of the proposed middleware is simple:
  * Catch all exceptions in wsgi pipeline
  * Generate request-id for each REST request
  * Set the generated request-id to request environment
  * Add X-OpenStack-Request-Id header to API response to return request-id
  * Expected to place outer-most (i.e., first) in wsgi pipeline

The initial implemetation proposed to neutron is available at
https://review.openstack.org/#/c/58270/
(The name of middleware is not good....)

[1] http://lists.openstack.org/pipermail/openstack-dev/2013-November/thread.html#20683
[2] http://lists.openstack.org/pipermail/openstack-dev/2013-December/021422.html

Blueprint information

Status:
Complete
Approver:
Doug Hellmann
Priority:
Medium
Drafter:
Akihiro Motoki
Direction:
Approved
Assignee:
Akihiro Motoki
Definition:
Approved
Series goal:
Accepted for icehouse
Implementation:
Implemented
Milestone target:
milestone icon 2014.1
Started by
Akihiro Motoki
Completed by
Doug Hellmann

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/middleware-request-id,n,z

Addressed by: https://review.openstack.org/60786
    Middlelware to catch errors outmost and ensure request ID

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.