2
votes

I have a platform requirement to log a number of different applications living in a GKE cluster (currently logging to Stackdriver via Fluentd-gcp agent) in milliseconds. By default, Stackdriver logs the "receiveTimestamp" in nanoseconds:

receiveTimestamp:  "2018-10-19T16:02:37.147760051Z"  

The actual timestamp in seconds, however:

timestamp:  "2018-10-19T16:02:36Z" 

I know the logging internal to the containers is capturing a more detailed timestamp though:

textPayload:  "2018-10-19T16:02:36,036244860+00:00 ..."

I cannot find anything online on how to enable the timestamp to log a more precise time. I have tried altering the ConfigMap for Fluentd without any success. It may be that I am altering the wrong part of that config file, but at this point, I am just hoping for some GCP expert guidance to point me in the right direction. Thanks in advance.

Cheers!

1
It is currently not possible for google-fluendtd to recognize milliseconds parameters. However, there is a Feature Request already open for this issue to implemented. You can subscribe to the feature request in this issue tracker link to stay updated with the progress of this Feature Request.arp-sunny.

1 Answers

1
votes

I just noticed in the documentation for the timestamp field:

https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

Your application seems to be sending timestamps with a "," instead of a ".". I can imagine it might parse better if your app uses the dot format from the example.

Does that work?