I originally started my GCP experience on AppEngine, where the out of the box stackdriver experience is fantastic. I'm trying to group logs from my managed GKE containers as specified in the docs. I've got every field set except one -- it seems that the fluentd defaults do not modify the logName field sent to stdout. My logs always end up with the logName set to projects/[PROJECT-ID]/logs/app According to the docs, child logs must have a different logName than the parent log entry. I know grouping can be accomplished via the client libs, but the client libs require communicating with the google oauth apis which would be painful to setup in my current environment.Is there any way to group logs in the stackdriver UI for folks using stdout logging on GKE? Is there something I didn't see in the docs?
--
© 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/6c44216a-c1b2-4de2-a65f-6b1abd11d312%40googlegroups.com.
--
© 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/89aa62f4-23fd-45b5-872c-f54aa6f2fd80%40googlegroups.com.
Hi,Just FYI, the legacy experience will no longer be available on later GKE versions (though it's still available on versions up to and including 1.14).Both the legacy and the new Stackdriver experience support detecting and parsing single-line JSON written to the container stdout. As you noted, the httpRequest field will be parsed out of the JSON and sent as part of the log entry. So you have all the tools to get the same httpRequest data in your GKE logs as you would in your GAE logs.However, the Logs Viewer does not group entries by httpRequest, but rather by the embedded trace id, which GAE automatically generates for each request. You can embed a trace id in your container logs as well, by setting the logging.googleapis.com/trace field in the generated JSON, and you should get the same behavior as for GAE logs.Hope this helps,Igor
On Mon, Jul 22, 2019 at 11:10 AM TKO <nelso...@gmail.com> wrote:
--Hey Igor,To add some clarity:
- I'm using Legacy StackDriver on GKE
- Using the default parser that ships with GKE
- The docs I'm following are:
- https://cloud.google.com/logging/docs/structured-logging for basic reference
- https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry for fields that appear in logs
- https://cloud.google.com/appengine/articles/logging?source=post_page---------------------------#linking_app_logs_and_requests and this github discussion https://github.com/googleapis/google-cloud-go/issues/448#issuecomment-352132523 for correlating logs
- https://cloud.google.com/logging/docs/agent/configuration#special-fields for finding the fields that StackDriver pulls out of the jsonPayload by default
What I'd like to accomplish is this:Whenever a request comes in to my application via HTTP, a log is created -- then each log created within the context of the HTTP request is viewable in the StackDriver logging web UI as a child of the initial request log. On AppEngine this is the default behavior. What you end up with in the StackDriver UI is an expandable tree-view of logs that are grouped by request.I'd prefer to stick with Legacy Stackdriver and writing to STDOUT if possible.Thanks for the reply, and let me know if theres any more context I can add.
© 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-stackdriver-discu...@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-discussion+unsub...@googlegroups.com.
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/89aa62f4-23fd-45b5-872c-f54aa6f2fd80%40googlegroups.com.
--
© 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/c80d56e3-73e4-4396-ba93-81caf4bd27b7%40googlegroups.com.
Hi,There are a number of articles on the topic (see [1], [2], [3]). The log name shouldn't matter, as long as it's the same and other fields match up.Specifically, you have to set both traceId and httpRequest.utl. You can specify both by emitting JSON payloads as documented in [4].Hope this helps.[2] https://medium.com/google-cloud/combining-correlated-log-lines-in-google-stackdriver-dd23284aeb29[4] https://cloud.google.com/logging/docs/agent/configuration#process-payloadIgor
-- sent from a mobile device, please excuse tyops and omissns
Email preferences: You received this email because you signed up for the Google Stackdriver Discussion Google Group (google-stackdriver-discu...@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-discussion+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-stackdriver-discussion/89aa62f4-23fd-45b5-872c-f54aa6f2fd80%40googlegroups.com.
--
© 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-stackdriver-discu...@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-discussion+unsub...@googlegroups.com.