How does Cloud Trace decide which requests to trace?

704 views
Skip to first unread message

PK

unread,
Jan 12, 2016, 12:43:07 AM1/12/16
to Google App Engine
I spent some time tonight with Cloud Trace. It seems very promising but I could not find certain requests. Does it sample requests or is supposed to capture all of them? Is there a way to ensure that a certain request is captured?




Zeehad (Cloud Platform Support)

unread,
Jan 13, 2016, 5:37:18 PM1/13/16
to Google App Engine
Hello,

Cloud trace captures all requests to application URIs. If you cannot see the request in the overview, find the trace by choosing the appropriate parameters. You can also create analysis reports for specific URIs.

I hope it helps. Cheers!

Brad Abrams

unread,
Jan 13, 2016, 5:57:50 PM1/13/16
to google-a...@googlegroups.com
Thanks Zeehad...   That is correct!  Our engineering lead for Cloud Trace responded to PK off thread and I think her response might be helpful or at least interesting to others.


    The requests are sampled at a rate of 0.1 request per second for each app engine instance you have.

    If you want to force a request to be traced, add X-Cloud-Trace-Context header to your request. The trace header specification in rfc7230 syntax is as below:

trace-context := “X-Cloud-Trace-Context” “:” trace-id  “/” span-id[ “;” “o” “=” trace_options ] *( “;” key “=” value)


trace-id := 1*( HEXDIG) ; hex representation of a 128 bit value

span-id := 1*(DIGIT) ; decimal representation of a 64 bit value

trace-option := 1*(DIGIT) ; decimal representation of a 32 bit value


Trace-id is required to be a 32 char hex value representing a 128 bit number. It should be unique between your requests unless you intentionally want to bundle them together. You can use UUIDs.
Span-id is better to be set to "0" if this is the root of your trace. Unless you have mobile clients that send in trace data (which is unlikely since you just discovered the feature), I'd suggest you use "0"
trace-option: set to 1 if you want to trace this request. 0 if you don't want to trace the request

 Here is an example to show how to force tracing via curl:

curl "http://<your.apps.url>" --header "X-Cloud-Trace-Context: <trace-id>/0;o=1"


example trace-id: 105445aa7843bc8bf206b120001000



--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/843b83e9-5a95-41c4-adfc-17f8396c1d8e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages