Buy Percona ServicesBuy Now!

Using PMM with Amazon RDS

It is possible to use PMM for monitoring Amazon RDS (just like any remote MySQL instance).

First of all, ensure that there is minimal latency between PMM Server and the Amazon RDS instance. Network connectivity can become an issue for Prometheus to scrape metrics with 1 second resolution. We strongly suggest that you run PMM Server on AWS.

Note

If latency is higher than 1 second, you should change the minimum resolution by setting the METRICS_RESOLUTION environment variable when creating and running the PMM Server container. For more information, see What resolution is used for metrics?.

Query Analytics requires Performance Schema as the query source, because the slow query log is stored on AWS side, and QAN agent is not able to read it. Enable the performance_schema option under Parameter Groups on RDS (you will probably need to create a new Parameter Group and set it to the database instance).

It also requires the statements_digest and events_statements_history to be enabled on the RDS instance. For more information, see Configuring Performance Schema.

Note

Because of the previous requirements, it is not possible to collect query analytics for Amazon RDS running a MySQL version prior to 5.6. For MySQL version 5.5 on Amazon RDS, see Monitoring Amazon RDS OS Metrics.

When adding a monitoring instance for Amazon RDS, specify a unique name to distinguish it from the local MySQL instance. If you do not specify a name, it will use the client’s host name.

Create the pmm user with the following privileges on the Amazon RDS instance that you want to monitor:

GRANT SELECT, PROCESS, REPLICATION CLIENT ON *.* TO 'pmm'@'%' IDENTIFIED BY 'pass' WITH MAX_USER_CONNECTIONS 10;
GRANT SELECT, UPDATE, DELETE, DROP ON performance_schema.* TO 'pmm'@'%';

If you have Amazon RDS with a MySQL version prior to 5.7, REPLICATION CLIENT privilege is not available there and has to be excluded from the above statement.

The following example shows how to enable QAN and MySQL metrics monitoring on Amazon RDS:

$ pmm-admin add mysql:metrics --host rds-mysql57.vb81uqbc7tbe.us-west-2.rds.amazonaws.com --user pmm --password pass rds-mysql57
$ pmm-admin add mysql:queries --host rds-mysql57.vb81uqbc7tbe.us-west-2.rds.amazonaws.com --user pmm --password pass rds-mysql57

Note

General system metrics cannot be monitored remotely, because node_exporter requires access to the local file system. This means that the linux:metrics service cannot be used to monitor Amazon RDS instances or any remote MySQL instance.

Monitoring Amazon RDS OS Metrics

You can use Amazon Cloudwatch as the data source in Grafana to monitor OS metrics for Amazon RDS instances. PMM provides the Amazon RDS / Aurora MySQL Metrics dashboard for this.

_images/amazon-rds-os-metrics.png

To set up OS metrics monitoring for Amazon RDS in PMM via Amazon Cloudwatch:

  1. Create an IAM user on the AWS panel for accessing CloudWatch data, and attach the managed policy CloudWatchReadOnlyAccess to it.

  2. Create a credentials file on the host running PMM Server with the following contents:

    [default]
    aws_access_key_id = <your_access_key_id>
    aws_secret_access_key = <your_secret_access_key>
    
  3. Start the pmm-server container with an additional -v flag that specifies the location of the file with the IAM user credentials and mounts it to /usr/share/grafana/.aws/credentials in the container. For example:

    $ docker run -d \
      -p 80:80 \
      --volumes-from pmm-data \
      -v /path/to/file/with/creds:/usr/share/grafana/.aws/credentials \
      --name pmm-server \
      --restart always \
      percona/pmm-server:latest
    

The Amazon RDS / Aurora MySQL Metrics dashboard uses 60 second resolution and shows the average value for each data point. An exception is the CPU Credit Usage graph, which has a 5 minute average and interval length. All data is fetched in real time and not stored anywhere.

This dashboard can be used with any Amazon RDS database engine, including MySQL, Amazon Aurora, etc.

Note

Amazon provides one million Amazon Cloudwatch API requests per month at no additional cost. Past this, it costs $0.01 per 1,000 requests. The pre-defined dashboard performs 15 requests on each refresh and an extra two on initial loading.

For more information, see Amazon CloudWatch Pricing.

Connecting to an Amazon RDS instance using the PMM Add Instance dashboard

New in version 1.5.0.

The PMM Add Instance is now a preferred method to add an Amazon RDS instance to PMM:

_images/pmm.metrics-monitor.add-instance.png

Enter the access key ID and the secret access key of your IAM user to view Amazon RDS instances.

  1. Open the PMM web interface and select the PMM Add Instance dashboard.
  2. Select the Add an AWS RDS MySQL or Aurora MySQL Instance option in the dashboard.
  3. Enter the access key ID and the secret access key of your IAM user.
  4. Click the Discover button for PMM to retrieve the available Amazon RDS instances.
_images/pmm.metrics-monitor.add-instance.1.png

PMM displays the available Amazon RDS instances

For each instance that you would like to monitor, select the Enabled button and enter the user name and password. Click Connect. You can now monitor your instances in the Amazon RDS / Aurora MySQL Metrics.

_images/pmm.metrics-monitor.add-instance.rds-instances.1.png

Enter the DB user name and password to connect to the selected Amazon RDS or Amazon Aurora instance.

Table Of Contents

Previous topic

Managing PMM Client

Next topic

Configuring MySQL for Best Results

Visit Percona Store


General Inquiries

For general inquiries, please send us your question and someone will contact you.