Skip to content

Commit 3388dd6

Browse files
committed
fix(supervisor): split the skipped-reclaim metric by reason
1 parent b4d6f67 commit 3388dd6

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

  • apps/supervisor/src/workloadServer

apps/supervisor/src/workloadServer/index.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ interface DefaultEventsMap {
5555

5656
/**
5757
* checkpointDeleteRequests counts the delete requests this supervisor makes, and every reason it
58-
* decides not to: `sent`, `disabled`, `not_terminal`, `no_claims`, `no_project_ref`, `http_error`.
58+
* decides not to: `sent`, `disabled`, `no_client`, `not_applicable`, `not_terminal`, `no_claims`,
59+
* `no_project_ref`, `http_error`.
5960
* Without the negative outcomes, "no deletes are happening" is indistinguishable from the feature
6061
* being switched off - and with no lifecycle expiry, that difference is leaked storage.
6162
*/
@@ -248,11 +249,21 @@ export class WorkloadServer extends EventEmitter<WorkloadServerEvents> {
248249
attemptStatus: string,
249250
claims: WorkloadDeploymentTokenClaims | undefined
250251
): Promise<void> {
251-
if (!env.DELETE_CHECKPOINTS_ON_COMPLETION || !this.checkpointClient || this.snapshotService) {
252+
if (!env.DELETE_CHECKPOINTS_ON_COMPLETION) {
252253
checkpointDeleteRequests.inc({ result: "disabled" });
253254
return;
254255
}
255256

257+
if (!this.checkpointClient) {
258+
checkpointDeleteRequests.inc({ result: "no_client" });
259+
return;
260+
}
261+
262+
if (this.snapshotService) {
263+
checkpointDeleteRequests.inc({ result: "not_applicable" });
264+
return;
265+
}
266+
256267
if (attemptStatus !== "RUN_FINISHED" && attemptStatus !== "RUN_PENDING_CANCEL") {
257268
checkpointDeleteRequests.inc({ result: "not_terminal" });
258269
return;

0 commit comments

Comments
 (0)