openebs-archive / monitor-pv

custom stats collector for OpenEBS persistent volumes
Apache License 2.0
4 stars 5 forks source link

Fix "period of no metrics" in monitor-pv exporter #5

Open ksatchit opened 4 years ago

ksatchit commented 4 years ago

Both the functions collect_pv_capacity_metrics() & collect_pv_utilization_metrics() first clear the respective textfiles holding the metrics info before recreating them with latest updated info. However, the procedure to derive these metrics involves kubectl commands and/or system calls with some output parsing. Under cases where these take more than a few seconds & if the prometheus scrape interval is such that it coincides with this state of the textfiles (empty), then the dashboards are prone to show a few seconds worth of "no-metrics". This manifests itself like shown below:

image

This should be fixed. The changes may occur in two phases: