Skip to content

Add stale marker and test for rule backfilling - #8976

Closed
JessicaGreben wants to merge 7 commits into
prometheus:mainfrom
JessicaGreben:jg/rule-backfill-add-stalemarker
Closed

JessicaGreben wants to merge 7 commits into
prometheus:mainfrom
JessicaGreben:jg/rule-backfill-add-stalemarker

Conversation

@JessicaGreben

@JessicaGreben JessicaGreben commented Jun 21, 2021 •

Copy link
Copy Markdown
Contributor

This PR adds stale markers to the Recording Rule Backfilling feature (#11, #8667).

Background:
When a recording rule is being evaluated by the backfill process, stale markers should be inserted when: 1) there is a gap in data greater than the eval interval or 2) the last sample occurs before the "end". However, the QueryAPI used by the backfill process does not return stale markers so instead we need to detect them and insert them during the backfill process.

This PR makes the following changes to add stale markers:

  1. creates a stale marker cache that tracks sample timestamps so we can tell if there is a gap in data between blocks
  2. creates a staleNaN sample if the following cases are encountered: a) there is a gap in data greater than the eval interval between blocks or b) within a block, or c) insert a staleNaN sample if the last sample sent from the QueryAPI is before the end time that was requested to be backfilled.
  3. adds stale unit tests

@JessicaGreben
JessicaGreben force-pushed the jg/rule-backfill-add-stalemarker branch from f2fbfc8 to 0ba0e9c Compare June 21, 2021 16:24
Signed-off-by: jessicagreben <[email protected]>
@roidelapluie roidelapluie self-assigned this Jun 21, 2021
Signed-off-by: jessicagreben <[email protected]>
@JessicaGreben

Copy link
Copy Markdown
Contributor Author

Status update: I'm currently investigating unexpected behavior in the unit tests. Once I fix the tests, this should be close to done.

Comment thread cmd/promtool/rules.go Resolved
@JessicaGreben
JessicaGreben requested a review from dgl as a code owner November 13, 2021 17:30
@JessicaGreben
JessicaGreben force-pushed the jg/rule-backfill-add-stalemarker branch from 50b2d57 to b0d796d Compare November 28, 2021 00:58
Signed-off-by: jessicagreben <[email protected]>
@stale stale Bot added the stale label Jan 29, 2022
@JessicaGreben

Copy link
Copy Markdown
Contributor Author

Closing for now, will re-open once I fix the tests.

@beorn7 beorn7 mentioned this pull request Jun 4, 2024
1 of 3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants