Skip to content

Commit f70be68

Browse files
committed
refactor(supervisor): demote per-run logs to debug/verbose for quieter prod output
1 parent 8b4c6bf commit f70be68

File tree

5 files changed

+16
-16
lines changed

5 files changed

+16
-16
lines changed

apps/supervisor/src/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,13 @@ class ManagedSupervisor {
198198
}
199199

200200
this.workerSession.on("runNotification", async ({ time, run }) => {
201-
this.logger.log("runNotification", { time, run });
201+
this.logger.verbose("runNotification", { time, run });
202202

203203
this.workloadServer.notifyRun({ run });
204204
});
205205

206206
this.workerSession.on("runQueueMessage", async ({ time, message, dequeueResponseMs, pollingIntervalMs }) => {
207-
this.logger.log(`Received message with timestamp ${time.toLocaleString()}`, message);
207+
this.logger.verbose(`Received message with timestamp ${time.toLocaleString()}`, message);
208208

209209
if (message.completedWaitpoints.length > 0) {
210210
this.logger.debug("Run has completed waitpoints", {
@@ -221,7 +221,7 @@ class ManagedSupervisor {
221221
const { checkpoint, ...rest } = message;
222222

223223
if (checkpoint) {
224-
this.logger.log("Restoring run", { runId: message.run.id });
224+
this.logger.debug("Restoring run", { runId: message.run.id });
225225

226226
if (this.isComputeMode && this.computeManager && env.COMPUTE_SNAPSHOTS_ENABLED) {
227227
try {
@@ -244,7 +244,7 @@ class ManagedSupervisor {
244244
});
245245

246246
if (didRestore) {
247-
this.logger.log("Compute restore successful", { runId: message.run.id, runnerId });
247+
this.logger.debug("Compute restore successful", { runId: message.run.id, runnerId });
248248
} else {
249249
this.logger.error("Compute restore failed", { runId: message.run.id, runnerId });
250250
}
@@ -271,7 +271,7 @@ class ManagedSupervisor {
271271
});
272272

273273
if (didRestore) {
274-
this.logger.log("Restore successful", { runId: message.run.id });
274+
this.logger.debug("Restore successful", { runId: message.run.id });
275275
} else {
276276
this.logger.error("Restore failed", { runId: message.run.id });
277277
}
@@ -282,14 +282,14 @@ class ManagedSupervisor {
282282
return;
283283
}
284284

285-
this.logger.log("Scheduling run", { runId: message.run.id });
285+
this.logger.debug("Scheduling run", { runId: message.run.id });
286286

287287
const warmStartStart = performance.now();
288288
const didWarmStart = await this.tryWarmStart(message);
289289
const warmStartCheckMs = Math.round(performance.now() - warmStartStart);
290290

291291
if (didWarmStart) {
292-
this.logger.log("Warm start successful", { runId: message.run.id });
292+
this.logger.debug("Warm start successful", { runId: message.run.id });
293293
return;
294294
}
295295

apps/supervisor/src/services/failedPodHandler.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export class FailedPodHandler {
151151
}
152152

153153
private async onPodCompleted(pod: V1Pod) {
154-
this.logger.info("pod-completed", this.podSummary(pod));
154+
this.logger.debug("pod-completed", this.podSummary(pod));
155155
this.informerEventsTotal.inc({ namespace: this.namespace, verb: "add" });
156156

157157
if (!pod.metadata?.name) {
@@ -165,7 +165,7 @@ export class FailedPodHandler {
165165
}
166166

167167
if (pod.metadata?.deletionTimestamp) {
168-
this.logger.info("pod-completed: pod is being deleted", this.podSummary(pod));
168+
this.logger.verbose("pod-completed: pod is being deleted", this.podSummary(pod));
169169
return;
170170
}
171171

@@ -188,15 +188,15 @@ export class FailedPodHandler {
188188
}
189189

190190
private async onPodSucceeded(pod: V1Pod) {
191-
this.logger.info("pod-succeeded", this.podSummary(pod));
191+
this.logger.debug("pod-succeeded", this.podSummary(pod));
192192
this.processedPodsTotal.inc({
193193
namespace: this.namespace,
194194
status: this.podStatus(pod),
195195
});
196196
}
197197

198198
private async onPodFailed(pod: V1Pod) {
199-
this.logger.info("pod-failed", this.podSummary(pod));
199+
this.logger.debug("pod-failed", this.podSummary(pod));
200200

201201
try {
202202
await this.processFailedPod(pod);
@@ -208,7 +208,7 @@ export class FailedPodHandler {
208208
}
209209

210210
private async processFailedPod(pod: V1Pod) {
211-
this.logger.info("pod-failed: processing pod", this.podSummary(pod));
211+
this.logger.verbose("pod-failed: processing pod", this.podSummary(pod));
212212

213213
const mainContainer = pod.status?.containerStatuses?.find((c) => c.name === "run-controller");
214214

@@ -231,7 +231,7 @@ export class FailedPodHandler {
231231
}
232232

233233
private async deletePod(pod: V1Pod) {
234-
this.logger.info("pod-failed: deleting pod", this.podSummary(pod));
234+
this.logger.verbose("pod-failed: deleting pod", this.podSummary(pod));
235235
try {
236236
await this.k8s.core.deleteNamespacedPod({
237237
name: pod.metadata!.name!,

apps/supervisor/src/services/podCleaner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class PodCleaner {
9090
status: "succeeded",
9191
});
9292

93-
this.logger.info("Deleted batch of pods", { continuationToken });
93+
this.logger.debug("Deleted batch of pods", { continuationToken });
9494
} catch (err) {
9595
this.logger.error("Failed to delete batch of pods", {
9696
err: err instanceof Error ? err.message : String(err),

apps/supervisor/src/workloadManager/docker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class DockerWorkloadManager implements WorkloadManager {
6262
}
6363

6464
async create(opts: WorkloadManagerCreateOptions) {
65-
this.logger.log("create()", { opts });
65+
this.logger.verbose("create()", { opts });
6666

6767
const runnerId = getRunnerId(opts.runFriendlyId, opts.nextAttemptNumber);
6868

apps/supervisor/src/workloadManager/kubernetes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export class KubernetesWorkloadManager implements WorkloadManager {
100100
}
101101

102102
async create(opts: WorkloadManagerCreateOptions) {
103-
this.logger.log("[KubernetesWorkloadManager] Creating container", { opts });
103+
this.logger.verbose("[KubernetesWorkloadManager] Creating container", { opts });
104104

105105
const runnerId = getRunnerId(opts.runFriendlyId, opts.nextAttemptNumber);
106106

0 commit comments

Comments
 (0)