juanmaocxy opened a new issue, #3260:
URL: https://github.com/apache/hertzbeat/issues/3260
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Current Behavior
when i use $.status.containerStatuses[0].restartCount to monito k8s pods
restart_count i can't get any reponse
### Expected Behavior
i can get restart_count = 3
### Steps To Reproduce
1、i update kubernate yaml to monitor pods restartCount
2、here is response to parse
`{
"metadata": {
},
"spec": {
},
"status": {
"phase": "Running",
"conditions": [
{
"type": "PodReadyToStartContainers",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2025-04-13T04:23:42Z"
},
{
"type": "Initialized",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2025-01-22T02:01:01Z"
},
{
"type": "Ready",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2025-04-13T04:23:42Z"
},
{
"type": "ContainersReady",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2025-04-13T04:23:42Z"
},
{
"type": "PodScheduled",
"status": "True",
"lastProbeTime": null,
"lastTransitionTime": "2025-01-22T02:01:01Z"
}
],
"hostIP": "100.100.100.31",
"hostIPs": [
{
"ip": "100.100.100.31"
}
],
"podIP": "10.42.0.92",
"podIPs": [
{
"ip": "10.42.0.92"
}
],
"startTime": "2025-01-22T02:01:01Z",
"containerStatuses": [
{
"name": "local-path-provisioner",
"state": {
"running": {
"startedAt": "2025-04-13T04:23:39Z"
}
},
"lastState": {
"terminated": {
"exitCode": 137,
"reason": "Error",
"startedAt": "2025-03-16T12:11:13Z",
"finishedAt": "2025-04-11T07:46:31Z",
"containerID":
"docker://fefaa267dcec7a13f200d1a25c033bc870bdbf9d142672b85f71f2e9ac70e32d"
}
},
"ready": true,
"restartCount": 3,
"image": "rancher/local-path-provisioner:v0.0.27",
"imageID":
"docker://sha256:c451116631150877804885d6195d011eec2666388f9668097dc598be9326959e",
"containerID":
"docker://1a705ffde1a5ec10e3c589fec94183661c1b8842a1dc7238727a2fecc52a0e8c",
"started": true
}
],
"qosClass": "BestEffort"
}
}`
3、when i use $.status.containerStatuses[0] i can get data, but when i use
$.status.containerStatuses[0].restartCount i can't get data
### Environment
```markdown
HertzBeat version(s):1.7.0
```
### Debug logs
_No response_
### Anything else?
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail:
notifications-unsubscr...@hertzbeat.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@hertzbeat.apache.org
For additional commands, e-mail: notifications-h...@hertzbeat.apache.org