[docs] improve the documentation of query_range's interval param
#9,459 opened on 2023年5月15日
説明
the current documentation at https://grafana.com/docs/loki/latest/api/#query-loki-over-a-range-of-time says:
"
Determines the sort order of logs. Supported values are forward or backward. Defaults to backward.
"
i think it does not just control the sort order of the returned logs, it also controls where in time Loki begins to find log lines. if you go direction=backward, then the returned logs will start from the end timestamp, going in the direction of the start timestamp. and direction=forward does the opposite, the logs will start from the start timestamp, going in the direction of the end timestamp.
with an example: imagine i have a time-range that contains 6 log-lines, in timestamp-number-is-increasing order:
line1
line2
line3
line4
line5
line6
- if i say
limit=2&direction=forward, i getline1andline2 - if i say
limit=2&direction=backward, i getline6andline5
i think the documentation for the direction param should be improved to also describe this, because right now it may be interpreted as "it always returns the same log-lines, except in a different order"