[openstack-dev] Using thread local storage for correlation_id

Venkatesh Sampath venkatesh.sampath at outlook.com
Wed Jun 5 03:09:12 UTC 2013


The following are the blue prints available 

For Nova: https://blueprints.launchpad.net/nova/+spec/cross-service-request-id (with major part of the discussion)
For Glance: https://blueprints.launchpad.net/glance/+spec/use-unified-request-identifier (which I created it for implementing the correlation_id for glance)

P.S: Even though I proposed using RequestContext to hold the correlation_id in my blueprint. After going through the code base, I realized that RequestContext might not be available in for all the middleware's in the pipeline. Hence thought using TLS holding the correlation_id might be a better option.

Regards,
Venkatesh 


> Date: Tue, 4 Jun 2013 22:03:56 -0400
> From: rbryant at redhat.com
> To: openstack-dev at lists.openstack.org
> Subject: Re: [openstack-dev] Using thread local storage for correlation_id
> 
> On 06/04/2013 02:45 PM, Sandy Walsh wrote:
> > 
> > 
> > On 06/04/2013 02:24 PM, Venkatesh Sampath wrote:
> >> Hi Everyone,
> >>
> >> We are planning to introduce a correlation_id across for effective
> >> debugging of requests that span across services.
> >>
> >> The idea is to pass the correlation_id as part of the request header
> >> across services. The job of generating/capturing the correlation_id and
> >> setting it as part of the request header is done through the
> >> correlation_id.py middleware available through oslo incubator.
> > 
> > Why not use the existing Request ID? It's already stored in the Context
> > object.
> 
> Is there a document about this feature, including how it relates to the
> existing request ID, that we can all review?
> 
> 
> > 
> >>
> >> The services that uses the correlation_id middleware can in turn obtain
> >> the correlation_id from the request header and use it as part of logging
> >> & notification purposes.
> >>
> >> We are planning to make the correlation_id available for logging through
> >> thread local storage especially using the existing 'local.strong_store'
> >> reference. ( available from oslo-incubator/openstack/common/local.py).
> >> ie., by setting the correlation_id as attribute to 'local.strong_store'
> >> in the correlation_id middleware.
> >>
> >> Wish to know if its good idea to use the thread local storage from
> >> local.py for correlation_id so that it could be used by respective services.
> >>
> >> Thoughts?
> 
> 
> -- 
> Russell Bryant
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20130605/dadf7db3/attachment.html>


More information about the OpenStack-dev mailing list