Percona Monitoring and Management (PMM) is a free and open-source platform for managing and monitoring MySQL® and MongoDB® performance. You can run PMM in your own environment for maximum security and reliability. It provides thorough time-based analysis for MySQL® and MongoDB® servers to ensure that your data works as efficiently as possible.

This release offers two new features for both the MySQL Community and Percona Customers:
SELECT into a dashboard!
We addressed 17 new features and improvements, and fixed 17 bugs.
In 1.15 we are introducing the ability to take a SQL SELECT statement and turn the result set into metric series in PMM. The queries are executed at the LOW RESOLUTION level, which by default is every 60 seconds. A key advantage is that you can extend PMM to profile metrics unique to your environment (see users table example), or to introduce support for a table that isn’t part of PMM yet. This feature is on by default and only requires that you edit the configuration file and use vaild YAML syntax. The configuration file is in /usr/local/percona/pmm-client/queries-mysqld.yml.
We’re going to take a fictional MySQL users table that also tracks the number of upvotes and downvotes, and we’ll convert this into two metric series, with a set of seven labels, where each label can also store a value.
Lets look at the output so we understand the goal – take data from a MySQL table and store in PMM, then display as a metric series. Using the Advanced Data Exploration Dashboard you can review your metric series. Exploring the metric series app1_users_metrics_downvotes we see the following:

Lets assume you have the following users table that includes true/false, string, and integer types.
|
1 |
SELECT * FROM `users`<br>+----+------+--------------+-----------+------------+-----------+---------------------+--------+---------+-----------+<br>| id | app | user_type | last_name | first_name | logged_in | active_subscription | banned | upvotes | downvotes |<br>+----+------+--------------+-----------+------------+-----------+---------------------+--------+---------+-----------+<br>| 1 | app2 | unprivileged | Marley | Bob | 1 | 1 | 0 | 100 | 25 |<br>| 2 | app3 | moderator | Young | Neil | 1 | 1 | 1 | 150 | 10 |<br>| 3 | app4 | unprivileged | OConnor | Sinead | 1 | 1 | 0 | 25 | 50 |<br>| 4 | app1 | unprivileged | Yorke | Thom | 0 | 1 | 0 | 100 | 100 |<br>| 5 | app5 | admin | Buckley | Jeff | 1 | 1 | 0 | 175 | 0 |<br>+----+------+--------------+-----------+------------+-----------+---------------------+--------+---------+-----------+ |
We’ll go through a simple example and mention what’s required for each line. The metric series is constructed based on the first line and appends the column name to form metric series. Therefore the number of metric series per table will be the count of columns that are of type GAUGE or COUNTER. This metric series will be called app1_users_metrics_downvotes:
|
1 |
app1_users_metrics: ## leading section of your metric series.<br> query: "SELECT * FROM app1.users" ## Your query. Don't forget the schema name.<br> metrics: ## Required line to start the list of metric items<br> - downvotes: ## Name of the column returned by the query. Will be appended to the metric series.<br> usage: "COUNTER" ## Column value type. COUNTER will make this a metric series.<br> description: "Number of upvotes" ## Helpful description of the column. |
Each column in the SELECT is named in this example, but that isn’t required, you can use a SELECT * as well. Notice the format of schema.table for the query is included.
|
1 |
---<br>app1_users_metrics:<br> query: "SELECT app,first_name,last_name,logged_in,active_subscription,banned,upvotes,downvotes FROM app1.users"<br> metrics:<br> - app:<br> usage: "LABEL"<br> description: "Name of the Application"<br> - user_type:<br> usage: "LABEL"<br> description: "User's privilege level within the Application"<br> - first_name:<br> usage: "LABEL"<br> description: "User's First Name"<br> - last_name:<br> usage: "LABEL"<br> description: "User's Last Name"<br> - logged_in:<br> usage: "LABEL"<br> description: "User's logged in or out status"<br> - active_subscription:<br> usage: "LABEL"<br> description: "Whether User has an active subscription or not"<br> - banned:<br> usage: "LABEL"<br> description: "Whether user is banned or not"<br> - upvotes:<br> usage: "COUNTER"<br> description: "Count of upvotes the User has earned. Upvotes once granted cannot be revoked, so the number can only increase."<br> - downvotes:<br> usage: "GAUGE"<br> description: "Count of downvotes the User has earned. Downvotes can be revoked so the number can increase as well as decrease."<br>... |
We hope you enjoy this feature, and we welcome your feedback via the Percona forums!
We’ve enhanced the volume of data collected from both the Server and Client perspectives. Each service provides a set of files designed to be shared with Percona Support while you work on an issue.
From the Server, we’ve improved the logs.zip service to include:
You retrieve the link from your PMM server using this format: https://pmmdemo.percona.com/managed/logs.zip
On the Client side we’ve added a new action called summary which fetches logs, network, and Percona Toolkit output in order to share with Percona Support. To initiate a Client side collection, execute:
|
1 |
pmm-admin summary |
The output will be a file you can use to attach to your Support ticket. The single file will look something like this:
|
1 |
summary__2018_10_10_16_20_00.tar.gz |
PMM is available for installation using three methods:
docker pull percona/pmm-server – Documentation
Help us improve our software quality by reporting any Percona Monitoring and Management bugs you encounter using our bug tracking system.
Resources
RELATED POSTS