Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-46757

[Dev] Invalid openmetrics format generated by pcp2openmetrics tool

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • rhel-9.5
    • pcp
    • None
    • None
    • None
    • 1
    • rhel-sst-pt-pcp
    • ssg_platform_tools
    • 1
    • None
    • PCP Sprint 6
    • None
    • None
    • None

      What were you trying to do that didn't work?

      Exporting metrics using pcp2openmetrics tools generates invalid openmetrics format

      Please provide the package NVR for which bug is seen:

      pcp-6.2.2-1.el9

      How reproducible:

      Always

      Steps to reproduce

      1. Start pmcd and pmlogger
         # systemctl restart pmcd pmlogger
        
      1. Run the following command
         #  pcp2openmetrics -a $(ls -1 /var/log/pcp/pmlogger/$(hostname)/*.0 | tail -n 1) -s 1 -F /tmp/x 'hinv.ncpu'
        
      1.  Check the output in /tmp/x file
         #  cat /tmp/x
        

      Expected results

      The /tmp/x file contains data in valid openmetrics format, which can be directly consumed by i.e. pcp-pmda-openmetrics

      Actual results

      # cat /tmp/x
      
      Metric hinv.ncpu details (last fetch: 1716990636)
      :# PCP5 hinv_ncpu 60.0.32 u32 PM_INDOM_NULL discrete 
      # HELP hinv_ncpu number of CPUs in the system
      # TYPE hinv_ncpu gauge
      hinv_ncpu{domainname="localdomain",groupid="993",hostname="vm-10-0-186-57.hosted.upshift.rdu2.redhat.com",machineid="03640ff5862a45f5b2944e3ded241caa",userid="993",agent="linux"} 1 1716990636.2064
      
      

      Major issues in the openmetrics file are the following:

      1. It contains a comment "Metric hinv.ncpu details (last fetch: 1716990636)" which is considered by pcp-pmda-openmetrics as a definition of a new metric.
      2. There is colon at the beginning of the line ":# PCP5 hinv_ncpu 60.0.32 u32 PM_INDOM_NULL discrete" - this makes i.e. the pcp-pmda-openmetrics fail to parse the file.

              rh-ee-lchilton Lauren Chilton
              jkurik@redhat.com Jan Kurik
              pcp-maint pcp-maint
              Jan Kurik Jan Kurik
              Jacob Valdez Jacob Valdez (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: