logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

"Net::Prometheus::ProcessCollector::linux" - Process Collector for linux OS

Author

       Paul Evans <leonerd@leonerd.org.uk>

perl v5.40.0                                       2024-11-09             Net::Prometheus...ollector::linux(3pm)

Constructor

new
          $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:

       pid => STR
           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.

Description

       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.

   OtherProcessCollection
       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.

Name

       "Net::Prometheus::ProcessCollector::linux" - Process Collector for linux OS

Synopsis

          use Net::Prometheus;
          use Net::Prometheus::ProcessCollector::linux;

          my $prometheus = Net::Prometheus->new;

          $prometheus->register( Net::Prometheus::ProcessCollector::linux->new );

See Also