Browse Source

Merge pull request #45494 from thaJeztah/24.0_backport_execDuration_in_containerExit

[24.0 backport] daemon: handleContainerExit(): add execDuration in attributes
Sebastiaan van Stijn 2 năm trước cách đây
mục cha
commit
31b98f9502
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      daemon/monitor.go

+ 2 - 1
daemon/monitor.go

@@ -78,7 +78,8 @@ func (daemon *Daemon) handleContainerExit(c *container.Container, e *libcontaine
 	}
 
 	attributes := map[string]string{
-		"exitCode": strconv.Itoa(exitStatus.ExitCode),
+		"exitCode":     strconv.Itoa(exitStatus.ExitCode),
+		"execDuration": strconv.Itoa(int(execDuration.Seconds())),
 	}
 	daemon.Cleanup(c)