Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metrics for btrfs commit statistics #3010

Merged

Conversation

maartenberg
Copy link
Contributor

@maartenberg maartenberg commented May 3, 2024

Add four metrics to the btrfs collector to expose statistics on the commits to the filesystem: node_btrfs_commits_total, node_btrfs_last_commit_seconds, node_btrfs_max_commit_seconds, and node_btrfs_commit_seconds_total.

These values were added to the procfs library in prometheus/procfs#580, but not exposed as a metric yet.

Fixes #2734.

Signed-off-by: Maarten van den Berg <[email protected]>
@maartenberg maartenberg force-pushed the maartenberg/expose-btrfs-commit-stats branch from 224d6e9 to cc1aa3c Compare May 3, 2024 14:39
value: float64(s.CommitStats.Commits),
},
{
name: "last_commit_seconds",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we even need last/max, given we can calculate them from total

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SuperQ wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the docs the reported value for the max can be (re)set by writing into the file the statistics are read from (commit_stats), so if that is used I think the value can't be calculated anymore.

@maartenberg
Copy link
Contributor Author

Ping @SuperQ @discordianfish: could you still take a look at this / is there anything else I should do?

Copy link
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok cool, then this LGTM. Thanks!

@SuperQ SuperQ merged commit e8aa4de into prometheus:master Jul 14, 2024
6 checks passed
v-zhuravlev pushed a commit to grafana/node_exporter that referenced this pull request Nov 1, 2024
Signed-off-by: Maarten van den Berg <[email protected]>
Signed-off-by: Vitaly Zhuravlev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Btrfs commit stats
3 participants