Net::Prometheus::ProcessCollector::linux - Process Collector for linux OS
Net::Prometheus::ProcessCollector::linux
use Net::Prometheus; use Net::Prometheus::ProcessCollector::linux; 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.
pid
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.
process_open_fds
$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.
"self"
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.
readdir()
Paul Evans <leonerd@leonerd.org.uk>
To install Net::Prometheus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Prometheus
CPAN shell
perl -MCPAN -e shell install Net::Prometheus
For more information on module installation, please visit the detailed CPAN module installation guide.