Chapter 5. Configuring pmda-openmetrics


Performance Co-Pilot (PCP) is a flexible and extensible system for monitoring and managing system performance. It includes several built-in agents called Performance Metric Domain Agents (PMDAs) that collect metrics from commonly used applications and services, such as PostgreSQL, Apache HTTPD, and KVM virtual machines.

5.1. Overview of pmda-openmetrics

You can run custom or less common applications for which no out-of-the-box PMDA exists in the Red Hat repositories. In such scenarios, the pmda-openmetrics agent helps to bridge the gap. The pmda-openmetrics PMDA exposes performance metrics from arbitrary applications by converting OpenMetrics-style formatted text files into PCP-compatible metrics. OpenMetrics is a widely adopted format used by Prometheus and other monitoring tools, which makes integration easier.

You can run pmda-openmetrics to do the following tasks:

  • Monitor custom applications that are not covered by existing PMDAs.
  • Integrate existing OpenMetrics or Prometheus-exported metrics into the PCP framework.
  • Create quick models or test metrics for diagnostic or demonstration purposes.

5.2. Installing and configuring pmda-openmetrics

You must install and configure pmda-openmetrics before you start using it. The following example demonstrates how to expose a single numeric value from a text file as a PCP metric by using pmda-openmetrics.

Prerequisites

Procedure

  1. Install the pmda-openmetrics PMDA.

    # dnf -y install pcp-pmda-openmetrics
    # cd /var/lib/pcp/pmdas/openmetrics/
    # ./Install
    Copy to Clipboard
  2. Create a sample OpenMetrics file.

    # echo 'var1 {var2="var3"} 42' > /tmp/example.txt
    Copy to Clipboard

    Replace example.txt with the desired file name.

  3. Verify that the file is created correctly.

    # cat /tmp/example.txt
    Copy to Clipboard
  4. Register the metric file path with the OpenMetrics agent.

    # echo "file:///tmp/example.txt" > /etc/pcp/openmetrics/example.url
    Copy to Clipboard
  5. Verify that the configuration is created correctly.

    # cat /etc/pcp/openmetrics/example.url
    Copy to Clipboard
  6. Configure systemd-tmpfiles to create the necessary symlinks.

    # echo 'L+ /var/lib/pcp/pmdas/openmetrics/config.d/example.url - - - - ../../../../../../etc/pcp/openmetrics/example.url' \ > /usr/lib/tmpfiles.d/pcp-pmda-openmetrics-cust.conf
    Copy to Clipboard
  7. Verify that the symlinks are configured correctly.

    # cat /usr/lib/tmpfiles.d/pcp-pmda-openmetrics-cust.conf
    Copy to Clipboard
  8. Create the symlinks by applying the tmpfiles configuration.

    # systemd-tmpfiles --create --remove /usr/lib/tmpfiles.d/pcp-pmda-openmetrics-cust.conf
    Copy to Clipboard
  9. Verify that the symlinks are created correctly.

    # ls -al /var/lib/pcp/pmdas/openmetrics/config.d/
    Copy to Clipboard
  10. Verify that the metric is correctly reported.

    # pminfo -f openmetrics.example.var1
        inst [0 or "0 var2:var3"] value 42
    Copy to Clipboard

Verification

  • Run pcp and confirm that openmetrics is listed.
  • Run systemd-analyze cat-config tmpfiles.d and confirm that example.url appears in the output.
  • Use pminfo to confirm the presence and value of the metric.
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat