mirror of
https://github.com/grafana/grafana.git
synced 2024-11-26 02:40:26 -06:00
Loki: use millisecond-steps (#47572)
* loki: use millisecond-steps * better comment Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> * better comment Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
This commit is contained in:
parent
8db35b9b0b
commit
d95468a4bb
@ -51,7 +51,13 @@ func makeRequest(ctx context.Context, lokiDsUrl string, query lokiQuery) (*http.
|
||||
// is ignored, so it would be nicer to not send it in such cases,
|
||||
// but we cannot detect that situation, so we always send it.
|
||||
// it should not break anything.
|
||||
qs.Set("step", query.Step.String())
|
||||
// NOTE2: we do this at millisecond precision for two reasons:
|
||||
// a. Loki cannot do steps with better precision anyway,
|
||||
// so the microsecond & nanosecond part can be ignored.
|
||||
// b. having it always be number+'ms' makes it more robust and
|
||||
// precise, as Loki does not support step with float number
|
||||
// and time-specifier, like "1.5s"
|
||||
qs.Set("step", fmt.Sprintf("%dms", query.Step.Milliseconds()))
|
||||
lokiUrl.Path = "/loki/api/v1/query_range"
|
||||
}
|
||||
case QueryTypeInstant:
|
||||
|
Loading…
Reference in New Issue
Block a user