summaryrefslogtreecommitdiffstats
path: root/openstack/common/wsgi.py
diff options
context:
space:
mode:
authorAditi Raveesh <aditirav@thoughtworks.com>2013-05-14 15:33:14 +0530
committerAditi Raveesh <aditirav@thoughtworks.com>2013-05-15 15:50:19 +0530
commitdfb4e68e005e68a2e272f92c62fc8455712f293a (patch)
treef25b36f758c9a8725d7e5a014aa25bf7f3e99dbd /openstack/common/wsgi.py
parent3e0114f570d97c47b1b8eefce0bcd27146098b8d (diff)
downloadoslo-dfb4e68e005e68a2e272f92c62fc8455712f293a.tar.gz
oslo-dfb4e68e005e68a2e272f92c62fc8455712f293a.tar.xz
oslo-dfb4e68e005e68a2e272f92c62fc8455712f293a.zip
Add Middleware for correlation_id
The middleware generates the 'correlation_id' if it is not already present in the request header. This 'correlation_id' can be used to enable more effective debugging of requests that span multiple services. Implements: blueprint create-a-unified-correlation-id Change-Id: Ibc06a5b05b628e0b640e9299c79127ecbf9c684e
Diffstat (limited to 'openstack/common/wsgi.py')
-rw-r--r--openstack/common/wsgi.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/openstack/common/wsgi.py b/openstack/common/wsgi.py
index d184963..80d4b9b 100644
--- a/openstack/common/wsgi.py
+++ b/openstack/common/wsgi.py
@@ -172,6 +172,17 @@ class Middleware(object):
behavior.
"""
+ @classmethod
+ def factory(cls, global_conf, **local_conf):
+ """
+ Factory method for paste.deploy
+ """
+
+ def filter(app):
+ return cls(app)
+
+ return filter
+
def __init__(self, application):
self.application = application