I am trying to optimise performance in an app-engine Java app using cloud sql gen2. It would help a lot if I could trace calls to cloud sql just like I can trace RPC calls to the datastore in the stackdriver trace details. Is this somehow possible, or maybe planned? Or is the only alternative to do log.info() calls with milliseconds? Or is there some other way to add event markers for tracing / profiling?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
There's now Google Cloud Trace for JDBC for exactly this use case.
Google Cloud Trace for JDBC is a custom JDBC driver which intercepts calls to the actual JDBC driver (e.g. Cloud SQL's) and collects and sends latency data about JDBC calls to Stackdriver Trace for visualization in the Google Cloud Console.
Here's how the trace details look like in the Google Cloud Console for an example request:
Please see the Github page for Google Cloud Trace for JDBC for more details. I'm happy to help with any issues (I'm the author).