Skip to content

Track metric with the last successful blocks sync, scan and compaction #2573

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

pracucci
Copy link
Contributor

@pracucci pracucci commented May 8, 2020

What this PR does:
While working on critical Cortex alerts for the blocks storage I've realised there's no reliable way to alert on few critical conditions: blocks are not successfully scanned, synched and compacted.

In this PR I propose the following metrics which allows to alert if a successful scan/sync/compact hasn't occurred in the last X time:

  • cortex_compactor_last_successful_run_time
  • cortex_querier_blocks_last_successful_sync_time (when store-gateway is disabled)
  • cortex_querier_blocks_last_successful_scan_time (when store-gateway is enabled)
  • cortex_storegateway_blocks_last_successful_sync_time

I've also removed the check on io.EOF because I can't see a good reason of having it. We can add it anytime if we figure out there's a good reason of having it, but right now I'm wondering if it's a just misprint from the past.

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]
Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, definitely needed. Thanks! (My comments are non-blocking nits)

pracucci and others added 5 commits May 12, 2020 07:45
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>

Co-authored-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>

Co-authored-by: Peter Štibraný <pstibrany@gmail.com>
Signed-off-by: Marco Pracucci <marco@pracucci.com>
@pracucci pracucci force-pushed the add-metrics-for-blocks-storage-alerts branch from cc723da to 6e47742 Compare May 12, 2020 05:51
Signed-off-by: Marco Pracucci <marco@pracucci.com>
Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@pracucci pracucci merged commit 039ce76 into cortexproject:master May 12, 2020
@pracucci pracucci deleted the add-metrics-for-blocks-storage-alerts branch May 12, 2020 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants