quickwit-oss / quickwit-datasource

Quickwit data source for Grafana
GNU Affero General Public License v3.0
41 stars 10 forks source link

Remove `TimeOutputFormat` from the datasource #65

Closed fmassot closed 6 months ago

fmassot commented 6 months ago

Queries that retrieve documents are all sorted by the timestamp field. At request time, we enforce the output format of the sorted value in nanosecond with b.Sort(es.SortOrderDesc, defaultTimeField, "epoch_nanos_int").

The ES response contains a sort field in each hit. This sort field is an array of values with a size > 0, and we know that the first element of the array is the timestamp value in nanosecond.

So we don't need to know the TimeOutputFormat, we have already the info in the hit, we just need to use it.