-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jobs: Extend job metric poller to collect PTS stats
Prior PR #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 #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.
- Loading branch information
Yevgeniy Miretskiy
committed
Feb 22, 2023
1 parent
9a20948
commit a0d6c19
Showing
15 changed files
with
413 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
load("//build/bazelutil/unused_checker:unused.bzl", "get_x_data") | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library") | ||
|
||
go_library( | ||
name = "metricspoller", | ||
srcs = [ | ||
"job_statistics.go", | ||
"poller.go", | ||
], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/jobs/metricspoller", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//pkg/jobs", | ||
"//pkg/jobs/jobspb", | ||
"//pkg/jobs/jobsprotectedts", | ||
"//pkg/roachpb", | ||
"//pkg/security/username", | ||
"//pkg/settings/cluster", | ||
"//pkg/sql", | ||
"//pkg/sql/isql", | ||
"//pkg/sql/sem/tree", | ||
"//pkg/sql/sessiondata", | ||
"//pkg/util/hlc", | ||
"//pkg/util/log", | ||
"//pkg/util/metric", | ||
"//pkg/util/timeutil", | ||
"@com_github_cockroachdb_errors//:errors", | ||
"@com_github_cockroachdb_logtags//:logtags", | ||
"@com_github_prometheus_client_model//go", | ||
], | ||
) | ||
|
||
get_x_data(name = "get_x_data") |
Oops, something went wrong.