Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dashboard resources cluster: display only namespaced resources #872

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dashboards/resources/cluster.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ local template = grafana.template;
.addPanel(
g.panel('Memory Usage (w/o cache)') +
// Not using container_memory_usage_bytes here because that includes page cache
g.queryPanel('sum(container_memory_rss{%(cadvisorSelector)s, %(clusterLabel)s="$cluster", container!=""}) by (namespace)' % $._config, '{{namespace}}') +
g.queryPanel('sum(container_memory_rss{%(cadvisorSelector)s, %(clusterLabel)s="$cluster", container!="", namespace!=""}) by (namespace)' % $._config, '{{namespace}}') +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

container_memory_rss shows data from cgroups, the container!="" matcher ensures that only container data is considered (where namespace always exists).

However, there is a chance you can receive additional cgroups data without also excluding the pause containers using container!="POD" (link).

So I think what you may be after is this:

Suggested change
g.queryPanel('sum(container_memory_rss{%(cadvisorSelector)s, %(clusterLabel)s="$cluster", container!="", namespace!=""}) by (namespace)' % $._config, '{{namespace}}') +
g.queryPanel('sum(container_memory_rss{%(cadvisorSelector)s, %(clusterLabel)s="$cluster", container!="", container!="POD"}) by (namespace)' % $._config, '{{namespace}}') +

g.stack +
{ yaxes: g.yaxes('bytes') },
)
Expand Down