fix(inputs.docker): Add restart count (#13646)
This commit is contained in:
parent
cb354a9d9a
commit
54b1009a9f
|
|
@ -518,6 +518,7 @@ func (d *Docker) gatherContainerInspect(
|
||||||
"oomkilled": info.State.OOMKilled,
|
"oomkilled": info.State.OOMKilled,
|
||||||
"pid": info.State.Pid,
|
"pid": info.State.Pid,
|
||||||
"exitcode": info.State.ExitCode,
|
"exitcode": info.State.ExitCode,
|
||||||
|
"restart_count": info.RestartCount,
|
||||||
"container_id": container.ID,
|
"container_id": container.ID,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -755,6 +755,7 @@ func TestContainerStatus(t *testing.T) {
|
||||||
map[string]interface{}{
|
map[string]interface{}{
|
||||||
"oomkilled": false,
|
"oomkilled": false,
|
||||||
"pid": 1234,
|
"pid": 1234,
|
||||||
|
"restart_count": 0,
|
||||||
"exitcode": 0,
|
"exitcode": 0,
|
||||||
"container_id": "e2173b9478a6ae55e237d4d74f8bbb753f0817192b5081334dc78476296b7dfb",
|
"container_id": "e2173b9478a6ae55e237d4d74f8bbb753f0817192b5081334dc78476296b7dfb",
|
||||||
"started_at": time.Date(2018, 6, 14, 5, 48, 53, 266176036, time.UTC).UnixNano(),
|
"started_at": time.Date(2018, 6, 14, 5, 48, 53, 266176036, time.UTC).UnixNano(),
|
||||||
|
|
@ -792,6 +793,7 @@ func TestContainerStatus(t *testing.T) {
|
||||||
"oomkilled": false,
|
"oomkilled": false,
|
||||||
"pid": 1234,
|
"pid": 1234,
|
||||||
"exitcode": 0,
|
"exitcode": 0,
|
||||||
|
"restart_count": 0,
|
||||||
"container_id": "e2173b9478a6ae55e237d4d74f8bbb753f0817192b5081334dc78476296b7dfb",
|
"container_id": "e2173b9478a6ae55e237d4d74f8bbb753f0817192b5081334dc78476296b7dfb",
|
||||||
"started_at": time.Date(2018, 6, 14, 5, 48, 53, 266176036, time.UTC).UnixNano(),
|
"started_at": time.Date(2018, 6, 14, 5, 48, 53, 266176036, time.UTC).UnixNano(),
|
||||||
"finished_at": time.Date(2018, 6, 14, 5, 53, 53, 266176036, time.UTC).UnixNano(),
|
"finished_at": time.Date(2018, 6, 14, 5, 53, 53, 266176036, time.UTC).UnixNano(),
|
||||||
|
|
@ -830,6 +832,7 @@ func TestContainerStatus(t *testing.T) {
|
||||||
"oomkilled": false,
|
"oomkilled": false,
|
||||||
"pid": 1234,
|
"pid": 1234,
|
||||||
"exitcode": 0,
|
"exitcode": 0,
|
||||||
|
"restart_count": 0,
|
||||||
"container_id": "e2173b9478a6ae55e237d4d74f8bbb753f0817192b5081334dc78476296b7dfb",
|
"container_id": "e2173b9478a6ae55e237d4d74f8bbb753f0817192b5081334dc78476296b7dfb",
|
||||||
"finished_at": time.Date(2018, 6, 14, 5, 53, 53, 266176036, time.UTC).UnixNano(),
|
"finished_at": time.Date(2018, 6, 14, 5, 53, 53, 266176036, time.UTC).UnixNano(),
|
||||||
},
|
},
|
||||||
|
|
@ -866,6 +869,7 @@ func TestContainerStatus(t *testing.T) {
|
||||||
"oomkilled": false,
|
"oomkilled": false,
|
||||||
"pid": 1234,
|
"pid": 1234,
|
||||||
"exitcode": 0,
|
"exitcode": 0,
|
||||||
|
"restart_count": 0,
|
||||||
"container_id": "e2173b9478a6ae55e237d4d74f8bbb753f0817192b5081334dc78476296b7dfb",
|
"container_id": "e2173b9478a6ae55e237d4d74f8bbb753f0817192b5081334dc78476296b7dfb",
|
||||||
"started_at": time.Date(2019, 1, 1, 0, 0, 2, 0, time.UTC).UnixNano(),
|
"started_at": time.Date(2019, 1, 1, 0, 0, 2, 0, time.UTC).UnixNano(),
|
||||||
"finished_at": time.Date(2019, 1, 1, 0, 0, 1, 0, time.UTC).UnixNano(),
|
"finished_at": time.Date(2019, 1, 1, 0, 0, 1, 0, time.UTC).UnixNano(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue