fix(dashboards): group pod resource requests and limits by containerfix(dashboards): group pod resource requests and limits by container#1180
Open
Cloud-Architect-Emma wants to merge 4 commits intokubernetes-monitoring:masterfrom
Conversation
Collaborator
Author
|
Thanks for the feedback, @skl! That makes complete sense, I see how the graph could become overcrowded with too many series. I like the idea of adding a container variable to filter the entire dashboard instead. I'll look into adding that variable and updating the panels to support it. I'll update this PR once I have a new version ready. |
Author
|
@skl I've updated the PR! I added a $container template variable in common.libsonnet and linked it through variables/pod.libsonnet. I also kept the by (container) aggregation in the queries so that when a specific container is selected via the dropdown, the request/limit lines accurately reflect that container's settings. Let me know what you think! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
In the "Compute Resources / Pod" dashboard, the CPU/Memory Request and Limit lines are currently aggregated at the Pod level (summed together). On pods with multiple containers (like sidecars or service meshes), this creates a single line that doesn't align with the individual "Usage" lines, making it impossible to see which container is hitting its specific limit.
Solution
This PR adds
by (container)to the following query functions indashboards/resources/queries/pod.libsonnet:cpuRequestscpuLimitsmemoryRequestsmemoryLimitsThis aligns the graph logic with the existing table queries in the same file which already use container-level grouping.
Validation
Verified that the PromQL
sum()functions now include theby (container)clause to preserve the container label in the output series.