Net::P...llector(3pm)

πŸ’… NAME πŸ’…

Okay bestie, gather round, because Net::Prometheus::ProcessCollector is here and she's literally the vibe. This is the manual page for the Net::P...llector(3pm) docs (yes, the title gets truncated like that, it's giving ✨abbreviated✨), and what she does is hand you a process collector for your OS. Periodt. 🫢


✨ SYNOPSIS ✨

use Net::Prometheus::ProcessCollector;

my $collector = Net::Prometheus::ProcessCollector->new;

That's it, that's the whole thing. Two lines and you're living your best life. 🌸


πŸ¦‹ DESCRIPTION πŸ¦‹

So this module-loading package provides a method that attempts to load a process collector appropriate for the host OS it is running on. Basically she reads the room (the room being your operating system) and picks the right collector for it. No cap. πŸŽ€

The following OS-specific modules are provided with this distribution:

  • Net::Prometheus::ProcessCollector::linux

Other OSes may be supported by 3rd-party CPAN modules by following this naming pattern based on the value of the $^O variable on the OS concerned. So like, iykyk β€” if you're on some other OS, someone out there on CPAN might have your back, and they'll name their module after the value of $^O. πŸ’–


πŸ”₯ MAGIC CONSTRUCTORS πŸ”₯

πŸͺ„ new

$collector = Net::Prometheus::ProcessCollector->new( %args );

Attempts to construct a new process collector for the OS named by $^O, passing in any extra arguments into the new constructor for the specific class. She's a matchmaker, fr fr. πŸ’˜

If no perl module is found under the appropriate file name, undef is returned. 😭 If any other error occurs while loading or constructing the instance, the exception is thrown as normal β€” so no silent suffering, she tells on herself. πŸ’€

Typically a process exporter should support the following named arguments:

  • prefix => STR β€” a prefix to prepend on all the exported variable names. If you don't provide it, the default should be process. Little name tag for all your variables. adorable. 🏷️
  • labels => ARRAY β€” extra labels to set on exported variables. If you don't provide it, no extra labels will be set. She's low-maintenance like that. ✨

🧚 for_OS

$collector = Net::Prometheus::ProcessCollector->for_OS( $os, @args );

Attempts to construct a new process collector for the named OS. Cute, right? BUT. πŸ›‘

Listen to me bestie: except under especially-exceptional circumstances, you don't want to call this method. Call new instead. This is the "why are you in the kitchen at 3am" method. new is the main character. πŸ‘‘

πŸ‘‘ AUTHOR πŸ‘‘

Paul Evans <leonerd@leonerd.org.uk>


That's the whole page, gorgeous. 🫢 No notes, she ate. And that little footer at the bottom of the real page? It's perl v5.42.3, dated 2026-08-20, and that's the Net::P...llector(3pm) manual, so now you know exactly which version you're reading. Stay slay, go collect some processes. πŸ’œπŸŒˆβœ¨

πŸ“¦ where this page comes from