Skip to content

For help, click the link below to get free database assistance or contact our experts for personalized support.

5. Monitor database with Percona Monitoring and Management (PMM)

In this section you will learn how to monitor Percona Server for MySQL cluster with Percona Monitoring and Management (PMM) .

PMM is a client/server application. It includes the PMM Server and the number of PMM Clients running on each node with the database you wish to monitor.

A PMM Client collects server metrics, general system metrics, query analytics and sends it to the server As a user, you connect to the PMM Server to see database metrics on a number of dashboards.

PMM Server and PMM Client are installed separately.

Considerations

  1. Starting with the version 0.10.0, the Operator supports only PMM 3.x versions. The support for PMM 2.x is dropped.
  2. You must run the Operator version 0.10.0 and later to monitor your database with PMM 3.x. Check the Upgrade the Operator tutorial for the update steps.
  3. To use PMM3, PMM Server version must be equal to or newer than the PMM Client.

Install PMM Server

You must have PMM Server up and running. You can run PMM Server as a Docker image, a virtual appliance, or on an AWS instance. Please refer to the official PMM documentation for the installation instructions.

Install PMM Client

PMM Client is installed as a side-car container in the database Pods in your Kubernetes-based environment. To install PMM Client, do the following:

  1. Authorize PMM Client within PMM Server.

    1. PMM3 uses Grafana service accounts to control access to PMM server components and resources. To authenticate in PMM server, you need a service account token. Generate a service account and token . Specify the Admin role for the service account.

      Warning

      When you create a service account token, you can select its lifetime: it can be either a permanent token that never expires or the one with the expiration date. PMM server cannot rotate service account tokens after they expire. So you must take care of reconfiguring PMM Client in this case.

    2. Add the service account token to the pmmservertoken option in the users Secrets object. Use the following command and replace the <my-token> placeholder with your value:

      $ kubectl patch secret/cluster1-secrets -p "$(echo -n '{"data":{"pmmservertoken":"'$(echo -n <my-token> | base64 --wrap=0)'"}}')"
      
      $ kubectl patch secret/cluster1-secrets -p "$(echo -n '{"data":{"pmmservertoken":"'$(echo -n new_key | base64)'"}}')"
      
  2. Update the pmm section in the deploy/cr.yaml file:

    • Set pmm.enabled=true.
    • Specify your PMM Server hostname or an IP address for the pmm.serverHost option. The PMM Server IP address should be resolvable and reachable from within your cluster.
    pmm:
      enabled: true
      image: percona/pmm-client:3.2.0
      serverHost: monitoring-service
    
  3. Apply the changes:

    $ kubectl apply -f deploy/cr.yaml -n <namespace>
    
  4. Check that corresponding Pods are not in a cycle of stopping and restarting. This cycle occurs if there are errors on the previous steps:

    $ kubectl get pods -n <namespace>
    $ kubectl logs  <cluster-name>-mysql-0 -c pmm-client -n <namespace>
    

Check the metrics

Let’s see how the collected data is visualized in PMM.

  1. Log in to PMM Server.

  2. Click MySQL from the left-hand navigation menu.

  3. Select your cluster from the Clusters drop-down menu and the desired time range on the top of the page. You should see the metrics.

  4. Click MySQL → Other dashboards to see the list of available dashboards that allow you to drill down to the metrics you are interested in.

  5. Click Explore from the left-hand navigation menu. In the Metric drop-down, start typing mysql to see the list of available metrics.

  6. To see the data for the selected metric, click Run query.

Next steps

What’s next


Last update: 2025-06-06