Skip to content

Conversation

@vvolkl
Copy link
Contributor

@vvolkl vvolkl commented Jul 28, 2025

The script that gathers the repo information scales not so well with the number of repositories mounted on a machine. On my machine with 21 repos mounted, it takes about 13s. This PR takes it down to 2.5s by doing the following

  • Use the new cvmfs_talk metrics prometheus command when possible. This gathers all of the metrics (except maxfd, which is awkward to get in talk) in one batched operation, removing the overhead of repeated calls to cvmfs_talk

  • Getting the list of mounted repos via cvmfs_config status is a surprisingly slow operation. I bypass this to just parse findmnt and assume all repos are mounted under their name in /cvmfs . There's an option to use the old behavior in case you use non-standard mountpoints. For a future release of cvmfs I think I'll fix this properly by exposing the repository name as a subtype.

As a bonus, this pr includes a bugfix: the expires magic xattr can have the non-numeric value never (fixed root catalog) when mounting the repo with CVMFS_ROOT_HASH set. The script would throw an error in this case. I change the metric to show -1 if the catalog never expires (not sure if that's the idiomatic choice or 0 is preferred).

@vvolkl vvolkl requested a review from jcpunk July 28, 2025 10:09
@vvolkl
Copy link
Contributor Author

vvolkl commented Jul 28, 2025

This is backwards compatible, but for the speedup needs cvmfs/cvmfs#3944 that will be in 2.13.2

@vvolkl
Copy link
Contributor Author

vvolkl commented Jul 28, 2025

PS: also adds metrics for internal affairs. These are mostly interesting to the devs, but will be useful for debugging in case of issues.

@vvolkl vvolkl merged commit ad84dab into main Jul 28, 2025
@vvolkl vvolkl deleted the talk-metrics-prometheus branch July 28, 2025 13:58
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.

3 participants