AFAICT node_filesystem_* doesn't catch GCE-PD PVs (GPPs) at all. GPPs are usually named ^/dev/sd[^a]$, and I haven't been able to find any node_filesystem_free metrics looking like a GPP, e.g. max node_filesystem_free is 8GB, while I have at least 3 GPPs over 500GB.
Could GPPs or plain PVs be ignored, either intentionally or unintentionally, by the node-exporter?
P.S. I read your post about `predict_linear()`[0] while researching this :)
[0]: https://www.robustperception.io/reduce-noise-from-disk-space-alerts/
On Thu, 29 Jun 2017 at 11:29 Brian Brazil <brian.brazil@robustperception.io> wrote:On 29 June 2017 at 10:25, Joar Wandborg <jo...@wandborg.com> wrote:I need to collect metrics for PersistentVolumes backed by GCE-PDs in order to find out if the volumes are starting to fill up, in which case I'll manually take action by resizing the GCE PD or removing data.
The metrics I need, per PV/GCE-PD, are:
- Bytes total
- Bytes used (preferrably excluding ext "Reserved blocks")
- GCE-PD name *OR* k8s PV(C)? name *OR* k8s Pod name and path.
I've looked into existing solutions for both prometheus and Stackdriver, but haven't been able to find anything.
I have made https://github.com/joar/disk-usage-exporter, which exports disk usage metrics to prometheus, but this approach has a few issues:
- I can't easily get metrics for PVs in Pods created by helm charts.
- I haven't figured out how to reliably get the PV/PVC name of a mounted path from inside the container.
Is there a better solution? Have i missed something that does what I want and is included by default?The node exporter provides filesystem metrics under node_filesystem_*
On 29 June 2017 at 11:05, Joar Wandborg <jo...@wandborg.se> wrote:AFAICT node_filesystem_* doesn't catch GCE-PD PVs (GPPs) at all. GPPs are usually named ^/dev/sd[^a]$, and I haven't been able to find any node_filesystem_free metrics looking like a GPP, e.g. max node_filesystem_free is 8GB, while I have at least 3 GPPs over 500GB.sda is a device, not a filesystem. File systems have bytes reserved, used and total, and they need to be mounted for you to get that.Brian
Could GPPs or plain PVs be ignored, either intentionally or unintentionally, by the node-exporter?
P.S. I read your post about `predict_linear()`[0] while researching this :)
[0]: https://www.robustperception.io/reduce-noise-from-disk-space-alerts/
On Thu, 29 Jun 2017 at 11:29 Brian Brazil <brian....@robustperception.io> wrote:On 29 June 2017 at 10:25, Joar Wandborg <jo...@wandborg.com> wrote:I need to collect metrics for PersistentVolumes backed by GCE-PDs in order to find out if the volumes are starting to fill up, in which case I'll manually take action by resizing the GCE PD or removing data.
The metrics I need, per PV/GCE-PD, are:
- Bytes total
- Bytes used (preferrably excluding ext "Reserved blocks")
- GCE-PD name *OR* k8s PV(C)? name *OR* k8s Pod name and path.
I've looked into existing solutions for both prometheus and Stackdriver, but haven't been able to find anything.
I have made https://github.com/joar/disk-usage-exporter, which exports disk usage metrics to prometheus, but this approach has a few issues:
- I can't easily get metrics for PVs in Pods created by helm charts.
- I haven't figured out how to reliably get the PV/PVC name of a mounted path from inside the container.
Is there a better solution? Have i missed something that does what I want and is included by default?The node exporter provides filesystem metrics under node_filesystem_*
Note the [^a] in sd[^a], i.e. GPPs are named something like /dev/sd[b-z], and you are correct in that you'd usually expect /dev/sda and /dev/sd[b-z] to be devices, however, in the case of GPPs they seem to be filesystems.From one of my GKE nodes:
# mount -l | grep sdb
/dev/sdb on /var/lib/kubelet/pods/2add5b97-5c20-11e7-ba69-42010af0012c/volumes/kubernetes.io~gce-pd/pvc-b28346bf-5687-11e7-ba69-42010af0012c type ext4 (rw,relatime,data=ordered)
On Thu, 29 Jun 2017 at 12:09 Brian Brazil <brian.brazil@robustperception.io> wrote:
On 29 June 2017 at 11:05, Joar Wandborg <jo...@wandborg.se> wrote:AFAICT node_filesystem_* doesn't catch GCE-PD PVs (GPPs) at all. GPPs are usually named ^/dev/sd[^a]$, and I haven't been able to find any node_filesystem_free metrics looking like a GPP, e.g. max node_filesystem_free is 8GB, while I have at least 3 GPPs over 500GB.sda is a device, not a filesystem. File systems have bytes reserved, used and total, and they need to be mounted for you to get that.Brian
Could GPPs or plain PVs be ignored, either intentionally or unintentionally, by the node-exporter?
P.S. I read your post about `predict_linear()`[0] while researching this :)
[0]: https://www.robustperception.io/reduce-noise-from-disk-space-alerts/
On Thu, 29 Jun 2017 at 11:29 Brian Brazil <brian.brazil@robustperception.io> wrote:On 29 June 2017 at 10:25, Joar Wandborg <jo...@wandborg.com> wrote:I need to collect metrics for PersistentVolumes backed by GCE-PDs in order to find out if the volumes are starting to fill up, in which case I'll manually take action by resizing the GCE PD or removing data.
The metrics I need, per PV/GCE-PD, are:
- Bytes total
- Bytes used (preferrably excluding ext "Reserved blocks")
- GCE-PD name *OR* k8s PV(C)? name *OR* k8s Pod name and path.
I've looked into existing solutions for both prometheus and Stackdriver, but haven't been able to find anything.
I have made https://github.com/joar/disk-usage-exporter, which exports disk usage metrics to prometheus, but this approach has a few issues:
- I can't easily get metrics for PVs in Pods created by helm charts.
- I haven't figured out how to reliably get the PV/PVC name of a mounted path from inside the container.
Is there a better solution? Have i missed something that does what I want and is included by default?The node exporter provides filesystem metrics under node_filesystem_*
It occurs to me now that this could be a root/non-root issue.