Tracing Questions

202 views
Skip to first unread message

Eaton Zveare

unread,
Aug 29, 2020, 8:51:43 AM8/29/20
to Google Stackdriver Discussion Forum
I have a Cloud Run service and in front of that is the Cloud Load Balancer. I have integrated tracing into the code running in the Cloud Run service and it's working fine, but I have some lingering questions:

To give context to these questions, note that when Cloud Load Balancer relays HTTP requests to Cloud Run, it generates a X-Cloud-Trace-Context header, so the caller doesn't have to provide one in the HTTP request, but if they do, Cloud Load Balancer will use that instead.

My first question is about LogEntry.spanId that is seen in Logs Viewer. How exactly is that populated? It does not match the span ID value in the trace header my backend Cloud Run service is receiving. Looking in Trace Viewer, I don't see this value anywhere.

Second, how do I get the "View trace details" option to work in Logs Viewer? It says here that traceSampled needs to be true, but when sending a header with "o=1", it still doesn't enable.

Robert Bergman

unread,
Sep 2, 2020, 3:11:41 PM9/2/20
to Eaton Zveare, Rami Shalom, Google Stackdriver Discussion Forum

How are the log entries in question being generated? Are you creating them in your code or is something else creating them? If you are writing them you may need to explicitly get the trace data and include it in the log entries. An example of doing that is here.

Regards,

-Robert Bergman, Manager of the Logging & Trace UI Team


--
© 2016 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Google Stackdriver Discussion Google Group (google-stackdr...@googlegroups.com) to participate in discussions with other members of the GoogleStackdriver community.
---
You received this message because you are subscribed to the Google Groups "Google Stackdriver Discussion Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-stackdriver-d...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-stackdriver-discussion/8232bfc0-89da-4227-9f76-db60792e1909n%40googlegroups.com.

Eaton Zveare

unread,
Sep 2, 2020, 9:53:29 PM9/2/20
to Google Stackdriver Discussion Forum

Robert Bergman

unread,
Sep 2, 2020, 10:13:02 PM9/2/20
to Eaton Zveare, Google Stackdriver Discussion Forum
Does it have anything to automatically add trace information to logs that are being written or do you need to write that data yourself?

Eaton Zveare

unread,
Sep 2, 2020, 11:06:10 PM9/2/20
to Google Stackdriver Discussion Forum
Ok, the 2 log entries are actually created by "http_load_balancer" and "cloud_run_revision". This is all done in the background, not with the .NET library.
When the .NET library does a trace, it uses the same trace ID as seen in the log entries, but still the "View trace details" remains unclickable.
Since the 2 log entries are generated automatically, I do not know how to configure the "traceSampled" field.


Bryan Zimmerman

unread,
Sep 3, 2020, 10:08:38 AM9/3/20
to Eaton Zveare, Google Stackdriver Discussion Forum
Hello Eaton,

This is great feedback! And actually you have another related item of feedback that was also super helpful. 
If you have time I would love to chat with you about this to get to the bottom of your needs, as well as move towards an answer for your specific questions. 

I'll reach out directly to coordinate. 

Bryan

Reply all
Reply to author
Forward
0 new messages