Bug 1430070

Summary: RFE: Export pcp metrics in a format that Prometheus can consume
Product: Red Hat Enterprise Linux 7 Reporter: Joe Handzik <joseph.t.handzik>
Component: pcpAssignee: pcp-maint <pcp-maint>
Status: CLOSED ERRATA QA Contact: Michal Kolar <mkolar>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: brolley, fche, lberk, mcermak, mgoodwin, mkolar, myllynen, nathans
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pcp-3.12.2-5.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-04-10 17:04:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1472153    
Bug Blocks:    

Description Joe Handzik 2017-03-07 19:28:52 UTC
Description of problem:

We at HPE (now combined with SGI) are interested in exporting PCP metrics for consumption within Prometheus either via core PCP itself or as a wrapper around individual PMDA components (removing the requirement for core PCP to be present in the environment). See the GSoC project listed here for more info: http://pcp.io/gsoc/2017/ideas.html#prometheus

Version-Release number of selected component (if applicable): N/A


How reproducible: N/A


Steps to Reproduce: N/A

Actual results: N/A


Expected results:N/A


Additional info: HPE is anticipating the availability of an intern resource to collaborate on development and senior engineers to supervise starting May 2017.

Comment 4 Frank Ch. Eigler 2018-02-13 12:05:01 UTC
A set of commits during the pcp 3.12 timeframe added this capability to pmwebd.  See the PROMETHEUS man page section in [man pmwebapi].  It works most easily if pmwebd is
started with some -h HOST parameters, so the NNNNN number(s) are fixed and
known in advance.

   PROMETHEUS
       Prometheus  exporting  of live metrics from a preexisting PMWEBAPI
       context is available:

       The general form of the requests is:

       /pmapi/NNNNN/metrics?target=NAME1,NAME2,...
              Fetch current values for given named metrics.

       For all numeric metrics with the given  NAME  prefixes,  create  a
       prometheus  text  export format giving their current value and re‐
       lated metadata.  The response  has  text/plain  type  rather  than
       JSON,  and  is  designed to be ingested by a Prometheus server, or
       pcp's own pmdaprometheus.

       The native PCP metric metadata (metric name, semantics and  units)
       are  first  output  with the # PCP prefix.  If the units string is
       empty, then none is output.  The units metadata string may contain
       spaces  and  extends  to  the  end of the line.  Prometheus metric
       types are  heuristically  inferred  from  PCP  metric  types,  and
       units/scales  are  converted to base seconds/bytes/count if possi‐
       ble, with a corresponding suffix added to the  metric  name.   PCP
       metric  names are mapped so that . are exchanged with :.  Instance
       domain instances are represented as Prometheus labels with  quoted
       instance names.

         # PCP proc.nprocs instant none
         # HELP proc:nprocs instantaneous number of processes
         # TYPE proc:nprocs gauge
         proc:nprocs 7

Comment 5 Michal Kolar 2018-02-21 15:04:51 UTC
Verified against pcp-3.12.2-5.el7.

Comment 9 errata-xmlrpc 2018-04-10 17:04:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0926