<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Jan 6, 2013 at 11:55 PM, Monty Taylor <span dir="ltr"><<a href="mailto:mordred@inaugust.com" target="_blank">mordred@inaugust.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">Getting client ids passed to the db log for correlation will be<br>

</div></div>
trickier. A lot of the big web properties will do tricks in their db<br>
layer where they will add embedded comments into the sql passed in that<br>
include information like client ids. I'm not sure how hard that sort of<br>
tracing would be to do on our end -but turning on the slow query log<br>
while doing these sorts of things is probably a great starting place.<br>
<div class="im"><br></div></blockquote><div><br></div><div style>This might be done by extending patch_mysqldb_with_stacktrace_comments:</div><div style><a href="https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/session.py#L565">https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/session.py#L565</a><br>

</div><div style><br></div><div style>One way to approach this would be to inspect the stack for particular things (file name, variable, or something else) and only then get the client ids and add them to the comment string, though at the moment I'm not quite clear on how session.py is going to access the API client id.</div>

<div style><br></div><div style>-Devananda</div></div></div></div>