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 years ago
parent
commit
31b98f9502
1 changed files with 2 additions and 1 deletions
  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)