From dfb4e68e005e68a2e272f92c62fc8455712f293a Mon Sep 17 00:00:00 2001 From: Aditi Raveesh Date: Tue, 14 May 2013 15:33:14 +0530 Subject: 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 --- openstack/common/wsgi.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'openstack/common/wsgi.py') 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 -- cgit