@@ -359,7 +359,7 @@ func handleStart(ctx context.Context, execCtx *rapidContext, watchdog *core.Watc
359359 if ! startRequest .SuppressInit {
360360 if err := doInit (ctx , execCtx , watchdog ); err != nil {
361361 log .WithError (err ).WithField ("InvokeID" , startRequest .InvokeID ).Error ("Init failed" )
362- doneFailMsg := generateDoneFail (execCtx , startRequest .CorrelationID , nil )
362+ doneFailMsg := generateDoneFail (execCtx , startRequest .CorrelationID , nil , 0 )
363363 handleInitError (doneFailMsg , execCtx , startRequest .InvokeID , interopServer , err )
364364 return
365365 }
@@ -378,9 +378,13 @@ func handleStart(ctx context.Context, execCtx *rapidContext, watchdog *core.Watc
378378 if err := interopServer .SendDone (doneMsg ); err != nil {
379379 log .Panic (err )
380380 }
381+
382+ if err := interopServer .StartAcceptingDirectInvokes (); err != nil {
383+ log .Panic (err )
384+ }
381385}
382386
383- func generateDoneFail (execCtx * rapidContext , correlationID string , invokeMx * rendering.InvokeRendererMetrics ) * interop.DoneFail {
387+ func generateDoneFail (execCtx * rapidContext , correlationID string , invokeMx * rendering.InvokeRendererMetrics , invokeReceivedTime int64 ) * interop.DoneFail {
384388 errorType , found := appctx .LoadFirstFatalError (execCtx .appCtx )
385389 if ! found {
386390 errorType = fatalerror .Unknown
@@ -392,6 +396,7 @@ func generateDoneFail(execCtx *rapidContext, correlationID string, invokeMx *ren
392396 Meta : interop.DoneMetadata {
393397 RuntimeRelease : appctx .GetRuntimeRelease (execCtx .appCtx ),
394398 NumActiveExtensions : execCtx .registrationService .CountAgents (),
399+ InvokeReceivedTime : invokeReceivedTime ,
395400 },
396401 }
397402
@@ -414,7 +419,7 @@ func handleInvoke(ctx context.Context, execCtx *rapidContext, watchdog *core.Wat
414419
415420 if err := doInvoke (ctx , execCtx , watchdog , invokeRequest , & invokeMx ); err != nil {
416421 log .WithError (err ).WithField ("InvokeID" , invokeRequest .ID ).Error ("Invoke failed" )
417- doneFailMsg := generateDoneFail (execCtx , invokeRequest .CorrelationID , & invokeMx )
422+ doneFailMsg := generateDoneFail (execCtx , invokeRequest .CorrelationID , & invokeMx , invokeRequest . InvokeReceivedTime )
418423 handleInvokeError (doneFailMsg , execCtx , invokeRequest .ID , interopServer , err )
419424 return
420425 }
@@ -436,6 +441,7 @@ func handleInvoke(ctx context.Context, execCtx *rapidContext, watchdog *core.Wat
436441 InvokeRequestReadTimeNs : invokeMx .ReadTime .Nanoseconds (),
437442 InvokeRequestSizeBytes : int64 (invokeMx .SizeBytes ),
438443 InvokeCompletionTimeNs : invokeCompletionTimeNs ,
444+ InvokeReceivedTime : invokeRequest .InvokeReceivedTime ,
439445 },
440446 }
441447 if execCtx .telemetryAPIEnabled {
0 commit comments