Select Nanosecond macro in query builder

We are running Grafana v7.5.3 and PostgreSQL 11. We have nanosecond timestamped data.

Currently, we divide the timestamp by 1000000000 for every query so that we can use the $__unixEpochFilter macro. This works in the query builder but the user has to type “timestamp/1000000000” in every query.

We would like to use the native timestamp and select the $__unixEpochNanoFilter in the query builder. But the only way to invoke the nano filter is to switch to raw SQL and enter it there, which is even harder for users.

Is there any way to add “$__unixEpochNanoFilter” as a selectable item in the query builder?

Hi @rhopkins1

I would check out this issue, which asks the same question (I think). Note the response from Torkel, the creator of Grafana:

No there is no way to do that. It would be quite tricky as all time formats in javascript (and time libs) only go down to millisecond resolution.