What is the expected behavior of timestamp diff formatting?

I want to build a table of failed Pods (using K8sPodSample) with a column that shows how long the pod lived. To accomplish this I attempted to calculate the difference between the startTime and the latest timestamp of the sample, but I got unexpected behavior when I formatted the column as a Number.

NRQL (added *1000 and */1000 columns to demonstrate the unexpected behavior):

FROM K8sPodSample
SELECT latest(startTime) as 'Start Time'
max(timestamp) as 'Max Timestamp',
(max(timestamp) - latest(startTime)) as 'age',
(max(timestamp) - latest(startTime)) * 1000 as 'age * 1000',
(max(timestamp) - latest(startTime)) / 1000 as 'age / 1000' 
WHERE status = 'Failed' FACET podName

Column values:

  • age: .434
  • age * 1000: 1,667,220,358,434,000
  • age / 1000: .000

All columns are formatted as Number without auto-formatting.

Hello @cruise.hall ,

Can you let me know the values you are expecting to be shown for age, age * 1000,age / 1000?

Hi @adahale - I expected to see the time diff in seconds (or at least a multiple of that), for instance:

  • age: 51,630
  • age * 1000: 51,630,000
  • age / 1000: 51.63

Hello Cruise,

Can you please share a permalink to the above query?

Here is a permalink https://onenr.io/0vwBmn51VQp