There are plenty of proprietary DB monitoring services, but did you know there is a great open-source alternative – Percona Monitoring and Management (PMM)? PMM provides monitoring, alerts, and query analysis for MySQL, PostgreSQL, MongoDB, and others. The package is open source, has a large community, and can be set up in minutes.
What do you get once the Percona PMM is set up?
There are 3 main features of Percona Monitoring and Management: monitoring, alerts, and query analytics.
Once you complete the PMM setup, you already have plenty of preset Grafana-based dashboards. These dashboards display the info about:
Your host machine
Disk space forecast
Queries Per Second
These default dashboards are already customisable dashboards that help you keep an eye on the infrastructure.
Real-time alerts notify you if something goes wrong.
PMM helps you with troubleshooting by providing data from a high-level overview to query-level analytics.
5 Steps To Set Up DB Monitoring With PMM
The PMM consists of 2 parts:
PMM Agent should be installed on your database host machine. It will be collecting telemetry data about the host machine and database(s) and sending it to the PMM Server.
Unlike most cloud-based monitoring services, the PMM Server is a part you should also care about. It will store and process all the telemetry data received from agents, and provide UI for analysis.
There are 5 steps to set up PMM for DB monitoring:
Set up a PMM Server
Set up a PMM Agent
Connect the Agent to the Server
Connect DB to the Agent
Customise Dashboards and Alerts
Let’s look into the details of each step.
1. Set up a PMM Server
You can get a fully managed PMM Server at hostedpmm.com in several clicks or deploy it by yourself.
If you want to host a PMM server by yourself, you need a VPS that meets PMM Server requirements. It will be processing all the telemetry data from your infrastructure, so it needs up to 2 GB per monitored DB. The PMM Server will also be storing all the telemetry data for some time. It requires around 1 GB of storage per monitored database per week.
Once you have a VPS, you can install PMM Server. For example, you can use an easy-install script by running
Not everyone wants to set up docker to their DB host machine just for monitoring. The binary package is hard to update compared to the package manager way to install. So we advise using package manager installation.
An option –server-insecure-tls should be used if you haven’t installed SSL certificates to the PMM Server.
💡 This process might be tricky but is recommended for security reasons. You can avoid this routine by getting a fully managed PMM server at hostedpmm.com. There you can get SSL ready PMM server in a few clicks.
After connecting the PMM agent to the PMM Server, you are already able to see your host machine metrics.
But as you can see, there is N/A for all the DB-related metrics. So we need to connect DB to the agent.
4. Connect DB to the Agent
It is good practice to create a dedicated non-superuser account to connect the database instance to PMM Agent. E.g. user with name pmm, password pass, and the necessary permissions.
Connecting your DB to the PMM Agent depends on your DB. Basically, you need to run a command in DB. For example, MySQL commands look like this:
CREATE USER 'pmm'@'localhost' IDENTIFIED BY 'pass' WITH MAX_USER_CONNECTIONS 10;
GRANT SELECT, PROCESS, REPLICATION CLIENT, RELOAD, BACKUP_ADMIN ON *.* TO 'pmm'@'localhost';
Then you should add a service using PMM Server UI
After that, you should be able to see DB metrics in your PMM Server web UI.
The basic DB monitoring setup is done! We can improve it by customising PMM for your needs.
5. Customise Dashboards and Alerts
There are a lot of preset dashboards but you can customize them for your tasks and workflows.
E.g. if you want an alert for some condition, you can easily set it up.
That’s it! 🎉
Now you have great monitoring for your infrastructure setup. You can keep an eye on a load, check drive usage forecast, and scale in advance. Get alerts if something goes wrong and increase the availability of your service. Use query analysis to find out which requests need to be optimised and improve your service responsiveness.The easiest way to get PMM Server for DB monitoring is HostedPMM.
The easiest way to get PMM Server for DB monitoring is HostedPMM.
Get a Hosted PMM Server and Receive a $200 Bonus
The easiest way to get a PMM Server is hostedpmm.com. It takes several clicks and a couple of minutes.
Everyone who signs up through December 31 will receive a $200 bonus credit.
Get open source PMM up and ready for monitoring your databases in a few clicks.
We are excited to announce the launch of the HostedPMM beta release! Hosted PMM is a service that allows you easily spin up a fully managed PMM server for monitoring databases in minutes.
Percona Monitoring and Management (PMM) is an open-source database monitoring package loved by app developers and database administrators. PMM enables database performance monitoring, query analysis, real-time alerting, and much more! However, setting up PMM may be a complex process that involves deployment, network configuration, installing SSL certificates, and connecting agents. Managing PMM may also become a time-consuming distraction requiring specific skills.
HostedPMM removes all this trouble, by providing a ready-to-use PMM server, a perfect solution for database monitoring and query analysis. HostedPMM automates the following operations for each user:
Spawn a virtual machine
Deploy a PMM server to it
Perform initial configuration
Set up DNS and SSL for a custom domain
With HostedPMM you get a fully-functional PMM server in minutes!
PMM is a great open-source solution to find and resolve database issues. But it is a bit complicated to set up and support so we decided to make these processes as easy as possible. I believe that HostedPMM will help you spend more time on the product, not infrastructure.
Sergei Krupnik, HostedPMM Product Owner.
After you start a PMM server with HostedPMM can rely on us continuously taking care of it, including:
PMM server availability
Telemetry data backups
Moreover, HostedPMM users can contact our team for support and assistance to get the most out of PMM using best practice methods for database monitoring.
We need to monitor several high-load MySQL database clusters. Previously we used a self-hosted PMM server and had to do a lot of work that seemed to be unnecessary. We were paying for VPS, kept eye on backups, and even had to monitor our monitoring system. That is ridiculous.
It is great that now we basically can outsource PMM hosting, monitoring, scaling, and support. HostedPMM just works and we are not bothered with these routines anymore.
Valery Panov, Head of Infrastructure team at Ivinco.