[CAP-3944] Add container health to Kubernetes Pods dashboard - #25103
[CAP-3944] Add container health to Kubernetes Pods dashboard#25103AntoineEsteve wants to merge 1 commit into
Conversation
evalya-impact-summaryevalya impact analysis |
a7d3b7e to
7cffc4a
Compare
7cffc4a to
e297f69
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Validation ReportAll 21 validations passed. Show details
|
Code reviewFound 4 issues:
This is a population count, not an event count: a container that was OOMKilled once and has been healthy for days keeps contributing 1 until its pod is replaced. #23266 deliberately moved away from naive-summing this metric, replacing it with integrations-core/kubernetes/assets/dashboards/kubernetes_pods.json Lines 503 to 505 in e297f69
Summed and plotted as-is, the line does not show restart activity, and it drops when a crash-looping pod is deleted and its replacement starts back at 0 — reading as "restarts subsided" when the opposite is true. This repository already wraps the same metric for that reason in integrations-core/kubernetes/assets/dashboards/kubernetes_pods.json Lines 535 to 537 in e297f69
The formula is integrations-core/kubernetes/assets/dashboards/kubernetes_pods.json Lines 949 to 956 in e297f69
The ticket's item 3 asks to "Add a pod infrastructure list ordered by integrations-core/kubernetes/assets/dashboards/kubernetes_pods.json Lines 344 to 346 in e297f69 Minor, non-blocking: the four new timeseries omit 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
sblumenthal
left a comment
There was a problem hiding this comment.
A few comments, I am not sure that all of them require change, vs just a bit more context
| { | ||
| "data_source": "metrics", | ||
| "name": "query1", | ||
| "query": "sum:kubernetes.containers.last_state.terminated{$scope,$cluster,$namespace,$deployment,$statefulset,$daemonset,$job,$cronjob} by {reason}", |
There was a problem hiding this comment.
I am not sure I fully understand the intended use case of this graph... why would the total number of currently running pods that have terminated previously be relevent?
| "name": "usage", | ||
| "query": "sum:kubernetes.memory.usage{$scope,$cluster,$namespace,$deployment,$statefulset,$daemonset,$job,$cronjob}" | ||
| "name": "working_set", | ||
| "query": "sum:kubernetes.memory.working_set{$scope,$cluster,$namespace,$deployment,$statefulset,$daemonset,$job,$cronjob}" |
There was a problem hiding this comment.
What is the reason for this change?
| { | ||
| "data_source": "metrics", | ||
| "name": "throttled", | ||
| "query": "sum:kubernetes.cpu.cfs.throttled.periods{$scope,$cluster,$namespace,$deployment,$statefulset,$daemonset,$job,$cronjob}", |
| { | ||
| "id": 4847629150386417, | ||
| "definition": { | ||
| "title": "Container Health", |
There was a problem hiding this comment.
I am still a bit confused on the overall choice of graphs and the intent behind this change
We can see an older version of the dashboard, before the big refactor, here
There was also this slightly more recent change which is not captured in that link, was removed with the refactor, and does not seem to be present in the current iteration presented here
It does not appear that the old queries were incorporated / influenced the graphs in this PR, so I am curious what the driving force is here
What does this PR do?
Improves container-level health visibility in the Kubernetes Pods Overview dashboard:
Validated with
ddev validate dashboards kubernetesand against live metric data, including large query timeframes.Motivation
Restore the container troubleshooting workflow requested in CAP-3944, following the investigation in CAP-3888, without reintroducing queries that fail to load in large organizations.
QA
You can try this dashboard here, and compare it with the previous version here.
Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged