Monitor MariaDB running in Amazon RDS with Foglight for Databases

I had a customer who was curious if Foglight could be used to monitor MariaDB running in Amazon RDS.  This customer was already monitoring SQL Server and MongoDB with Foglight, and was eager to see if it could extend to this new MariaDB based application.  While MariaDB "should" be functionally equivalent to MySQL, and given that Foglight has a cartridge for MySQL, I figured it would work, but wanted to step through it myself to make sure there were no gotcha's.

After spinning up a MariaDB instance in RDS, using Amazon's free tier (db.t2.micro) and configuring the firewall to allow access from my local Foglight installation, I configured a "MySQL" agent in Foglight via the standard process.

The Foglight agent properties were very straight forward, only needing a host machine, port, and login/password to access the MariaDB instance.  All other properties can be left as default.

After giving it a few minutes, I was starting to see data being collected, and alarms being raised.  There was some missing data (specifically Host OS data, and Tablespace information) however that's to be expected given that I was running an RDS instance, in which case the Host OS data is unavailable.


I was disappointed to see however that Foglight was not capturing information related to SQL Statements in the "Statements" drilldown.  There were a few metrics being displayed, but no captured queries.

What I failed to realize was that while MariaDB and MySQL are functionally equivalent, the "performance_schema" is disabled by default and needs to be enabled.  You can verify this by looking at the "Configuration" drilldown in Foglight, and searching for "performance_schema"

In Amazon RDS, these configurations are stored as "Parameter Groups".  In the RDS console, create a new Parameter Group based on the MariaDB family.  In the new Parameter Group that you create, search for "Performance", and set the "Performance Schema" to 1.

After the "Parameter Group" is defined, with the updated enabling of "performance_schema", you can assign your MariaDB instance to use this new Parameter Group, via the "Modify" interface:

The RDS interface seemed to imply that I could have these take effect right away, however in my case they did not until I performed a full reboot of the database:

Once the database comes back online, you will now see the Statements drilldown populated (after a few minutes of collection) with glorious query performance details!

Hope this helps anyone that may want to configure Foglight to monitor your RDS hosted MariaDB instance!

If you'd like to try this out on your own, please visit the product page below to learn more about Foglight and grab yourself a free trial!

https://www.quest.com/products/foglight-for-mysql/ 

Anonymous