<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";
mso-fareast-language:EN-IN;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.typ
{mso-style-name:typ;}
span.pln
{mso-style-name:pln;}
span.str
{mso-style-name:str;}
span.kwd
{mso-style-name:kwd;}
span.pun
{mso-style-name:pun;}
span.EmailStyle25
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle26
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:353501186;
mso-list-type:hybrid;
mso-list-template-ids:-1396792010 1565838290 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
{mso-level-start-at:0;
mso-level-number-format:bullet;
mso-level-text:-;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-font-family:Calibri;
mso-bidi-font-family:"Times New Roman";}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:\F0B7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:\F0A7;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi Tan,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">While the cross project spec was discussed Glance already had implementation of request ids in place. At the time of the Glance implementation we assumed that one request id is desired through the chain of services
and we implemented the req id to be accepted as part of the request. This was mainly driven to have same request id through the chain between glance-api and glance-registry but as the same code was used in both api and registry services we got this functionality
across glance.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">The cross project discussion turned this approach down and decided that only new req id will be returned. We did not want to utilize 2 different code bases to handle req ids in glance-api and glance-registry,
nor we wanted to remove the functionality to allow the req ids being passed to the service as that was already merged to our API. Thus is requests are passed without req id defined to the services they behave (apart from nova having different header name)
same way, but with glance the request maker has the liberty to specify request id they want to use (within configured length limits).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Hopefully that clarifies it for you.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="color:#1F497D"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="color:#1F497D">Erno<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>From:</b> Tan, Lin [mailto:lin.tan@intel.com] <br>
<b>Sent:</b> 26 January 2016 01:26<br>
<b>To:</b> OpenStack Development Mailing List (not for usage questions)<br>
<b>Subject:</b> Re: [openstack-dev] [nova][glance][cinder][neutron]How to make use of x-openstack-request-id<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN">Thanks Kebane, I test glance/neutron/keystone with ``x-openstack-request-id`` and find something interesting.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN">I am able to pass ``x-openstack-request-id`` to glance and it will use the UUID as its request-id. But it failed with neutron and keystone.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN">Here is my test:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN"><a href="http://paste.openstack.org/show/484644/">http://paste.openstack.org/show/484644/</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN">It looks like because keystone and neutron are using oslo_middleware:RequestId.factory and in this part:<o:p></o:p></span></p>
<p class="MsoNormal"><a href="https://github.com/openstack/oslo.middleware/blob/master/oslo_middleware/request_id.py#L35"><span style="color:#1F497D;mso-fareast-language:ZH-CN;text-decoration:none">https://github.com/openstack/oslo.middleware/blob/master/oslo_middleware/request_id.py#L35</span></a><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN">It will always generate an UUID and append to response as ``x-openstack-request-id`` header.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN">My question is should we accept an external passed request-id as the project’s own request-id or having its unique request-id?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN">In other words, which one is correct way, glance or neutron/keystone? There must be something wrong with one of them.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN">B.R<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN">Tan<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN"><o:p> </o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"></a><span style="font-size:10.5pt;color:#1F497D;mso-fareast-language:ZH-CN"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><a name="_____replyseparator"></a><b><span style="mso-fareast-language:ZH-CN">From:</span></b><span style="mso-fareast-language:ZH-CN"> Kekane, Abhishek [<a href="mailto:Abhishek.Kekane@nttdata.com">mailto:Abhishek.Kekane@nttdata.com</a>]
<br>
<b>Sent:</b> Wednesday, December 2, 2015 2:24 PM<br>
<b>To:</b> OpenStack Development Mailing List (<a href="mailto:openstack-dev@lists.openstack.org">openstack-dev@lists.openstack.org</a>)<br>
<b>Subject:</b> Re: [openstack-dev] [nova][glance][cinder][neutron]How to make use of x-openstack-request-id<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-bottom:solid windowtext 1.0pt;padding:0cm 0cm 1.0pt 0cm">
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN">Hi Tan,<o:p></o:p></span></pre>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN"><o:p> </o:p></span></pre>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN">Most of the OpenStack RESTful API returns `X-Openstack-Request-Id` in the API <span class="pln">response header but </span><span class="kwd">this</span><span class="pln"> request id </span><span class="kwd">is</span><span class="pln"> </span><span class="kwd">not</span><span class="pln"> available to the </span><span class="kwd">caller</span><span class="pln"> </span><span class="kwd">from</span><span class="pln"> the python client</span><span class="pun">.</span></span><span class="pun"><o:p></o:p></span></pre>
<pre><span class="pun"><span lang="EN-IN" style="mso-fareast-language:ZH-CN">When you use -–debug option from command from the command prompt using client, you can see </span></span><span class="str"><span lang="EN-IN" style="mso-fareast-language:ZH-CN">`X-Openstack-Request-Id`</span></span><span class="pln"><span lang="EN-IN" style="mso-fareast-language:ZH-CN"> on the console but it is not logged anywhere.</span><o:p></o:p></span></pre>
<pre><span class="pln"><span lang="EN-IN" style="mso-fareast-language:ZH-CN"><o:p> </o:p></span></span></pre>
<pre><span class="pln"><span lang="EN-IN" style="mso-fareast-language:ZH-CN">Currently a cross-project specs [1] is submitted and approved for returning </span></span><span class="str"><span lang="EN-IN" style="mso-fareast-language:ZH-CN">X-Openstack-Request-Id to the caller and the implementation for the same is in progress.</span><o:p></o:p></span></pre>
<pre><span class="str"><span lang="EN-IN" style="mso-fareast-language:ZH-CN">Please go through the specs for detail information which will help you to understand more about request-ids and current work about the same.<o:p></o:p></span></span></pre>
<pre><span class="str"><span lang="EN-IN" style="mso-fareast-language:ZH-CN"><o:p> </o:p></span></span></pre>
<pre><span class="str"><span lang="EN-IN" style="mso-fareast-language:ZH-CN">Please feel free to revert back anytime for your doubts.<o:p></o:p></span></span></pre>
<pre><span class="str"><span lang="EN-IN" style="mso-fareast-language:ZH-CN"><o:p> </o:p></span></span></pre>
<pre><span class="str"><span lang="EN-IN" style="mso-fareast-language:ZH-CN">[1] <a href="https://github.com/openstack/openstack-specs/blob/master/specs/return-request-id.rst">https://github.com/openstack/openstack-specs/blob/master/specs/return-request-id.rst</a><o:p></o:p></span></span></pre>
<pre><span class="str"><span lang="EN-IN" style="mso-fareast-language:ZH-CN"><o:p> </o:p></span></span></pre>
<pre><span class="str"><span lang="EN-IN" style="mso-fareast-language:ZH-CN">Thanks,<o:p></o:p></span></span></pre>
<pre><span class="str"><span lang="EN-IN" style="mso-fareast-language:ZH-CN"><o:p> </o:p></span></span></pre>
<pre><span class="str"><span lang="EN-IN" style="mso-fareast-language:ZH-CN">Abhishek Kekane<o:p></o:p></span></span></pre>
<pre><span class="str"><span lang="EN-IN" style="mso-fareast-language:ZH-CN"><o:p> </o:p></span></span></pre>
<pre><span class="str"><span lang="EN-IN" style="mso-fareast-language:ZH-CN"><o:p> </o:p></span></span></pre>
<pre><o:p> </o:p></pre>
</div>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN"><o:p> </o:p></span></pre>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN">Hi guys<o:p></o:p></span></pre>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN"> I recently play around with 'x-openstack-request-id' header but have a dump question about how it works. At beginning, I thought an action across different services should use a same request-id but it looks like this is not the true. <o:p></o:p></span></pre>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN"><o:p> </o:p></span></pre>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN">First I read the spec: <a href="https://blueprints.launchpad.net/nova/+spec/cross-service-request-id">https://blueprints.launchpad.net/nova/+spec/cross-service-request-id</a> which said "This ID and the request ID of the other service will be logged at service boundaries". and I see cinder/neutron/glance will attach its context's request-id as the value of "x-openstack-request-id" header to its response while nova use X-Compute-Request-Id. This is easy to understand. So It looks like each service should generate its own request-id and attach to its response, that's all.<o:p></o:p></span></pre>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN"><o:p> </o:p></span></pre>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN">But then I see glance read 'X-Openstack-Request-ID' to generate the request-id while cinder/neutron/nova read 'openstack.request_id' when using with keystone. It is try to reuse the request-id from keystone.<o:p></o:p></span></pre>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN"><o:p> </o:p></span></pre>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN">This totally confused me. It would be great if you can correct me or point me some reference. Thanks a lot<o:p></o:p></span></pre>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN"><o:p> </o:p></span></pre>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN">Best Regards,<o:p></o:p></span></pre>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN"><o:p> </o:p></span></pre>
<pre><span lang="EN-IN" style="mso-fareast-language:ZH-CN">Tan<o:p></o:p></span></pre>
<p class="MsoNormal"><span lang="EN-IN"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-IN" style="font-size:12.0pt;font-family:"Times New Roman",serif;mso-fareast-language:ZH-CN"><br>
______________________________________________________________________<br>
Disclaimer: This email and any attachments are sent in strictest confidence<br>
for the sole use of the addressee and may contain legally privileged,<br>
confidential, and proprietary data. If you are not the intended recipient,<br>
please advise the sender by replying promptly to this email and then delete<br>
and destroy this email and any attachments without any further use, copying<br>
or forwarding.<o:p></o:p></span></p>
</div>
</div>
</body>
</html>