Make filesystem space prediction window configurable (#2844)

Signed-off-by: fitz123 <alugovoi@ordercapital.com>
This commit is contained in:
Anton Lugovoi 2023-11-12 22:10:56 -03:00 committed by GitHub
parent 7333465abf
commit 81fc05c45f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -10,7 +10,7 @@
( (
node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} * 100 < %(fsSpaceFillingUpWarningThreshold)d node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} / node_filesystem_size_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} * 100 < %(fsSpaceFillingUpWarningThreshold)d
and and
predict_linear(node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s}[6h], 24*60*60) < 0 predict_linear(node_filesystem_avail_bytes{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s}[%(fsSpaceFillingUpPredictionWindow)s], 24*60*60) < 0
and and
node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} == 0 node_filesystem_readonly{%(nodeExporterSelector)s,%(fsSelector)s,%(fsMountpointSelector)s} == 0
) )

View file

@ -54,13 +54,19 @@
// 'NodeFilesystemSpaceFillingUp' alerts. These alerts fire if the disk // 'NodeFilesystemSpaceFillingUp' alerts. These alerts fire if the disk
// usage grows in a way that it is predicted to run out in 4h or 1d // usage grows in a way that it is predicted to run out in 4h or 1d
// and if the provided thresholds have been reached right now. // and if the provided thresholds have been reached right now.
// In some cases you'll want to adjust these, e.g. by default Kubernetes // In some cases you'll want to adjust these, e.g., by default, Kubernetes
// runs the image garbage collection when the disk usage reaches 85% // runs the image garbage collection when the disk usage reaches 85%
// of its available space. In that case, you'll want to reduce the // of its available space. In that case, you'll want to reduce the
// critical threshold below to something like 14 or 15, otherwise // critical threshold below to something like 14 or 15, otherwise
// the alert could fire under normal node usage. // the alert could fire under normal node usage.
// Additionally, the prediction window for the alert can be configured
// to account for environments where disk usage can fluctuate within
// a short time frame. By extending the prediction window, you can
// reduce false positives caused by temporary spikes, providing a
// more accurate prediction of disk space issues.
fsSpaceFillingUpWarningThreshold: 40, fsSpaceFillingUpWarningThreshold: 40,
fsSpaceFillingUpCriticalThreshold: 20, fsSpaceFillingUpCriticalThreshold: 20,
fsSpaceFillingUpPredictionWindow: '6h',
// Available disk space (%) thresholds on which to trigger the // Available disk space (%) thresholds on which to trigger the
// 'NodeFilesystemAlmostOutOfSpace' alerts. // 'NodeFilesystemAlmostOutOfSpace' alerts.