Use authoritative Docker OOM evidence

This commit is contained in:
rcourtman 2026-07-15 17:55:26 +01:00
parent e499f92360
commit e3382c8bcb
32 changed files with 234 additions and 81 deletions

View file

@ -305,6 +305,9 @@ func TestCollectContainer(t *testing.T) {
if container.Health != "healthy" {
t.Fatalf("expected health status, got %q", container.Health)
}
if container.OOMKilled == nil || *container.OOMKilled {
t.Fatalf("expected authoritative non-OOM state, got %v", container.OOMKilled)
}
if container.BlockIO == nil {
t.Fatalf("expected block IO to be populated")
}

View file

@ -621,6 +621,7 @@ func (a *Agent) collectContainer(ctx context.Context, summary containertypes.Sum
}
}
oomKilled := inspect.State.OOMKilled
container := agentsdocker.Container{
ID: summary.ID,
Name: trimLeadingSlash(summary.Names),
@ -637,6 +638,7 @@ func (a *Agent) collectContainer(ctx context.Context, summary containertypes.Sum
UptimeSeconds: uptimeSeconds,
RestartCount: inspect.RestartCount,
ExitCode: inspect.State.ExitCode,
OOMKilled: &oomKilled,
StartedAt: startedPtr,
FinishedAt: finishedPtr,
Ports: ports,