Add NFS Server metrics collector. (#803)

* Add NFS Server metrics collector.

* Add File Handles metrics.

* Add nfsd IO stats.

* Add metrics for NFSd threads.

* Add metrics for NFSd read ahead cache.

* Add NFSd network traffic counters.

* Add RPC metrics.

* Add V2 requests metrics.

* Add NFSv3 metrics.

* Add NFSv4 metrics.

* Update reply cache comment.

* Update help text.
This commit is contained in:
Ben Kochie 2018-02-12 17:56:05 +01:00 committed by GitHub
parent 9a5bd5f8e4
commit 6a041692ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 520 additions and 0 deletions

View File

@ -2576,6 +2576,121 @@ node_nfs_rpc_operations 1.218785755e+09
# HELP node_nfs_rpc_retransmissions Number of RPC transmissions performed.
# TYPE node_nfs_rpc_retransmissions counter
node_nfs_rpc_retransmissions 374636
# HELP node_nfsd_connections_total Total number of NFSd TCP connections.
# TYPE node_nfsd_connections_total counter
node_nfsd_connections_total 1
# HELP node_nfsd_disk_bytes_read_total Total NFSd bytes read.
# TYPE node_nfsd_disk_bytes_read_total counter
node_nfsd_disk_bytes_read_total 1.572864e+08
# HELP node_nfsd_disk_bytes_written_total Total NFSd bytes written.
# TYPE node_nfsd_disk_bytes_written_total counter
node_nfsd_disk_bytes_written_total 72864
# HELP node_nfsd_file_handles_stale_total Total number of NFSd stale file handles
# TYPE node_nfsd_file_handles_stale_total counter
node_nfsd_file_handles_stale_total 0
# HELP node_nfsd_packets_total Total NFSd network packets (sent+recieved) by protocol type.
# TYPE node_nfsd_packets_total counter
node_nfsd_packets_total{proto="tcp"} 917
node_nfsd_packets_total{proto="udp"} 55
# HELP node_nfsd_read_ahead_cache_not_found_total Total number of NFSd read ahead cache not found.
# TYPE node_nfsd_read_ahead_cache_not_found_total counter
node_nfsd_read_ahead_cache_not_found_total 0
# HELP node_nfsd_read_ahead_cache_size_blocks How large the read ahead cache is in blocks.
# TYPE node_nfsd_read_ahead_cache_size_blocks gauge
node_nfsd_read_ahead_cache_size_blocks 32
# HELP node_nfsd_reply_cache_hits_total Total number of NFSd Reply Cache hits (client lost server response).
# TYPE node_nfsd_reply_cache_hits_total counter
node_nfsd_reply_cache_hits_total 0
# HELP node_nfsd_reply_cache_misses_total Total number of NFSd Reply Cache an operation that requires caching (idempotent).
# TYPE node_nfsd_reply_cache_misses_total counter
node_nfsd_reply_cache_misses_total 6
# HELP node_nfsd_reply_cache_nocache_total Total number of NFSd Reply Cache non-idempotent operations (rename/delete/…).
# TYPE node_nfsd_reply_cache_nocache_total counter
node_nfsd_reply_cache_nocache_total 18622
# HELP node_nfsd_requests_total Total number NFSd Requests by method and protocol.
# TYPE node_nfsd_requests_total counter
node_nfsd_requests_total{method="Access",proto="v3"} 111
node_nfsd_requests_total{method="Access",proto="v4"} 1098
node_nfsd_requests_total{method="Close",proto="v4"} 2
node_nfsd_requests_total{method="Commit",proto="v3"} 0
node_nfsd_requests_total{method="Commit",proto="v4"} 0
node_nfsd_requests_total{method="Create",proto="v2"} 0
node_nfsd_requests_total{method="Create",proto="v3"} 0
node_nfsd_requests_total{method="Create",proto="v4"} 0
node_nfsd_requests_total{method="DelegPurge",proto="v4"} 0
node_nfsd_requests_total{method="DelegReturn",proto="v4"} 0
node_nfsd_requests_total{method="FsInfo",proto="v3"} 2
node_nfsd_requests_total{method="FsStat",proto="v2"} 2
node_nfsd_requests_total{method="FsStat",proto="v3"} 0
node_nfsd_requests_total{method="GetAttr",proto="v2"} 69
node_nfsd_requests_total{method="GetAttr",proto="v3"} 112
node_nfsd_requests_total{method="GetAttr",proto="v4"} 8179
node_nfsd_requests_total{method="GetFH",proto="v4"} 5896
node_nfsd_requests_total{method="Link",proto="v2"} 0
node_nfsd_requests_total{method="Link",proto="v3"} 0
node_nfsd_requests_total{method="Link",proto="v4"} 0
node_nfsd_requests_total{method="Lock",proto="v4"} 0
node_nfsd_requests_total{method="Lockt",proto="v4"} 0
node_nfsd_requests_total{method="Locku",proto="v4"} 0
node_nfsd_requests_total{method="Lookup",proto="v2"} 4410
node_nfsd_requests_total{method="Lookup",proto="v3"} 2719
node_nfsd_requests_total{method="Lookup",proto="v4"} 5900
node_nfsd_requests_total{method="LookupRoot",proto="v4"} 0
node_nfsd_requests_total{method="MkDir",proto="v2"} 0
node_nfsd_requests_total{method="MkDir",proto="v3"} 0
node_nfsd_requests_total{method="MkNod",proto="v3"} 0
node_nfsd_requests_total{method="Nverify",proto="v4"} 0
node_nfsd_requests_total{method="Open",proto="v4"} 2
node_nfsd_requests_total{method="OpenAttr",proto="v4"} 0
node_nfsd_requests_total{method="OpenConfirm",proto="v4"} 2
node_nfsd_requests_total{method="OpenDgrd",proto="v4"} 0
node_nfsd_requests_total{method="PathConf",proto="v3"} 1
node_nfsd_requests_total{method="PutFH",proto="v4"} 9609
node_nfsd_requests_total{method="Read",proto="v2"} 0
node_nfsd_requests_total{method="Read",proto="v3"} 0
node_nfsd_requests_total{method="Read",proto="v4"} 150
node_nfsd_requests_total{method="ReadDir",proto="v2"} 99
node_nfsd_requests_total{method="ReadDir",proto="v3"} 27
node_nfsd_requests_total{method="ReadDir",proto="v4"} 1272
node_nfsd_requests_total{method="ReadDirPlus",proto="v3"} 216
node_nfsd_requests_total{method="ReadLink",proto="v2"} 0
node_nfsd_requests_total{method="ReadLink",proto="v3"} 0
node_nfsd_requests_total{method="ReadLink",proto="v4"} 0
node_nfsd_requests_total{method="RelLockOwner",proto="v4"} 0
node_nfsd_requests_total{method="Remove",proto="v2"} 0
node_nfsd_requests_total{method="Remove",proto="v3"} 0
node_nfsd_requests_total{method="Remove",proto="v4"} 0
node_nfsd_requests_total{method="Rename",proto="v2"} 0
node_nfsd_requests_total{method="Rename",proto="v3"} 0
node_nfsd_requests_total{method="Rename",proto="v4"} 0
node_nfsd_requests_total{method="Renew",proto="v4"} 1236
node_nfsd_requests_total{method="RestoreFH",proto="v4"} 0
node_nfsd_requests_total{method="RmDir",proto="v2"} 0
node_nfsd_requests_total{method="RmDir",proto="v3"} 0
node_nfsd_requests_total{method="Root",proto="v2"} 0
node_nfsd_requests_total{method="SaveFH",proto="v4"} 0
node_nfsd_requests_total{method="SecInfo",proto="v4"} 0
node_nfsd_requests_total{method="SetAttr",proto="v2"} 0
node_nfsd_requests_total{method="SetAttr",proto="v3"} 0
node_nfsd_requests_total{method="SetAttr",proto="v4"} 0
node_nfsd_requests_total{method="SymLink",proto="v2"} 0
node_nfsd_requests_total{method="SymLink",proto="v3"} 0
node_nfsd_requests_total{method="Verify",proto="v4"} 3
node_nfsd_requests_total{method="WrCache",proto="v2"} 0
node_nfsd_requests_total{method="Write",proto="v2"} 0
node_nfsd_requests_total{method="Write",proto="v3"} 0
node_nfsd_requests_total{method="Write",proto="v4"} 3
# HELP node_nfsd_rpc_errors_total Total number of NFSd RPC errors by error type.
# TYPE node_nfsd_rpc_errors_total counter
node_nfsd_rpc_errors_total{error="auth"} 2
node_nfsd_rpc_errors_total{error="cInt"} 0
node_nfsd_rpc_errors_total{error="fmt"} 1
# HELP node_nfsd_server_rpcs_total Total number of NFSd RPCs.
# TYPE node_nfsd_server_rpcs_total gauge
node_nfsd_server_rpcs_total 18628
# HELP node_nfsd_server_threads Total number of NFSd kernel threads that are running.
# TYPE node_nfsd_server_threads gauge
node_nfsd_server_threads 8
# HELP node_procs_blocked Number of processes blocked waiting for I/O to complete.
# TYPE node_procs_blocked gauge
node_procs_blocked 0
@ -2630,6 +2745,7 @@ node_scrape_collector_success{collector="mountstats"} 1
node_scrape_collector_success{collector="netdev"} 1
node_scrape_collector_success{collector="netstat"} 1
node_scrape_collector_success{collector="nfs"} 1
node_scrape_collector_success{collector="nfsd"} 1
node_scrape_collector_success{collector="qdisc"} 1
node_scrape_collector_success{collector="sockstat"} 1
node_scrape_collector_success{collector="stat"} 1

View File

@ -0,0 +1,11 @@
rc 0 6 18622
fh 0 0 0 0 0
io 157286400 72864
th 8 0 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000
ra 32 0 0 0 0 0 0 0 0 0 0 0
net 972 55 917 1
rpc 18628 3 1 2 0
proc2 18 2 69 0 0 4410 0 0 0 0 0 0 0 0 0 0 0 99 2
proc3 22 2 112 0 2719 111 0 0 0 0 0 0 0 0 0 0 0 27 216 0 2 1 0
proc4 2 2 10853
proc4ops 72 0 0 0 1098 2 0 0 0 0 8179 5896 0 0 0 0 5900 0 0 2 0 2 0 9609 0 2 150 1272 0 0 0 1236 0 0 0 0 3 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

392
collector/nfsd_linux.go Normal file
View File

@ -0,0 +1,392 @@
// Copyright 2018 The Prometheus Authors
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package collector
import (
"fmt"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/procfs"
"github.com/prometheus/procfs/nfs"
)
// A nfsdCollector is a Collector which gathers metrics from /proc/net/rpc/nfsd.
// See: https://www.svennd.be/nfsd-stats-explained-procnetrpcnfsd/
type nfsdCollector struct {
fs procfs.FS
requestsDesc *prometheus.Desc
}
func init() {
registerCollector("nfsd", defaultEnabled, NewNFSdCollector)
}
const (
nfsdSubsystem = "nfsd"
)
// NewNFSdCollector returns a new Collector exposing /proc/net/rpc/nfsd statistics.
func NewNFSdCollector() (Collector, error) {
fs, err := procfs.NewFS(*procPath)
if err != nil {
return nil, fmt.Errorf("failed to open procfs: %v", err)
}
return &nfsdCollector{
fs: fs,
requestsDesc: prometheus.NewDesc(
prometheus.BuildFQName(namespace, nfsdSubsystem, "requests_total"),
"Total number NFSd Requests by method and protocol.",
[]string{"proto", "method"}, nil,
),
}, nil
}
// Update implements Collector.
func (c *nfsdCollector) Update(ch chan<- prometheus.Metric) error {
stats, err := c.fs.NFSdServerRPCStats()
if err != nil {
return fmt.Errorf("failed to retrieve nfsd stats: %v", err)
}
c.updateNFSdReplyCacheStats(ch, &stats.ReplyCache)
c.updateNFSdFileHandlesStats(ch, &stats.FileHandles)
c.updateNFSdInputOutputStats(ch, &stats.InputOutput)
c.updateNFSdThreadsStats(ch, &stats.Threads)
c.updateNFSdReadAheadCacheStats(ch, &stats.ReadAheadCache)
c.updateNFSdNetworkStats(ch, &stats.Network)
c.updateNFSdServerRPCStats(ch, &stats.ServerRPC)
c.updateNFSdRequestsv2Stats(ch, &stats.V2Stats)
c.updateNFSdRequestsv3Stats(ch, &stats.V3Stats)
c.updateNFSdRequestsv4Stats(ch, &stats.V4Ops)
return nil
}
// updateNFSdReplyCacheStats collects statistics for the reply cache.
func (c *nfsdCollector) updateNFSdReplyCacheStats(ch chan<- prometheus.Metric, s *nfs.ReplyCache) {
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(namespace, nfsdSubsystem, "reply_cache_hits_total"),
"Total number of NFSd Reply Cache hits (client lost server response).",
nil,
nil,
),
prometheus.CounterValue,
float64(s.Hits))
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(namespace, nfsdSubsystem, "reply_cache_misses_total"),
"Total number of NFSd Reply Cache an operation that requires caching (idempotent).",
nil,
nil,
),
prometheus.CounterValue,
float64(s.Misses))
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(namespace, nfsdSubsystem, "reply_cache_nocache_total"),
"Total number of NFSd Reply Cache non-idempotent operations (rename/delete/…).",
nil,
nil,
),
prometheus.CounterValue,
float64(s.NoCache))
}
// updateNFSdFileHandlesStats collects statistics for the file handles.
func (c *nfsdCollector) updateNFSdFileHandlesStats(ch chan<- prometheus.Metric, s *nfs.FileHandles) {
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(namespace, nfsdSubsystem, "file_handles_stale_total"),
"Total number of NFSd stale file handles",
nil,
nil,
),
prometheus.CounterValue,
float64(s.Stale))
// NOTE: Other FileHandles entries are unused in the kernel.
}
// updateNFSdInputOutputStats collects statistics for the bytes in/out.
func (c *nfsdCollector) updateNFSdInputOutputStats(ch chan<- prometheus.Metric, s *nfs.InputOutput) {
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(namespace, nfsdSubsystem, "disk_bytes_read_total"),
"Total NFSd bytes read.",
nil,
nil,
),
prometheus.CounterValue,
float64(s.Read))
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(namespace, nfsdSubsystem, "disk_bytes_written_total"),
"Total NFSd bytes written.",
nil,
nil,
),
prometheus.CounterValue,
float64(s.Write))
}
// updateNFSdThreadsStats collects statistics for kernel server threads.
func (c *nfsdCollector) updateNFSdThreadsStats(ch chan<- prometheus.Metric, s *nfs.Threads) {
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(namespace, nfsdSubsystem, "server_threads"),
"Total number of NFSd kernel threads that are running.",
nil,
nil,
),
prometheus.GaugeValue,
float64(s.Threads))
}
// updateNFSdReadAheadCacheStats collects statistics for the read ahead cache.
func (c *nfsdCollector) updateNFSdReadAheadCacheStats(ch chan<- prometheus.Metric, s *nfs.ReadAheadCache) {
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(namespace, nfsdSubsystem, "read_ahead_cache_size_blocks"),
"How large the read ahead cache is in blocks.",
nil,
nil,
),
prometheus.GaugeValue,
float64(s.CacheSize))
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(namespace, nfsdSubsystem, "read_ahead_cache_not_found_total"),
"Total number of NFSd read ahead cache not found.",
nil,
nil,
),
prometheus.CounterValue,
float64(s.NotFound))
}
// updateNFSdNetworkStats collects statistics for network packets/connections.
func (c *nfsdCollector) updateNFSdNetworkStats(ch chan<- prometheus.Metric, s *nfs.Network) {
packetDesc := prometheus.NewDesc(
prometheus.BuildFQName(namespace, nfsdSubsystem, "packets_total"),
"Total NFSd network packets (sent+recieved) by protocol type.",
[]string{"proto"},
nil,
)
ch <- prometheus.MustNewConstMetric(
packetDesc,
prometheus.CounterValue,
float64(s.UDPCount), "udp")
ch <- prometheus.MustNewConstMetric(
packetDesc,
prometheus.CounterValue,
float64(s.TCPCount), "tcp")
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(namespace, nfsdSubsystem, "connections_total"),
"Total number of NFSd TCP connections.",
nil,
nil,
),
prometheus.CounterValue,
float64(s.TCPConnect))
}
// updateNFSdServerRPCStats collects statistics for kernel server RPCs.
func (c *nfsdCollector) updateNFSdServerRPCStats(ch chan<- prometheus.Metric, s *nfs.ServerRPC) {
badRPCDesc := prometheus.NewDesc(
prometheus.BuildFQName(namespace, nfsdSubsystem, "rpc_errors_total"),
"Total number of NFSd RPC errors by error type.",
[]string{"error"},
nil,
)
ch <- prometheus.MustNewConstMetric(
badRPCDesc,
prometheus.CounterValue,
float64(s.BadFmt), "fmt")
ch <- prometheus.MustNewConstMetric(
badRPCDesc,
prometheus.CounterValue,
float64(s.BadAuth), "auth")
ch <- prometheus.MustNewConstMetric(
badRPCDesc,
prometheus.CounterValue,
float64(s.BadcInt), "cInt")
ch <- prometheus.MustNewConstMetric(
prometheus.NewDesc(
prometheus.BuildFQName(namespace, nfsdSubsystem, "server_rpcs_total"),
"Total number of NFSd RPCs.",
nil,
nil,
),
prometheus.GaugeValue,
float64(s.RPCCount))
}
// updateNFSdRequestsv2Stats collects statistics for NFSv2 requests.
func (c *nfsdCollector) updateNFSdRequestsv2Stats(ch chan<- prometheus.Metric, s *nfs.V2Stats) {
const proto = "v2"
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.GetAttr), proto, "GetAttr")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.SetAttr), proto, "SetAttr")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Root), proto, "Root")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Lookup), proto, "Lookup")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.ReadLink), proto, "ReadLink")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Read), proto, "Read")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.WrCache), proto, "WrCache")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Write), proto, "Write")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Create), proto, "Create")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Remove), proto, "Remove")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Rename), proto, "Rename")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Link), proto, "Link")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.SymLink), proto, "SymLink")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.MkDir), proto, "MkDir")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.RmDir), proto, "RmDir")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.ReadDir), proto, "ReadDir")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.FsStat), proto, "FsStat")
}
// updateNFSdRequestsv3Stats collects statistics for NFSv3 requests.
func (c *nfsdCollector) updateNFSdRequestsv3Stats(ch chan<- prometheus.Metric, s *nfs.V3Stats) {
const proto = "v3"
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.GetAttr), proto, "GetAttr")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.SetAttr), proto, "SetAttr")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Lookup), proto, "Lookup")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Access), proto, "Access")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.ReadLink), proto, "ReadLink")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Read), proto, "Read")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Write), proto, "Write")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Create), proto, "Create")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.MkDir), proto, "MkDir")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.SymLink), proto, "SymLink")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.MkNod), proto, "MkNod")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Remove), proto, "Remove")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.RmDir), proto, "RmDir")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Rename), proto, "Rename")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Link), proto, "Link")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.ReadDir), proto, "ReadDir")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.ReadDirPlus), proto, "ReadDirPlus")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.FsStat), proto, "FsStat")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.FsInfo), proto, "FsInfo")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.PathConf), proto, "PathConf")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Commit), proto, "Commit")
}
// updateNFSdRequestsv4Stats collects statistics for NFSv4 requests.
func (c *nfsdCollector) updateNFSdRequestsv4Stats(ch chan<- prometheus.Metric, s *nfs.V4Ops) {
const proto = "v4"
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Access), proto, "Access")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Close), proto, "Close")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Commit), proto, "Commit")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Create), proto, "Create")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.DelegPurge), proto, "DelegPurge")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.DelegReturn), proto, "DelegReturn")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.GetAttr), proto, "GetAttr")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.GetFH), proto, "GetFH")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Link), proto, "Link")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Lock), proto, "Lock")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Lockt), proto, "Lockt")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Locku), proto, "Locku")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Lookup), proto, "Lookup")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.LookupRoot), proto, "LookupRoot")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Nverify), proto, "Nverify")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Open), proto, "Open")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.OpenAttr), proto, "OpenAttr")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.OpenConfirm), proto, "OpenConfirm")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.OpenDgrd), proto, "OpenDgrd")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.PutFH), proto, "PutFH")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Read), proto, "Read")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.ReadDir), proto, "ReadDir")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.ReadLink), proto, "ReadLink")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Remove), proto, "Remove")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Rename), proto, "Rename")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Renew), proto, "Renew")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.RestoreFH), proto, "RestoreFH")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.SaveFH), proto, "SaveFH")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.SecInfo), proto, "SecInfo")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.SetAttr), proto, "SetAttr")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Verify), proto, "Verify")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.Write), proto, "Write")
ch <- prometheus.MustNewConstMetric(c.requestsDesc, prometheus.CounterValue,
float64(s.RelLockOwner), proto, "RelLockOwner")
}

View File

@ -26,6 +26,7 @@ enabled_collectors=$(cat << COLLECTORS
netdev
netstat
nfs
nfsd
qdisc
sockstat
stat