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 a collector for /proc/key-users #2786

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rzimmerman
Copy link

@rzimmerman rzimmerman commented Aug 22, 2023

This collects usage information (per-user) on the Linux kernel keyring

See: https://man7.org/linux/man-pages/man7/keyrings.7.html

It is disabled by default because cardinality is one per-user.

I was going to do a custom scrape for this but I think it fits in the broader /proc scrape world and may be useful.

@SuperQ @discordianfish

@rzimmerman rzimmerman force-pushed the proc-key-users branch 2 times, most recently from c60d0ec to 2727703 Compare August 29, 2023 17:03
@rzimmerman
Copy link
Author

Fixed a typo in the unit tests

This collects usage information (per-user) on the Linux kernel keyring
See: https://man7.org/linux/man-pages/man7/keyrings.7.html

It is disabled by default because cardinality is one-per user.

Signed-off-by: Robert Zimmerman <rzimmerman@cloudflare.com>
}

func (c *keyUsersCollector) getKeyUsers() (map[keyUsersEntry]float64, error) {
file, err := os.Open(procFilePath("key-users"))
Copy link
Member

Choose a reason for hiding this comment

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

Parsing files in /proc is something we do in https://github.com/prometheus/procfs first. Please implement parsing there before adding this to the exporter.

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.

None yet

2 participants