From 46bcb046a0db53cd91b6688d5efcdb95d3fd1598 Mon Sep 17 00:00:00 2001 From: Christopher Dickey Date: Mon, 15 May 2023 10:43:57 -0700 Subject: [PATCH] feat(mountstats): added operations errors feat(mountstats): fixed indentation bug feat(mountstats): fixed indentation bug --- collector/mountstats_linux.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/collector/mountstats_linux.go b/collector/mountstats_linux.go index 9dea6fad..8797503e 100644 --- a/collector/mountstats_linux.go +++ b/collector/mountstats_linux.go @@ -53,6 +53,7 @@ type mountStatsCollector struct { NFSOperationsQueueTimeSecondsTotal *prometheus.Desc NFSOperationsResponseTimeSecondsTotal *prometheus.Desc NFSOperationsRequestTimeSecondsTotal *prometheus.Desc + NFSOperationsErrorsTotal *prometheus.Desc // Transport statistics NFSTransportBindTotal *prometheus.Desc @@ -322,6 +323,13 @@ func NewMountStatsCollector(logger log.Logger) (Collector, error) { nil, ), + NFSOperationsErrorsTotal: prometheus.NewDesc( + prometheus.BuildFQName(namespace, subsystem, "operations_errors_total"), + "Number of errors for a given operation", + opLabels, + nil, + ), + NFSEventInodeRevalidateTotal: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "event_inode_revalidate_total"), "Number of times cached inode attributes are re-validated from the server.", @@ -745,6 +753,13 @@ func (c *mountStatsCollector) updateNFSStats(ch chan<- prometheus.Metric, s *pro float64(op.CumulativeTotalRequestMilliseconds%float64Mantissa)/1000.0, opLabelValues..., ) + + ch <- prometheus.MustNewConstMetric( + c.NFSOperationsErrorsTotal, + prometheus.CounterValue, + float64(op.Errors%float64Mantissa), + opLabelValues..., + ) } ch <- prometheus.MustNewConstMetric(