neutron doesn't use request-ids

Bug #1239923 reported by Joe Gordon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Akihiro Motoki

Bug Description

Just like nova and cinder, neutron should use request-ids for logging and to return to users.

request-ids are used to help look up the logs for a specific request.

Also they make logs more usable. Here is an example of how they can be used. http://git.openstack.org/cgit/openstack/oslo-incubator/tree/openstack/common/context.py

etc/cinder/cinder.conf.sample:#logging_context_format_string=%(asctime)s.%(msecs)03d %(process)d %(levelname)s %(name)s [%(request_id)s %(user)s %(

Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

looks legit to me.
I'm marking this as low-hanging-fruit.

Changed in neutron:
importance: Undecided → Medium
status: New → Confirmed
tags: added: low-hanging-fruit neutron-core
Revision history for this message
Akihiro Motoki (amotoki) wrote :

I was requested the same from my colleague and have the local fix.
While it needs some more clean up the context class and sync with openstack.common.context, i will take it.

Changed in neutron:
assignee: nobody → Akihiro Motoki (amotoki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

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

Changed in neutron:
status: Confirmed → In Progress
Revision history for this message
Maru Newby (maru) wrote :

I've added tempest as an affected project on the bug so that we can track the request ids returned from the server and be able to correlate tempest actions with the server logs for debugging errors.

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

Reviewed: https://review.openstack.org/52128
Committed: http://github.com/openstack/neutron/commit/78836be994d172e7b5f64333144bf5e1f8bd0436
Submitter: Jenkins
Branch: master

commit 78836be994d172e7b5f64333144bf5e1f8bd0436
Author: Akihiro MOTOKI <email address hidden>
Date: Wed Oct 16 19:43:10 2013 +0900

    Add request-id to log messages

    request-id needs to be stored in thread local store to allow
    openstack.common.log use request-id.
    tenant_name and user_name are added to the context so that
    they can be logged by customizing the log format.

    Also replaces 'cxt' with 'ctx' in test_neutron_context.py.
    Previously both 'ctx' and 'cxt' are used mixed in one file.

    Change-Id: Ib921585e648e92491c1366bc0ad26a6ae71e2fc9
    Partial-Bug: #1239923

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

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

Akihiro Motoki (amotoki)
Changed in neutron:
milestone: none → icehouse-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in neutron:
assignee: Akihiro Motoki (amotoki) → Maru Newby (maru)
Maru Newby (maru)
Changed in neutron:
assignee: Maru Newby (maru) → Akihiro Motoki (amotoki)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to neutron (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/58692

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to neutron (master)

Reviewed: https://review.openstack.org/58348
Committed: http://github.com/openstack/neutron/commit/4fd4d490ac1e12b2bf835949447d21b64c641616
Submitter: Jenkins
Branch: master

commit 4fd4d490ac1e12b2bf835949447d21b64c641616
Author: Maru Newby <email address hidden>
Date: Mon Nov 25 17:35:54 2013 +0000

    Fix format errors seen in rpc logging

    The previous commit for this bug didn't include the 'project_name'
    key in the context dict. The missing key was causing the amqp
    module to generate log formatting exceptions instead of normal
    log output.

    Separately, the context module itself was generating logging
    exceptions in the quantum service when logging was attempted
    before the context was fully initialized

    Change-Id: I0f4c6f5a6804442932c9b2bd409a258cfc2419ff
    Closes-Bug: #1254530
    Related-Bug: #1239923

Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-1 → icehouse-2
Revision history for this message
Sean Dague (sdague) wrote :

not a tempest bug

no longer affects: tempest
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-2 → icehouse-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/58270
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=048faa57037d30c46205dd3dedec45fea62ef2b1
Submitter: Jenkins
Branch: master

commit 048faa57037d30c46205dd3dedec45fea62ef2b1
Author: Akihiro Motoki <email address hidden>
Date: Thu Dec 5 15:55:31 2013 +0900

    Return request-id in API response

    Import RequestIdMiddleware from oslo which ensures to request-id
    in API response. CatchErrorsMiddleware is also imported to ensure
    all internal exceptions are caught outermost.
    api-paste.ini is updated to use them.

    KeystonAuthContext middleware is updated so that it uses
    request-id generated by RequestIdMiddleware.

    Add middleware to openstack.conf and import all modules
    under middleware directory from oslo.

    DocImpact UpgradeImpact
    This patch adds new WSGI middlewares "request_id" and "catch_errors".
    They needs to be added to api-paste.ini when upgrading.

    Change-Id: Icf01b7de697ef50bef53212da2cf520d1ff78b88
    Closes-Bug: #1239923

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: icehouse-3 → 2014.1
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.