Skip to content

Commit

Permalink
fix: add restart count metric to terminated pods (#27)
Browse files Browse the repository at this point in the history
in case a pod is in a crash loop we were not getting the restart count
  • Loading branch information
ardias authored Sep 23, 2020
1 parent 4d5c629 commit 3513ea4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/kubelet/metric/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ func fillContainerStatuses(pod *v1.Pod, dest map[string]definition.RawMetrics) {
case c.State.Terminated != nil:
dest[id]["status"] = "Terminated"
dest[id]["reason"] = c.State.Terminated.Reason
dest[id]["restartCount"] = c.RestartCount
dest[id]["startedAt"] = c.State.Terminated.StartedAt.Time.In(time.UTC) // TODO WE DO NOT REPORT THAT METRIC
default:
dest[id]["status"] = "Unknown"
Expand Down

0 comments on commit 3513ea4

Please sign in to comment.