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

jobs: publish max protected timestamp as a metric #78354

Closed
amruss opened this issue Mar 23, 2022 · 0 comments
Closed

jobs: publish max protected timestamp as a metric #78354

amruss opened this issue Mar 23, 2022 · 0 comments
Assignees
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-jobs

Comments

@amruss
Copy link
Contributor

amruss commented Mar 23, 2022

Users should be able to alert on how far behind we're protecting jobs, to protect against the scenario where a job is causing an unacceptable amount of garabage.

Jira issue: CRDB-14088

Epic CRDB-21953

@amruss amruss added the C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) label Mar 23, 2022
@blathers-crl blathers-crl bot added the T-jobs label Mar 23, 2022
miretskiy pushed a commit to miretskiy/cockroach that referenced this issue Feb 15, 2023
Prior PR cockroachdb#89752 added
a metrics poller job which produces per job type stats on the
number of paused jobs.

This PR extends metrics poller to also collect stats related
to protected timestamps created by jobs.
Namely, two new metrics, per job type are added:

* `jobs.<job type>.protected_record_count` -- keeps track of the number
  of protected timestamp records help by the jobs.
* `jobs.<job type>.protected_age_sec` -- keeps track of the age
  of the oldest protected timestamp held by those jobs.

The metrics improve observability into protected timestamp system,
and allow operators to alert when protected timestamp records are
too old since that prevents garbage collection from occuring
(and if GC is not performed for too long, the cluster performance
would degrade).

Follow on work will also make this functionality available for
schedules.

Epic: CRDB-21953
Fixes cockroachdb#78354

Release note (enterprise change): Jobs that utilize protected timestamp
system (BACKUP, CHANGEFEED, IMPORT, etc) now produce metrics that
can be monitored to detect cases when job leaves stale protected
timestamp, preventing garbage collection from occuring.
miretskiy pushed a commit to miretskiy/cockroach that referenced this issue Feb 16, 2023
Prior PR cockroachdb#89752 added
a metrics poller job which produces per job type stats on the
number of paused jobs.

This PR extends metrics poller to also collect stats related
to protected timestamps created by jobs.
Namely, two new metrics, per job type are added:

* `jobs.<job type>.protected_record_count` -- keeps track of the number
  of protected timestamp records help by the jobs.
* `jobs.<job type>.protected_age_sec` -- keeps track of the age
  of the oldest protected timestamp held by those jobs.

The metrics improve observability into protected timestamp system,
and allow operators to alert when protected timestamp records are
too old since that prevents garbage collection from occuring
(and if GC is not performed for too long, the cluster performance
would degrade).

Follow on work will also make this functionality available for
schedules.

Epic: CRDB-21953
Fixes cockroachdb#78354

Release note (enterprise change): Jobs that utilize protected timestamp
system (BACKUP, CHANGEFEED, IMPORT, etc) now produce metrics that
can be monitored to detect cases when job leaves stale protected
timestamp, preventing garbage collection from occuring.
@craig craig bot closed this as completed in a0d6c19 Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) T-jobs
Projects
None yet
Development

No branches or pull requests

2 participants