-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
Currently loki returns timestamps in a string format, these date strings can be quite expensive to parse when dealing with many thousands of entries.
In the browser timestamps are in millisecond epochs so that would be the deals format to return values in (ie in plain json numbers). Since the internal format is in nanoseconds this will lose some precision (that we throw away anyway when parsing this to a local date). So not sure what the best approach here is. Maybe some query flag that will control the ts format & precision.
A related issue is how labels are currently returned in string that has to be json parsed separately (from the rest of the body). If dealing with a large number of streams this could also be a minor performance issue but mostly I think this just looks very strange from an API perspective to have this be a string that contains json and not be proper part of the json response.