Trace custom actions in Google Cloud Trace

64 views
Skip to first unread message

Học Đỗ

unread,
Jan 17, 2016, 9:58:58 PM1/17/16
to Google App Engine
Hi,

My GAE app takes about 800ms per request. The Google Cloud Trace shows me just about 20ms for datastore and memcache.

Now, I want to trace the CloudSQL connect/query time, and some other operations (encrypt/decrypt) in my application.

From documentation, I know that we can put custom traces to Google Cloud Trace, I have read the API's documentation but I want to put those custom traces together with builtin traces. I don't know how.

Do you guys have any idea or documentation about that?

P/S: I'm using Python, and suppose that this should be

<!-- language: lang-python -->

    @cloud_trace.trace()
    def decrypt_data():
        pass

Nicholas (Google Cloud Support)

unread,
Jan 18, 2016, 1:37:25 PM1/18/16
to Google App Engine
Thank you for this interesting question. To address more adequately, I believe more information would be required. Could you provide a code snippet marking specifically which method calls (Cloud SQL or any other) you intend to or would like to have traced? In addition, could you provide the documentation to which you are referring to create custom traces in Cloud Trace?

troberti

unread,
Jan 19, 2016, 4:41:30 AM1/19/16
to Google App Engine
Sadly I do not know how to do that, but being able to create custom traces for Cloud Trace would be really great feature.

Nicholas (Google Cloud Support)

unread,
Jan 22, 2016, 2:02:43 PM1/22/16
to Google App Engine
At the moment, it is not possible to combine custom and built-in traces. The same is true for spans within traces. You can however, create entirely custom traces using the projects.patchTrace REST API. You could for instance, create spans during your requests to represent each of the time consuming steps throughout the lifespan of the request and then POST this in JSON format to the projects.patchTrace specific URL as shown in the API definition. This may be somewhat cumbersome and may not reveal some background details the built-ins show, but you can still trace important time frames such as your SQL commands and results.

There are already some Cloud Trace SDKs for both Java and Node.js that, as stated, provide additional wrapper functionality that makes it easy to write latency data from your applications to Cloud Trace.
Reply all
Reply to author
Forward
0 new messages