Este conteúdo não está disponível no idioma selecionado.

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

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

    Replace example.txt with the desired file name.

  3. Verify that the file is created correctly.

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

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

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

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

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

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

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

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

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2026 Red Hat
Voltar ao topo