Infinity plugin EPOCH time

  • What Grafana version and what operating system are you using? 9.5.3

  • What are you trying to achieve? Creating a time series graph for CPU utilization

  • How are you trying to achieve it? I have the data that is retrieved from API using Infinity plugin.

  • What happened? Time is shown as 1970-01-20 13:42:43 for EPOCH value 1687363762

  • What did you expect to happen? Should display the correct year, month & date along with time.

I am retrieving data from the API source with the following UQL query:

| jsonata "($.*).({'CPU USAGE': cpu.totalUsage, 'LAST ACTIVE AT':was_active_at, 'LAST DEVICE INFO REFRESH AT':device_info_refreshed_at})"

I get 3 columns in the table and the values are in EPOCH

I added a transformation to the field and then selected “Convert Field Type” and the Type as “Time” and Format as “Unix”. But I get the time as 1970-01-20 13:42:43

How can I get a proper datetime value? I have seen solutions where they ask to scale the value by 1000 but that is not available for this plugin source.

Did you consider reading the Grafana Infinity Datasource doc page about UQL? Apart from JSONata, UQL also provides tons of utility methods to extend your query.

1 Like

Thanks for the reply. No I have not read the entire documentation as I just started exploring this plugin. I will read those details and try it.

Is there a way to get the current timestamp in UQL. I have a call that gets a problem time range and if it is currently active the end date is -1. I want to caclulate how long the problem has been going on and can’t do it.