File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
genkit-tools/telemetry-server/src Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ export class BroadcastManager {
7171 }
7272
7373 const data = JSON . stringify ( event ) ;
74- const messageToSend = `${ data } \n\n` ;
74+ const messageToSend = `data: ${ data } \n\n` ;
7575
7676 // Note: response.write() doesn't throw on dead sockets in Express - it
7777 // returns false and the 'close' event handles cleanup. No try/catch needed.
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ export async function startTelemetryServer(params: {
8181 const currentTrace = await params . traceStore . load ( traceId ) ;
8282 if ( currentTrace ) {
8383 const snapshot = JSON . stringify ( currentTrace ) ;
84- response . write ( `${ snapshot } \n\n` ) ;
84+ response . write ( `data: ${ snapshot } \n\n` ) ;
8585 }
8686
8787 // Register this connection for broadcasts
Original file line number Diff line number Diff line change @@ -89,8 +89,8 @@ async function cleanUpTracing(): Promise<void> {
8989 */
9090function createTelemetryServerProcessor ( ) : SpanProcessor {
9191 const exporter = new TraceServerExporter ( ) ;
92- // Use RealtimeSpanProcessor in dev for real-time span updates
93- return isDevEnv ( )
92+ // Use RealtimeSpanProcessor when explicitly enabled via env var (set by CLI)
93+ return isDevEnv ( ) && process . env . GENKIT_ENABLE_REALTIME_TELEMETRY === 'true'
9494 ? new RealtimeSpanProcessor ( exporter )
9595 : new BatchSpanProcessor ( exporter ) ;
9696}
You can’t perform that action at this time.
0 commit comments