mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Adding metrics for exit_status of container in multi-container mode.
PiperOrigin-RevId: 493671987
This commit is contained in:
committed by
gVisor bot
parent
4a1a26f966
commit
a35ca06260
@@ -336,7 +336,7 @@ func (l *Lifecycle) reap(containerID string, tg *kernel.ThreadGroup) {
|
||||
if err := l.updateContainerState(containerID, stateStopped); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
eventchannel.Emit(&pb.ContainerExitEvent{
|
||||
eventchannel.LogEmit(&pb.ContainerExitEvent{
|
||||
ContainerId: containerID,
|
||||
ExitStatus: uint32(tg.ExitStatus()),
|
||||
})
|
||||
@@ -392,6 +392,10 @@ func (l *Lifecycle) GetExitStatus(args *ContainerArgs, status *uint32) error {
|
||||
}
|
||||
|
||||
*status = uint32(c.tg.ExitStatus())
|
||||
eventchannel.LogEmit(&pb.ContainerExitEvent{
|
||||
ContainerId: args.ContainerID,
|
||||
ExitStatus: *status,
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -423,7 +427,7 @@ func (l *Lifecycle) Reap(args *ContainerArgs, _ *struct{}) error {
|
||||
// the actual stop is called. This may be a duplicate event, but is
|
||||
// necessary in case the reap goroutine transitions the container to the
|
||||
// stop state before the caller starts observing the event channel.
|
||||
eventchannel.Emit(&pb.ContainerExitEvent{
|
||||
eventchannel.LogEmit(&pb.ContainerExitEvent{
|
||||
ContainerId: args.ContainerID,
|
||||
ExitStatus: uint32(c.tg.ExitStatus()),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user