Skip to content

Commit 1293751

Browse files
committed
disable run debug logs for supervisor client
1 parent 7494100 commit 1293751

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

apps/supervisor/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ class ManagedSupervisor {
130130
maxConsumerCount: env.TRIGGER_DEQUEUE_MAX_CONSUMER_COUNT,
131131
runNotificationsEnabled: env.TRIGGER_WORKLOAD_API_ENABLED,
132132
heartbeatIntervalSeconds: env.TRIGGER_WORKER_HEARTBEAT_INTERVAL_SECONDS,
133+
sendRunDebugLogs: env.SEND_RUN_DEBUG_LOGS,
133134
preDequeue: async () => {
134135
if (!env.RESOURCE_MONITOR_ENABLED) {
135136
return {};

packages/core/src/v3/runEngineWorker/supervisor/http.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export class SupervisorHttpClient {
3333
private readonly workerToken: string;
3434
private readonly instanceName: string;
3535
private readonly defaultHeaders: Record<string, string>;
36+
private readonly sendRunDebugLogs: boolean;
3637

3738
private readonly logger = new SimpleStructuredLogger("supervisor-http-client");
3839

@@ -41,6 +42,7 @@ export class SupervisorHttpClient {
4142
this.workerToken = opts.workerToken;
4243
this.instanceName = opts.instanceName;
4344
this.defaultHeaders = getDefaultWorkerHeaders(opts);
45+
this.sendRunDebugLogs = opts.sendRunDebugLogs ?? false;
4446

4547
if (!this.apiUrl) {
4648
throw new Error("apiURL is required and needs to be a non-empty string");
@@ -204,6 +206,10 @@ export class SupervisorHttpClient {
204206
}
205207

206208
async sendDebugLog(runId: string, body: WorkerApiDebugLogBody, runnerId?: string): Promise<void> {
209+
if (!this.sendRunDebugLogs) {
210+
return;
211+
}
212+
207213
try {
208214
const res = await wrapZodFetch(
209215
z.unknown(),

packages/core/src/v3/runEngineWorker/supervisor/session.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ type SupervisorSessionOptions = SupervisorClientCommonOptions & {
2121
preSkip?: PreSkipFn;
2222
maxRunCount?: number;
2323
maxConsumerCount?: number;
24+
sendRunDebugLogs?: boolean;
2425
};
2526

2627
export class SupervisorSession extends EventEmitter<WorkerEvents> {

packages/core/src/v3/runEngineWorker/supervisor/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export type SupervisorClientCommonOptions = {
66
instanceName: string;
77
deploymentId?: string;
88
managedWorkerSecret?: string;
9+
sendRunDebugLogs?: boolean;
910
};
1011

1112
export type PreDequeueFn = () => Promise<{

0 commit comments

Comments
 (0)