From da4f7a68334f43e8b6d46734b2495787e5a60fce Mon Sep 17 00:00:00 2001 From: Sam Richard Date: Mon, 9 Mar 2026 19:45:42 -0300 Subject: [PATCH] docs: clarify max_chunk_age out-of-order window calculation (#21105) Signed-off-by: pnkcaht --- docs/sources/shared/configuration.md | 6 ++++++ docs/templates/configuration.template | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/docs/sources/shared/configuration.md b/docs/sources/shared/configuration.md index bb17649d69..670e9b2b21 100644 --- a/docs/sources/shared/configuration.md +++ b/docs/sources/shared/configuration.md @@ -8065,12 +8065,18 @@ and be accepted with ```yaml time_of_most_recent_line - (max_chunk_age/2) ``` +This means the allowed out-of-order window is half of the configured max_chunk_age. Log entries with timestamps that are after this earliest time are accepted. Log entries further back in time return an out-of-order error. For example, if `max_chunk_age` is 2 hours and the stream `{foo="bar"}` has one entry at `8:00`, +the earliest accepted timestamp will be calculated as: 8:00 - (2h / 2) = `7:00`. + Loki will accept data for that stream as far back in time as `7:00`. + If another log line is written at `10:00`, +the earliest accepted timestamp becomes: 10:00 - (2h / 2) = `9:00`. + Loki will accept data for that stream as far back in time as `9:00`. diff --git a/docs/templates/configuration.template b/docs/templates/configuration.template index d8a4055e16..af386a1319 100644 --- a/docs/templates/configuration.template +++ b/docs/templates/configuration.template @@ -159,12 +159,18 @@ and be accepted with ```yaml time_of_most_recent_line - (max_chunk_age/2) ``` +This means the allowed out-of-order window is half of the configured max_chunk_age. Log entries with timestamps that are after this earliest time are accepted. Log entries further back in time return an out-of-order error. For example, if `max_chunk_age` is 2 hours and the stream `{foo="bar"}` has one entry at `8:00`, +the earliest accepted timestamp will be calculated as: 8:00 - (2h / 2) = `7:00`. + Loki will accept data for that stream as far back in time as `7:00`. + If another log line is written at `10:00`, +the earliest accepted timestamp becomes: 10:00 - (2h / 2) = `9:00`. + Loki will accept data for that stream as far back in time as `9:00`.