Este contenido no está disponible en el idioma seleccionado.

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

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

7.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 Toggle word wrap
  2. Create a sample OpenMetrics file.

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

    Replace example.txt with the desired file name.

  3. Verify that the file is created correctly.

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

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

    # cat /etc/pcp/openmetrics/example.url
    Copy to Clipboard Toggle word wrap
  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 Toggle word wrap
  7. Verify that the symlinks are configured correctly.

    # cat /usr/lib/tmpfiles.d/pcp-pmda-openmetrics-cust.conf
    Copy to Clipboard Toggle word wrap
  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 Toggle word wrap
  9. Verify that the symlinks are created correctly.

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

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

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.
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat