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

New namespace template #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

gianrubio
Copy link

  • Setup namespace templating

screen shot 2016-12-06 at 17 29 21

@tyranron
Copy link
Member

tyranron commented Dec 6, 2016

@gianrubio, thank you for contribution!

Not sure about device=~\"^/dev/(sd|hd|xvd).*$\", as it will allow other partitions (different from 9) to be included.
I decided to use /dev/[sf]da9 strictly because of CoreOS Disk Layout, as far as I'm using CoreOS.
Would you be so kind to comment this moment more wide? What is your opinion?

@gianrubio
Copy link
Author

@tyranron you're absolutely right about the partition 9. However you can mount devices as /dev/xvd.
Look on my current cluster

disk

What do you think to use /dev/([sf]|xv)da9 ?

@tyranron
Copy link
Member

tyranron commented Dec 7, 2016

What do you think to use /dev/([sf]|xv)da9 ?

@gianrubio 👍👍👍

2) remove unnecessary namespace templating on non-k8s queries
@tyranron
Copy link
Member

tyranron commented Dec 8, 2016

@gianrubio I've dived into it a bit closely and found some problems:

  1. Unlike Node templating, the namespace label is not present on every metric. Actually, it is present only on k8s containers. So I removed Namespace templating from queries not related to k8s.
  2. cAdvisor's container abstraction is based on lmctfy's so containers are inherently nested hierarchically.
    That means that containers metrics with id="/" show total system usage, and we are using that in our "Total Usage" stats. Those metrics do not have namespace label. So for templating by Namespace in "Total Usage" stats we need to sum per-container usage now, like id=~"^/[^/]+/[^/]+$". It's okay when we choose concrete Namespace, but numbers differ when we choose Namespace: All, because now queries do not collect system usage that is not related to containers:
    # This is not 0
    sum(container_fs_usage_bytes{device=~"^/dev/([sf]|xv)da9$",id="/"}) - sum(container_fs_usage_bytes{device=~"^/dev/([sf]|xv)da9$",id=~"^/[^/]+/[^/]+$"})
    
    Ideally, we need to use id="/" for Namespace: All, and id=~"^/[^/]+/[^/]+$" in other cases. But Grafana templating does not provide such capabilities.
    I think we need to customize Prometheus relabel_config a bit more here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants