Google Cloud has a powerful tracing tool for analyzing latency of requests and RPCs. But it seems to just pick some requests that it finds deserving of traces. Sometimes that's good enough, you can just browse through existing traces. But if you are working on a performance enhancement, you want the trace on your particular query right now, you don't want to wait until it is deemed interesting.
Questions are
What rules intervene in deciding which queries are traced ?
Is there a way to ask for traces to be captured for a given URI ?
Either from within developer console, or by calling some API from within our application ? Or through some app.yaml configuration ? Or do we have to just wait and pray for the great algorithm to chose our request ?
You can force tracing of a HTTP request by setting the cloud trace context header properly:
$ curl -H "X-Cloud-Trace-Context: 01234567890123456789012345678901;o=1" http://<your-app>.appspot.com/<path>
01234567890123456789012345678901 (32 hex characters) is the trace id. You want to use a different one each time.
o=1 enables tracing.
Use the following URL to view the trace (last part is the trace id): http://console.developer.google.com/traces/details/01234567890123456789012345678901
Since you're interested in particular request, why don't you use appstats? https://cloud.google.com/appengine/docs/python/tools/appstats?hl=en you can make performance enchancement, turn appstats on and deploy it to different version and have some control from appengine_config.py
I use cloud trace to get aggregate analysis, to get into more detail per request basis, I always use appstats as it contains more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With