Grafana data srource. Event start time format

  • 6 March 2024
  • 2 replies

Userlevel 2
Badge +3


For some reason my events retreived via the CDF data source for Grafana come with time stamps in epoch format:

In the examples given in the documentation, events are returned with a human-readable time format. Any idea what I am doing wrong here?


Best answer by Everton Colling 6 March 2024, 19:25

View original

2 replies

Userlevel 4

Hi Kristian,

Thank you for reaching out and bringing this to our attention. I've looked into the issue you're experiencing with the Grafana connector and the format of the timestamps.

You are not doing anything wrong here. After testing it myself, I can confirm that in the latest version of Cognite's Grafana connector, startTime and endTime timestamps are indeed parsed as integers, representing milliseconds since the epoch. This is consistent with how timestamps are returned from CDF APIs—always as integers in this format. It appears that the automatic conversion of these timestamps to a datetime format compatible with Grafana, which was previously in place, is not working anymore. Cognite’s Engineering team will investigate what’s going on and evaluate if we can issue a fix.

In the meantime, you can circumvent this issue by applying a simple transformation within Grafana to convert the field type from an integer to a human-readable datetime format. Below is a screenshot demonstrating how to perform this transformation:

I'll revert here whenever we have more information regarding a potential fix. Should we determine that a direct fix on the connector isn't feasible in the short term, we'll make sure to update our documentation and explain how to deal with timestamps properly.

Userlevel 4

Hi Kristian,

We have released a new version of the Grafana connector, version 4.1.2, which includes a fix for the issue you raised. Now startTime and endTime timestamps are parsed as datetime automatically in Grafana, not needing the transformation step.