diff --git a/packages/orchestrator/pkg/sandbox/sandbox.go b/packages/orchestrator/pkg/sandbox/sandbox.go index d033f05f2e..5e597e4ccc 100644 --- a/packages/orchestrator/pkg/sandbox/sandbox.go +++ b/packages/orchestrator/pkg/sandbox/sandbox.go @@ -1398,14 +1398,17 @@ func (s *Sandbox) WaitForEnvd( defer span.End() defer func() { - if e != nil { - return - } duration := time.Since(start).Milliseconds() waitForEnvdDurationHistogram.Record(ctx, duration, metric.WithAttributes( telemetry.WithEnvdVersion(s.Config.Envd.Version), attribute.Int64("timeout_ms", s.internalConfig.EnvdInitRequestTimeout.Milliseconds()), + attribute.Bool("success", e == nil), )) + + if e != nil { + return + } + // Update the sandbox as started now s.SetStartedAt(time.Now()) }()