Skip to content
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

more metrics in purger for monitoring delete requests processing progress #2730

Merged
merged 4 commits into from Jun 18, 2020

Conversation

sandeepsukhani
Copy link
Contributor

What this PR does:
Adds the following 3 new metrics for monitoring the progress of the processing of delete request:

  • purger_load_pending_requests_attempts_total: Number of attempts that were made to load pending requests with status.
  • purger_oldest_pending_delete_request_age_seconds: Age of oldest pending delete request in seconds.
  • purger_pending_delete_requests_count: Count of requests which are in process or are ready to be processed.

This PR also loads new delete requests for processing on startup instead of waiting for the first tick, which is an hour now.

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.

Thanks. LGTM, with some comments/questions.

pkg/chunk/purger/purger.go Outdated Show resolved Hide resolved
Comment on lines +475 to +477
dp.metrics.oldestPendingDeleteRequestAgeSeconds.Set(float64(now.Sub(oldestPendingRequestCreatedAt) / time.Second))
dp.metrics.pendingDeleteRequestsCount.Set(float64(pendingDeleteRequestsCount))

Copy link
Contributor

Choose a reason for hiding this comment

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

This will only update metrics after all delete requests have plans for them built. Is that OK?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that is the only option right now because if we change the count as we go through each delete request the partially updated value could get scraped and we would see unexpected jumps in the number of pending requests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This could be done by refactoring the code to find the requests to process as well as do a count of pending requests and build the plans after updating the metric. What do you think?

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

LGTM. I left a minor not. Could you also add a CHANGELOG entry, please?

pkg/chunk/purger/purger_test.go Outdated Show resolved Hide resolved
…ress

Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>
Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>
Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>
Signed-off-by: Sandeep Sukhani <sandeep.d.sukhani@gmail.com>
@pstibrany pstibrany merged commit 16564fc into cortexproject:master Jun 18, 2020
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.

None yet

3 participants