How to Visualize Data that Really Matters to Business with Grafana and MySQL

Published: 25 Apr 2019 by Michelle Tan RSS

So you have a Grafana dashboard that shows failures at 0.01% and that latency is down throughout the company.

But rather than get a pat on the back, “your boss’s boss is saying cut the crap or stop the mumbo jumbo. What does it really mean for our business?” said Peter Zaitsev, CEO of Percona, which offers solutions such as support, management services, consultant training, and custom engineering for MySQL, MariaDB, MongoDB, Postgres and other open source databases.

During GrafanaCon 2019 in L.A., Zaitsev showed attendees how to “visualize what actually matters to business” using Percona’s monitoring and management product, which integrates Grafana to analyze database performance and provide a solution for database monitoring.

Using Grafana and MySQL, Percona has built custom dashboards to showcase metrics such as how many orders are made in a minute or how much money was earned in 24 hours based on the same information that clients already have in their databases. “That is something we have done for a number of our customers and a lot of them love it,” said Zaitsev.

In addition to walking through live demos of two data sets – an e-commerce example and one that shows historic airline data for the United States – Zaitsev outlined three tricks for optimal setup on MySQL before getting started.

Use read-only user for additional safety.

“Bad things can happen due to mistakes or ill intent,” warned Zaitsev.

Set max_execution_time variable to avoid extensively long queries.

As users play with different variables and expand an interval out not to one day, but as far as 10 years, the queries can become very slow. When users realize it’s going to take hours to run the query, they may move on to a different page; however, the query continues to run.

“That means it’s very easy for you to go ahead and completely saturate your server with hundreds of bad queries,” said Zaitsev.

As a solution Zaitsev advised using the max_execution_time option, which is available in MySQL 5.7 or later. This feature allows users to set a time interval after which the system will automatically terminate ongoing queries.

Consider using MySQL replicas for queries.

“If you’re using replication to view some heavy queries, run those from the dedicated slave,” said Zaitsev. “Because, especially if there are complicated dashboards, all those panels run queries in parallel, and if you have 10 to 20 heavy queries running at the same time, they can impact the real-time part of your application.”

Watch all of Zaitsev’s live demos below:

For more from GrafanaCon 2019, check out all the talks on YouTube.

Related Posts

SevOne, a 14-year-old company in the network monitoring space, started using Grafana for self-monitoring and fell in love with it. Now they've developed a feature to live stream data sources.
As Grafana Labs continues to grow, we'd like you to get to know the team members who are building the cool stuff you're using. Meet Hugo, a fullstack developer.
'People seem to notice when the Bloomberg Terminal doesn't work,' said Stig Sorenson, Head of Production Visibility Group at Bloomberg. 'We have had a few outages that were high profile, so about three years ago we decided to embark on a journey where we took telemetry a bit more seriously.'

Related Case Studies

After trying to DIY, Wix embraces Grafana Cloud

Metrics is an important part of Wix’s culture, so Grafana Cloud was chosen to monitor mission-critical systems.

"It doesn’t make sense, price-to-performance, to do it ourselves, so we were looking for a fully-managed solution from a team that had experience running monitoring at scale."
– Alex Ulstein, Head of Monitoring, Wix

DigitalOcean gains new insight with Grafana visualizations

The company relies on Grafana to be the consolidated data visualization and dashboard solution for sharing data.

"Grafana produces beautiful graphs we can send to our customers, works with our Chef deployment process, and is all hosted in-house."
– David Byrd, Product Manager, DigitalOcean

Grafana enhances end user experience for Apica Systems

The company uses Grafana alongside its SaaS product to detect availability and performance issues before they affect users.

"There have been all kinds of dashboard solutions, but Grafana changed that game in terms of being extremely dynamic and hooking in whatever you like."
– Sven Hammar, CEO, Apica Systems