Skip to content

Commit

Permalink
Expose XFS inode statistics (prometheus#1869) (prometheus#1870)
Browse files Browse the repository at this point in the history
* Expose XFS inode statistics (prometheus#1869)

Also fixes prometheus#1177

@SuperQ @discordianfish

Signed-off-by: Ondrej Baudys <obaudys@gmail.com>
Co-authored-by: obaudys@gmail.com <ondrej.baudys@nextgen.net>
  • Loading branch information
2 people authored and oblitorum committed Apr 9, 2024
1 parent fbff7d2 commit 7c82f70
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* [CHANGE]
* [FEATURE]
* [ENHANCEMENT] Include TCP OutRsts in netstat metrics
* [ENHANCEMENT] Added XFS inode operations to XFS metrics
* [BUGFIX]

## 1.0.1 / 2020-06-15
Expand Down
22 changes: 22 additions & 0 deletions collector/fixtures/e2e-64k-page-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2806,6 +2806,28 @@ node_xfs_extent_allocation_extents_allocated_total{device="sda1"} 1
# HELP node_xfs_extent_allocation_extents_freed_total Number of extents freed for a filesystem.
# TYPE node_xfs_extent_allocation_extents_freed_total counter
node_xfs_extent_allocation_extents_freed_total{device="sda1"} 0
# HELP node_xfs_inode_operation_attempts_total Number of times the OS looked for an XFS inode in the inode cache.
# TYPE node_xfs_inode_operation_attempts_total counter
node_xfs_inode_operation_attempts_total{device="sda1"} 5
# HELP node_xfs_inode_operation_attribute_changes_total Number of times the OS explicitly changed the attributes of an XFS inode.
# TYPE node_xfs_inode_operation_attribute_changes_total counter
node_xfs_inode_operation_attribute_changes_total{device="sda1"} 1
# HELP node_xfs_inode_operation_duplicates_total Number of times the OS tried to add a missing XFS inode to the inode cache, but found it had already been added by another process.
# TYPE node_xfs_inode_operation_duplicates_total counter
node_xfs_inode_operation_duplicates_total{device="sda1"} 0
# HELP node_xfs_inode_operation_found_total Number of times the OS looked for and found an XFS inode in the inode cache.
# TYPE node_xfs_inode_operation_found_total counter
node_xfs_inode_operation_found_total{device="sda1"} 1
# HELP node_xfs_inode_operation_missed_total Number of times the OS looked for an XFS inode in the cache, but did not find it.
# TYPE node_xfs_inode_operation_missed_total counter
node_xfs_inode_operation_missed_total{device="sda1"} 4
# HELP node_xfs_inode_operation_reclaims_total Number of times the OS reclaimed an XFS inode from the inode cache to free memory for another purpose.
# TYPE node_xfs_inode_operation_reclaims_total counter
node_xfs_inode_operation_reclaims_total{device="sda1"} 0
# HELP node_xfs_inode_operation_recycled_total Number of times the OS found an XFS inode in the cache, but could not use it as it was being recycled.
# TYPE node_xfs_inode_operation_recycled_total counter
node_xfs_inode_operation_recycled_total{device="sda1"} 0
# HELP node_xfs_read_calls_total Number of read(2) system calls made to files in a filesystem.
# HELP node_xfs_read_calls_total Number of read(2) system calls made to files in a filesystem.
# TYPE node_xfs_read_calls_total counter
node_xfs_read_calls_total{device="sda1"} 28
Expand Down
21 changes: 21 additions & 0 deletions collector/fixtures/e2e-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3210,6 +3210,27 @@ node_xfs_extent_allocation_extents_allocated_total{device="sda1"} 1
# HELP node_xfs_extent_allocation_extents_freed_total Number of extents freed for a filesystem.
# TYPE node_xfs_extent_allocation_extents_freed_total counter
node_xfs_extent_allocation_extents_freed_total{device="sda1"} 0
# HELP node_xfs_inode_operation_attempts_total Number of times the OS looked for an XFS inode in the inode cache.
# TYPE node_xfs_inode_operation_attempts_total counter
node_xfs_inode_operation_attempts_total{device="sda1"} 5
# HELP node_xfs_inode_operation_attribute_changes_total Number of times the OS explicitly changed the attributes of an XFS inode.
# TYPE node_xfs_inode_operation_attribute_changes_total counter
node_xfs_inode_operation_attribute_changes_total{device="sda1"} 1
# HELP node_xfs_inode_operation_duplicates_total Number of times the OS tried to add a missing XFS inode to the inode cache, but found it had already been added by another process.
# TYPE node_xfs_inode_operation_duplicates_total counter
node_xfs_inode_operation_duplicates_total{device="sda1"} 0
# HELP node_xfs_inode_operation_found_total Number of times the OS looked for and found an XFS inode in the inode cache.
# TYPE node_xfs_inode_operation_found_total counter
node_xfs_inode_operation_found_total{device="sda1"} 1
# HELP node_xfs_inode_operation_missed_total Number of times the OS looked for an XFS inode in the cache, but did not find it.
# TYPE node_xfs_inode_operation_missed_total counter
node_xfs_inode_operation_missed_total{device="sda1"} 4
# HELP node_xfs_inode_operation_reclaims_total Number of times the OS reclaimed an XFS inode from the inode cache to free memory for another purpose.
# TYPE node_xfs_inode_operation_reclaims_total counter
node_xfs_inode_operation_reclaims_total{device="sda1"} 0
# HELP node_xfs_inode_operation_recycled_total Number of times the OS found an XFS inode in the cache, but could not use it as it was being recycled.
# TYPE node_xfs_inode_operation_recycled_total counter
node_xfs_inode_operation_recycled_total{device="sda1"} 0
# HELP node_xfs_read_calls_total Number of read(2) system calls made to files in a filesystem.
# TYPE node_xfs_read_calls_total counter
node_xfs_read_calls_total{device="sda1"} 28
Expand Down
35 changes: 35 additions & 0 deletions collector/xfs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,41 @@ func (c *xfsCollector) updateXFSStats(ch chan<- prometheus.Metric, s *xfs.Stats)
desc: "Number of times the directory getdents operation was performed for a filesystem.",
value: float64(s.DirectoryOperation.Getdents),
},
{
name: "inode_operation_attempts_total",
desc: "Number of times the OS looked for an XFS inode in the inode cache.",
value: float64(s.InodeOperation.Attempts),
},
{
name: "inode_operation_found_total",
desc: "Number of times the OS looked for and found an XFS inode in the inode cache.",
value: float64(s.InodeOperation.Found),
},
{
name: "inode_operation_recycled_total",
desc: "Number of times the OS found an XFS inode in the cache, but could not use it as it was being recycled.",
value: float64(s.InodeOperation.Recycle),
},
{
name: "inode_operation_missed_total",
desc: "Number of times the OS looked for an XFS inode in the cache, but did not find it.",
value: float64(s.InodeOperation.Missed),
},
{
name: "inode_operation_duplicates_total",
desc: "Number of times the OS tried to add a missing XFS inode to the inode cache, but found it had already been added by another process.",
value: float64(s.InodeOperation.Duplicate),
},
{
name: "inode_operation_reclaims_total",
desc: "Number of times the OS reclaimed an XFS inode from the inode cache to free memory for another purpose.",
value: float64(s.InodeOperation.Reclaims),
},
{
name: "inode_operation_attribute_changes_total",
desc: "Number of times the OS explicitly changed the attributes of an XFS inode.",
value: float64(s.InodeOperation.AttributeChange),
},
{
name: "read_calls_total",
desc: "Number of read(2) system calls made to files in a filesystem.",
Expand Down

0 comments on commit 7c82f70

Please sign in to comment.