As you can see the LastTrigger is in seconds:

VirtualBox:~# kubectl get ep  -o custom-columns=Creation:.metadata.creationTimestamp,Labels:.metadata.labels,name:.metadata.name,Endpoints:.subsets[*].addresses[*].ip,"LastTrigger:.metadata.annotations.endpoints\.kubernetes\.io/last-change-trigger-time" --watch
Creation               Labels                           name                    Endpoints                           LastTrigger
2020-02-17T08:51:44Z   <none>                           kubernetes                           <none>
2020-04-16T14:36:44Z   map[run:meghha-dashboard]        meghha-dashboard        <none>                              <none>
2020-04-28T16:43:03Z   map[run:meghha-dashboard-main]   meghha-dashboard-main                          <none>
2020-07-08T13:50:05Z   map[name:mongo]                  mongodb-service         <none>                              2020-07-08T13:50:05Z
2020-07-18T14:00:12Z   map[run:my-nginx]                my-nginx      ,,   2020-07-23T13:36:06Z
2020-07-19T13:28:13Z   map[run:my-nginx]                my-nginx1     ,,   2020-07-23T13:36:06Z
2020-07-19T13:28:13Z   map[run:my-nginx]                my-nginx1     ,              2020-07-23T14:57:46Z
2020-07-18T14:00:12Z   map[run:my-nginx]                my-nginx      ,              2020-07-23T14:57:46Z
2020-07-18T14:00:12Z   map[run:my-nginx]                my-nginx      ,,   2020-07-23T14:57:47Z
2020-07-19T13:28:13Z   map[run:my-nginx]                my-nginx1     ,,   2020-07-23T14:57:47Z

I want the timestamp in microseconds, it is for GKE cluster. Is there any configuration in GKE cluster to get the time stamp in microseconds?

  • I want the timestamp in micro seconds, it is for GKE cluster. Is there any configuration in GKE cluster to get the time stamp in micro seconds? – Nagendra Kumar Jul 23 at 16:22
  • There is no way to do it, but you can use --sort-by=.metadata.creationTimestamp to sort by timestamp. It helps you? – KoopaKiller Jul 24 at 13:32
  • Nops. For business and mission critical systems, the time stamps has to be in micro seconds to take some decisions. K8 should provide the timestamp in micro seconds. There could be thousands of messages at the same second, how to differentiate them and important is to check the difference of time in between events to discard the packets and take similar decisions. – Nagendra Kumar Jul 24 at 15:54
  • Is there any way to get the time stamps in micro seconds for end points add/removal from Kubelet itself ?? – Nagendra Kumar Jul 24 at 15:56

Unfortunately there is no a native way to change.

I tottally understand you concern about quickly take decision, in this way you can use other alternatives to monitoring your environment.

You can process the logs using an external tool like prometheus, or use some circuit breake to keep your application resilience. If you are using the output of that command to take some action, keep in mind that sometime it could take more time than expected, since there are other variables in the middle of the way, such as network delays, the node workloads etc.

As I don't know you environment and what kind of decision you need to take I can only suggest alternatives like that.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.