[openstack-dev] [cross-project]How to make use of x-openstack-request-id

Tan, Lin lin.tan at intel.com
Fri Jan 22 07:04:01 UTC 2016


Thanks Kebane, I test glance/neutron/keystone with ``x-openstack-request-id`` and find something interesting.

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.
Here is my test:
http://paste.openstack.org/show/484644/

It looks like because keystone and neutron are using oslo_middleware:RequestId.factory and in this part:
https://github.com/openstack/oslo.middleware/blob/master/oslo_middleware/request_id.py#L35
It will always generate an UUID and append to response as ``x-openstack-request-id`` header.

My question is should we accept an external passed request-id as the project's own request-id or having its unique request-id?
In other words, which one is correct way, glance or neutron/keystone? There must be something wrong with one of them.

Thanks

B.R

Tan

From: Kekane, Abhishek [mailto:Abhishek.Kekane at nttdata.com]
Sent: Wednesday, December 2, 2015 2:24 PM
To: OpenStack Development Mailing List (openstack-dev at lists.openstack.org)
Subject: Re: [openstack-dev] [nova][glance][cinder][neutron]How to make use of x-openstack-request-id


Hi Tan,



Most of the OpenStack RESTful API returns `X-Openstack-Request-Id` in the API response header but this request id is not available to the caller from the python client.

When you use --debug option from command from the command prompt using client, you can see `X-Openstack-Request-Id` on the console but it is not logged anywhere.



Currently a cross-project specs [1] is submitted and approved for returning X-Openstack-Request-Id to the caller and the implementation for the same is in progress.

Please go through the specs for detail information which will help you to understand more about request-ids and current work about the same.



Please feel free to revert back anytime for your doubts.



[1] https://github.com/openstack/openstack-specs/blob/master/specs/return-request-id.rst



Thanks,



Abhishek Kekane









Hi guys

        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.



First I read the spec: https://blueprints.launchpad.net/nova/+spec/cross-service-request-id 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.



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.



This totally confused me. It would be great if you can correct me or point me some reference. Thanks a lot



Best Regards,



Tan


______________________________________________________________________
Disclaimer: This email and any attachments are sent in strictest confidence
for the sole use of the addressee and may contain legally privileged,
confidential, and proprietary data. If you are not the intended recipient,
please advise the sender by replying promptly to this email and then delete
and destroy this email and any attachments without any further use, copying
or forwarding.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20160122/11e7bf0f/attachment.html>


More information about the OpenStack-dev mailing list