Skip to content

Include TSDB head max time in out of bounds and too old sample errors#7695

Open
yeya24 wants to merge 2 commits into
cortexproject:masterfrom
yeya24:improve-sample-too-old-error
Open

Include TSDB head max time in out of bounds and too old sample errors#7695
yeya24 wants to merge 2 commits into
cortexproject:masterfrom
yeya24:improve-sample-too-old-error

Conversation

@yeya24

@yeya24 yeya24 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What this PR does:

When the ingester rejects a sample with out of bounds or too old sample, the error message only contains the rejected sample's own timestamp:

err: out of bounds. timestamp=2026-07-17T05:00:00Z, series={__name__="foo"}

Users cannot tell why the sample was too old — there is no reference point showing how far behind the acceptable time range the sample is. This PR includes the TSDB head max time in the error message for these two rejection reasons:

err: out of bounds. timestamp=2026-07-17T05:00:00Z, tsdbHeadMaxTimestamp=2026-07-17T06:00:00Z, series={__name__="foo"}

With this, users can directly self-diagnose these rejections (e.g. see that the sample is 1h behind the newest ingested data), instead of having to correlate with ingester internals. If the head max time is unset (empty head), the error falls back to the previous format.

The error is returned to the client (via the distributor) and also surfaced in the ingester's existing partial failures to push log line, so the head max time is visible in both places.

Which issue(s) this PR fixes:
N/A

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]
  • docs/configuration/v1-guarantees.md updated if this PR introduces experimental flags

When the ingester rejects a sample with an out of bounds or too old
sample error, the error message now includes the TSDB head max time in
addition to the rejected sample timestamp. This lets users directly see
how far behind the accepted time range the rejected sample is, making
these rejections self-diagnosable.

Signed-off-by: Ben Ye <benye@amazon.com>
Signed-off-by: Ben Ye <benye@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant