[openstack-dev] [oslo] oslo.context and name fields

Doug Hellmann doug at doughellmann.com
Tue Apr 5 18:42:13 UTC 2016


Excerpts from Sean Dague's message of 2016-04-05 14:31:46 -0400:
> I was trying to clean up the divergent logging definitions in devstack
> as part of scrubbing out 'tenant' references -
> https://review.openstack.org/#/c/301801/ and in doing so stumbled over
> the fact that the extremely useful project_name and user_name fields are
> not in base oslo.context.
> 
> https://github.com/openstack/oslo.context/blob/c63a359094907bc50cc5e1be716508ddee825dfa/oslo_context/context.py#L148-L159
> 
> These are always available to be set -
> http://docs.openstack.org/developer/keystonemiddleware/api/keystonemiddleware.auth_token.html#what-auth-token-adds-to-the-request-for-use-by-the-openstack-service
> 
> And they are extremely valuable when a human is looking at logs, as you
> actually can remember names when looking at various services to cross
> reference things. Nova has a custom context that sets these things -
> https://github.com/openstack/nova/blob/d57a4e8be9147bd79be12d3f5adccc9289a375b6/nova/api/auth.py#L114-L115
> 
> I would really like these to be available in all services using
> oslo.context.
> 
> So the question is, were these not implemented on purpose? Is the
> opposition to putting them into oslo.context?

It's probably just a matter of not getting to them. We have a couple of
incomplete specs related to contexts and logging. Ronald and I were
going to try to make some progress on those during Newton.

http://specs.openstack.org/openstack/oslo-specs/specs/kilo/app-agnostic-logging-parameters.html
http://specs.openstack.org/openstack/oslo-specs/specs/liberty/oslo.log-user-identity-format-flexibility.html

Doug

> 
> Please let me know before I start going down this path.
> 
>     -Sean
> 



More information about the OpenStack-dev mailing list