feat(executor): add OTel metrics for the TaskAction garbage collector - #7550
Conversation
71636b1 to
26030c3
Compare
|
Is it possible to rework these using OTEL instead of prometheus? |
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! |
|
@davidlin20dev thanks for working it. Sorry for the late reply, I was OOO. yes, we decide to use OTEL |
@pingsutw thanks for confirming! quick question: should I wait for the issue to be updated, or is it fine to start the OTel rework now? |
|
It's fine to start the work now |
|
Hi @pingsutw, I'm working on the OTel rework now, and there's one design decision I'm debating on the deletions counter. Right now I'm labeling it I'm thinking of labeling by |
Records deletions and sweep duration on the executor's meter provider, both labeled by error. Replaces the earlier promutils implementation per review feedback. Registration failure is non-fatal: the GC runs unmetered rather than blocking startup. Signed-off-by: davidlin20dev <davidlin20.dev@gmail.com>
A delete attempt has three outcomes: deleted, already gone via cascade delete, and failed. The boolean label could not express the middle one, so objects reaped by cascade went uncounted. Signed-off-by: davidlin20dev <davidlin20.dev@gmail.com>
26030c3 to
4c6da6c
Compare
|
Pushed the OTel rework. On the question above, I went ahead and implemented the outcome version (deleted / already_gone / failed) so there's something concrete to look at. I can switch it back to the boolean if needed. Please take a look. |
pingsutw
left a comment
There was a problem hiding this comment.
LGTM, thanks. Could you also test it in the devbox and help update the grafana dashboard?
I added a make target for the devbox to install the grafana stack, so you can easily to test it in the devbox.
|
Thanks! Yeah sure, I'll take a look at the devbox and the dashboard. |
Hi @pingsutw , I just submitted a PR addressing this: #7836. Please take a look. Thank you! |
What changes were proposed in this pull request?
Adds OpenTelemetry metrics for the executor's TaskAction garbage collector, registered on the executor's existing meter provider.
taskaction.gc.deletionsInt64Counteroutcome=deleted|already_gone|failedtaskaction.gc.sweep.durationFloat64Histogram(ms)error=true|falseThis replaces the promutils implementation this PR originally carried, per review feedback that OTel is the direction for executor metrics. The pattern follows
executor/pkg/controller/metrics.gofrom #7483.A few design notes:
registerTaskActionMetrics.outcome, not a boolean. A delete attempt has three results: it succeeded, the object was already gone (Kubernetes cascade-deleted it when the GC removed its parent earlier in the same sweep), or it failed. A boolean can't express the middle case, and skipping it undercounts what the sweep actually removed.errorlabel, since a sweep has only two outcomes.Why are the changes needed?
The executor gets reconcile counts and workqueue metrics for free from controller-runtime, but nothing reports garbage collection activity: how much is being deleted, whether deletes are failing, or how long a sweep takes. See #7455.
How was this patch tested?
collect()against a live API server with a real meter provider and asserts the recorded values, so the call sites incollect()are covered rather than just the helpers.collect().Labels
Related to #7455