Net::Prometheus::ProcessCollector::linux - Process Collector for linux OS
my $prometheus = Net::Prometheus->new;
$prometheus->register( Net::Prometheus::ProcessCollector::linux->new );
This class provides a Net::Prometheus collector instance to provide process-wide metrics for a process running on the linux operating system.
At collection time, if the requested process does not exist, no metrics are returned.
The pid argument allows the collector to collect from processes other than the one actually running the code.
Note also that scraping processes owned by other users may not be possible for non-root users. In particular, most systems do not let non-root users see the "proc/self/fd" directory of processes they don't own. In this case, the process_open_fds metric will not be returned.
$collector = Net::Prometheus::ProcessCollector::linux->new( %args )
As well as the default arguments supported by Net::Prometheus::ProcessCollector, the following extra named arguments are recognised:
The numerical PID to collect information about; defaults to the string "self" allowing the exporter to collect information about itself, even over fork calls.
If the collector is collecting from "self" or from a numerical PID that matches its own PID, then it will subtract 1 from the count of open file handles, to account for the readdir() handle being used to collect that count. If it is collecting a different process, it will not.
Paul Evans <firstname.lastname@example.org>
To install Net::Prometheus, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.