File tree Expand file tree Collapse file tree 4 files changed +9
-0
lines changed
packages/core/src/v3/runEngineWorker/supervisor Expand file tree Collapse file tree 4 files changed +9
-0
lines changed Original file line number Diff line number Diff 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 { } ;
Original file line number Diff line number Diff 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 ( ) ,
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ type SupervisorSessionOptions = SupervisorClientCommonOptions & {
2121 preSkip ?: PreSkipFn ;
2222 maxRunCount ?: number ;
2323 maxConsumerCount ?: number ;
24+ sendRunDebugLogs ?: boolean ;
2425} ;
2526
2627export class SupervisorSession extends EventEmitter < WorkerEvents > {
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ export type SupervisorClientCommonOptions = {
66 instanceName : string ;
77 deploymentId ?: string ;
88 managedWorkerSecret ?: string ;
9+ sendRunDebugLogs ?: boolean ;
910} ;
1011
1112export type PreDequeueFn = ( ) => Promise < {
You can’t perform that action at this time.
0 commit comments