The NFS Client input plugin collects data from /proc/self/mountstats. By default, only a limited number of general system-level metrics are collected, including basic read/write counts.
__NOTE__ Many of the metrics, even if tagged with a mount point, are really _per-server_. Thus, if you mount these two shares: `nfs01:/vol/foo/bar` and `nfs01:/vol/foo/baz`, there will be two near identical entries in /proc/self/mountstats. This is a limitation of the metrics exposed by the kernel, not the telegraf plugin.
- __fullstat__ bool: Collect per-operation type metrics. Defaults to false.
- __include_mounts__ list(string): gather metrics for only these mounts. Default is to watch all mounts.
- __exclude_mounts__ list(string): gather metrics for all mounts, except those listed in this option. Excludes take precedence over includes.
- __include_operations__ list(string): List of specific NFS operations to track. See /proc/self/mountstats (the "per-op statistics" section) for complete lists of valid options for NFSv3 and NFSV4. The default is to gather all metrics, but this is almost certainly _not_ what you want (there are 22 operations for NFSv3, and well over 50 for NFSv4). A suggested 'minimal' list of operations to collect for basic usage: `['READ','WRITE','ACCESS','GETATTR','READDIR','LOOKUP','LOOKUP']`
- __exclude_operations__ list(string): Gather all metrics, except those listed. Excludes take precedence over includes.
_N.B._ the `include_mounts` and `exclude_mounts` arguments are both applied to the local mount location (e.g. /mnt/NFS), not the server export (e.g. nfsserver:/vol/NFS). Go regexp patterns can be used in either.
- bytes (integer, bytes) - The total number of bytes exchanged doing this operation. This is bytes sent _and_ received, including overhead _and_ payload. (bytes = OP_bytes_sent + OP_bytes_recv. See nfs_ops below)
- operation - the NFS operation in question. `READ` or `WRITE` for nfsstat, but potentially one of ~20 or ~50, depending on NFS version. A complete list of operations supported is visible in `/proc/self/mountstats`.
Most descriptions come from Reference [[3](https://utcc.utoronto.ca/~cks/space/blog/linux/NFSMountstatsIndex)] and `nfs_iostat.h`. Field order and names are the same as in `/proc/self/mountstats` and the Kernel source.
Please refer to `/proc/self/mountstats` for a list of supported NFS operations, as it changes occasionally.
- inoderevalidates (int, count): How many times cached inode attributes have to be re-validated from the server.
- dentryrevalidates (int, count): How many times cached dentry nodes have to be re-validated.
- datainvalidates (int, count): How many times an inode had its cached data thrown out.
- attrinvalidates (int, count): How many times an inode has had cached inode attributes invalidated.
- vfsopen (int, count): How many times files or directories have been `open()`'d.
- vfslookup (int, count): How many name lookups in directories there have been.
- vfsaccess (int, count): Number of calls to `access()`. (formerly called "vfspermission")
- vfsupdatepage (int, count): Count of updates (and potential writes) to pages.
- vfsreadpage (int, count): Number of pages read.
- vfsreadpages (int, count): Count of how many times a _group_ of pages was read (possibly via `mmap()`?).
- vfswritepage (int, count): Number of pages written.
- vfswritepages (int, count): Count of how many times a _group_ of pages was written (possibly via `mmap()`?)
- vfsgetdents (int, count): Count of directory entry reads with getdents(). These reads can be served from cache and don't necessarily imply actual NFS requests. (formerly called "vfsreaddir")
- vfssetattr (int, count): How many times we've set attributes on inodes.
- vfsflush (int, count): Count of times pending writes have been forcibly flushed to the server.
- vfsfsync (int, count): Count of calls to `fsync()` on directories and files.
- vfslock (int, count): Number of times a lock was attempted on a file (regardless of success or not).
- vfsrelease (int, count): Number of calls to `close()`.
- congestionwait (int, count): Believe unused by the Linux kernel, but it is part of the NFS spec.
- setattrtrunc (int, count): How many times files have had their size truncated.
- extendwrite (int, count): How many times a file has been grown because you're writing beyond the existing end of the file.
- sillyrenames (int, count): Number of times an in-use file was removed (thus creating a temporary ".nfsXXXXXX" file)
- shortreads (int, count): Number of times the NFS server returned less data than requested.
- shortwrites (int, count): Number of times NFS server reports it wrote less data than requested.
- fields (In all cases, the `operations` tag is set to the uppercase name of the NFS operation, _e.g._ "READ", "FSINFO", _etc_. See /proc/self/mountstats for a full list):
- ops (int, count): Total operations of this type.
- trans (int, count): Total transmissions of this type, including retransmissions: `OP_ops - OP_trans = total_retransmissions` (lower is better).
- timeouts (int, count): Number of major timeouts.
- bytes_sent (int, count): Bytes received, including headers (should also be close to on-wire size).
- bytes_recv (int, count): Bytes sent, including headers (should be close to on-wire size).
- queue_time (int, milliseconds): Cumulative time a request waited in the queue before sending this OP type.
- response_time (int, milliseconds): Cumulative time waiting for a response for this OP type.
- total_time (int, milliseconds): Cumulative time a request waited in the queue before sending.
- errors (int, count): Total number operations that complete with tk_status <0(usuallyerrors).Thisisanewfield,presentinkernel>=5.3, mountstats version 1.1