[RFE] Ironic is missing a header X-Openstack-Request-Id in API response

Bug #1505119 reported by Tan Lin
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
Wishlist
Jim Rollenhagen
python-ironicclient
Invalid
Low
Unassigned

Bug Description

In order to track operations cross projects, many services like Nova/Glance/Neutron/Cinder/Keystone have a such header with HTTP responsed. You can get this header from above projects by calling corresponding client with debug option.
Ironic should support this.
Step one: Ironic should add this header to API respond
Step two: Python-Ironicclient should save this header and return to caller.

Oslo team is working on oslo-incubation/apiclient/base.py to better support step two. See https://review.openstack.org/#/c/156508/19/specs/return-request-id.rst

Tags: rfe-approved
Tan Lin (tan-lin-good)
Changed in ironic:
assignee: nobody → Tan Lin (tan-lin-good)
Dmitry Tantsur (divius)
Changed in ironic:
status: New → Triaged
importance: Undecided → Low
Changed in python-ironicclient:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Ruby Loo (rloo) wrote :

There is a BP: https://blueprints.launchpad.net/ironic/+spec/add-x-openstack-request-id-header to track this, so we don't need this bug. I'm going to mark this as invalid, if you think otherwise, change the status.

Changed in ironic:
status: Triaged → Invalid
Changed in python-ironicclient:
status: Triaged → Invalid
Vladyslav Drok (vdrok)
Changed in ironic:
status: Invalid → Confirmed
importance: Low → Wishlist
tags: added: rfe
summary: - Ironic is missing a header X-Openstack-Request-Id in API response
+ [RFE] Ironic is missing a header X-Openstack-Request-Id in API response
Revision history for this message
Vladyslav Drok (vdrok) wrote :

Copy of whiteboard contents:

Approving as the implementation should be simple, and the cross-project spec describes most of how this should work.
// jroll 2015-10-15

Addressed by: https://review.openstack.org/238008
    Add a new header 'x-openstack-request-id' to response

Gerrit topic: https://review.openstack.org/#q,topic:bp/add-x-openstack-request-id-header,n,z

Changed in ironic:
status: Confirmed → In Progress
Revision history for this message
Jim Rollenhagen (jim-rollenhagen) wrote :

Can we also be sure to put this request ID in every log? :)

Revision history for this message
Tan Lin (tan-lin-good) wrote :

ACK. Currently, Ironic log the request-id in some logs but not all, like async task(change_node_power_state) and periodic tasks (_sync_power_states). I will dig more to make it works.

Revision history for this message
Jim Rollenhagen (jim-rollenhagen) wrote :

@Tan, for async tasks this is due to the context not having the request ID; someone once taught me calling context.update_store() should pick that up.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

Fix proposed to branch: master
Review: https://review.openstack.org/284520

Revision history for this message
Tan Lin (tan-lin-good) wrote :

Thanks to pint this, Jim. It works :)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/284520
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=add1884959bf5fc630584ceaa23a4293b6bd7da5
Submitter: Jenkins
Branch: master

commit add1884959bf5fc630584ceaa23a4293b6bd7da5
Author: Lin Tan <email address hidden>
Date: Thu Feb 25 11:20:40 2016 +0800

    Add ensure_thread_contain_context() to task_manager

    For async/periodic tasks, the context of local thread is missing.
    Set it with request context and this is useful to log the request_id
    in log messages.

    Change-Id: I436bc0512fcf493424f14e12a17c69f686455a4c
    Partial-Bug:#1505119

Changed in ironic:
assignee: Tan Lin (tan-lin-good) → Jim Rollenhagen (jim-rollenhagen)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/238008
Committed: https://git.openstack.org/cgit/openstack/ironic/commit/?id=4bf707d86af1e7500f2ceaf55523a4ad8e69250b
Submitter: Jenkins
Branch: master

commit 4bf707d86af1e7500f2ceaf55523a4ad8e69250b
Author: Lin Tan <email address hidden>
Date: Wed Oct 21 19:56:12 2015 +0800

    Append 'Openstack-Request-Id' header to the response

    This patch will append request_id to response headers. This is helpful
    for admin to track problems across projects.

    Accroding to OpenStack HTTP Header Guidelines, use
    'Openstack-Request-Id' instead of 'X-Openstack-Request-ID'.

    According the suggestions from API WG, a microversion is not needed here.

    Change-Id: Ica067aff19fe17052fcaf9c7384c9da7d1f7997d
    Partial-Bug: #1505119

tags: added: rfe-approved
removed: rfe
Changed in ironic:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.