[openstack-dev] [nova] logging wsgi requests exactly once ... issues with request usefulness

Sean Dague sean at dague.net
Mon Feb 10 23:19:07 UTC 2014


On 02/10/2014 05:37 PM, Christopher Yeoh wrote:
> On Mon, Feb 10, 2014 at 3:11 PM, Sean Dague <sean at dague.net
> <mailto:sean at dague.net>> wrote:
> 
>     On 02/10/2014 05:05 PM, Christopher Yeoh wrote:
>     > On Mon, Feb 10, 2014 at 2:56 PM, Sean Dague <sean at dague.net
>     <mailto:sean at dague.net>
>     > <mailto:sean at dague.net <mailto:sean at dague.net>>> wrote:
>     >
>     >     In upstream Nova master we're currently logging ec2 wsgi
>     requests twice,
>     >     once in the paste pipeline, and once in eventlet.
>     >
>     >     The following patch removes the paste pipeline portion -
>     >     https://review.openstack.org/#/c/67736/
>     >
>     >     However... I'm not very satisfied with this approach, as the
>     resulting
>     >     log entries look as follows (lots more examples at -
>     >    
>     http://logs.openstack.org/36/67736/7/check/check-tempest-dsvm-full/9b0eb3e/logs/screen-n-api.txt.gz?level=INFO)
>     >
>     >     ... "POST /services/Cloud/ HTTP/1.1" status: 200 len: 2099 time:
>     >     0.8823061
>     >     ... "POST /services/Cloud/ HTTP/1.1" status: 200 len: 449 time:
>     >     0.1196980
>     >     ... "POST /services/Cloud/ HTTP/1.1" status: 200 len: 2095 time:
>     >     0.4743402
>     >     ... "POST /services/Cloud/ HTTP/1.1" status: 400 len: 360 time:
>     >     0.5385840
>     >     ... "POST /services/Cloud/ HTTP/1.1" status: 200 len: 449 time:
>     >     0.1317410
>     >
>     >     Because the eventlet logger is only logging the requestline
>     (which is
>     >     the URL), Post requests are basically completely information free.
>     >
>     >     We have an equally opaque problem in the Nova API with server
>     actions:
>     >
>     >     ... "POST
>     >    
>     /v2/85979842c31049fab70bcdd399cb9a3f/servers/4d5c5ba0-a975-4f4b-863a-390ad58e1c48/action
>     >     HTTP/1.1" status: 202 len: 185 time: 1.1360781
>     >
>     >     Because these aren't really RESTful interfaces, so the url is
>     not useful
>     >     enough to determine the action.
>     >
>     >     My feeling is that we need to make the wsgi request logs
>     useful enough
>     >     to know what was actually called on an API call, which means
>     I'm not
>     >     convinced we can actually use the eventlet logger for Nova,
>     because our
>     >     URLs aren't actually RESTful.
>     >
>     >     I'm slightly surprised that in v3 we do the same thing. Could
>     we at
>     >     minimum change .... action urls to action/ACTIONNAME, or would
>     that
>     >     completely not work with our router?
>     >
>     >
>     > Yea this is a wsgi "thing". I guess we'll need to log action POSTs
>     twice
>     > to get enough useful info in the logs.
> 
>     No, I get that our urls are POST .../action.  :)
> 
>     What I'm saying is that isn't a RESTful url. The API end point should be
>     POST .../action/BLAH, and that's what attached to the controller. It
>     seems like given that we haven't yet released the v3 API this is maybe
>     changable.
> 
> 
> Hrm perhaps. Probably require a bit of hacking on wsgi to change how
> wsgi.action works and then a bunch of unittests and tempest tests updated
> to allow the patches to merge (unless we allow both types of behaviour in
> the meantime.
> 
> However, for a RESTful url api design aren't you meant to avoid using
> verbs in the URL?
> Which is why I think the design was done this way in the first place. eg
> 
> http://stackoverflow.com/questions/2447722/rest-services-exposing-non-data-actions
> 
> so I'm not convinced we should be changing this. And feature propsal
> deadline is
> only a week away anyway.

Yeh, timing is unfortunate. I had honestly thought the actions methods
were being put into the dustbin, and I apologize for only catching this
during the log cleanup.

I think this means we clearly need to not use the eventlet logger, and
instead do the request logging ourself outside of it.

I'm also pretty trepadatious on v3 going forward without the
infrastructure to micro version once we get it, because these giant
multi year API iterations aren't doing us any favors. We need a way to
evolve and fix going forward. Because I don't want to be waiting another
year for an API that we can evolve over time.

	-Sean

-- 
Sean Dague
Samsung Research America
sean at dague.net / sean.dague at samsung.com
http://dague.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 547 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140210/b40dc782/attachment.pgp>


More information about the OpenStack-dev mailing list