feat(executor): add garbage collector Prometheus metrics#7550
Open
davidlin20dev wants to merge 1 commit into
Open
feat(executor): add garbage collector Prometheus metrics#7550davidlin20dev wants to merge 1 commit into
davidlin20dev wants to merge 1 commit into
Conversation
Emit objects_deleted, deletion_errors, and sweep_duration under a dedicated executor:gc: sub-scope, created once in the constructor and updated during each collect() sweep. Unit tests assert the counters move and the sweep is timed. Part of flyteorg#7455. Signed-off-by: davidlin20dev <davidlin20.dev@gmail.com>
71636b1 to
26030c3
Compare
Member
|
Is it possible to rework these using OTEL instead of prometheus? |
Contributor
Author
Hi @Sovietaced, happy to switch these to OTel. I went with Prometheus because #7445 and #7455 (umbrella issue) are both centered around promutils, so that's @pingsutw, since you opened these issues: could you confirm whether OTel is the preferred Thanks both, appreciate the help! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking issue
Related to #7455 (part of #7445; does not close the issue).
Why are the changes needed?
The garbage collector emits no metrics, so there is no visibility into whether terminal-
TaskActioncleanup is happening, failing, or keeping up. A broken or slow GC silently letsTaskActionCRDs pile up in etcd until the cluster is already degraded.What changes were proposed in this pull request?
Three Prometheus instruments under a dedicated
executor:gc:sub-scope, created once in the constructor and updated each sweep:objects_deleted(counter): per successful delete.deletion_errors(counter): per failed delete.sweep_duration(stopwatch): full-sweep duration, timed viadefer.The scope is injected through
NewGarbageCollector(..., scope)fromsetup.go(executorScope.NewSubScope("gc")). No labels, to keep cardinality bounded.How was this patch tested?
New unit tests in
garbage_collector_metrics_test.go(controller-runtime fake client, no envtest):TestGarbageCollectorDeletedMetric: a successful sweep movesobjects_deleted0 to 1, records a sweep, and leavesdeletion_errorsat 0.TestGarbageCollectorDeletionErrorMetric: an injected delete failure movesdeletion_errors0 to 1, andobjects_deletedstays 0.Verified via the default registry, since endpoint exposure depends on #7453.
go test ./executor/pkg/controller/ -run TestGarbageCollector -count=1 -vLabels
added
Setup process
N/A
Screenshots
N/A
Check all the applicable boxes
Related PRs
N/A
Docs link
N/A