Monitoring
Monitoring
predict_linear(mysql_heartbeat_lag_seconds[5m], 60*2)
sum(rate(mysql_global_status_commands_total{command=~"
(commit|rollback)"}[5m])) without (command)
Prometheus + mysqld_exporter
Collect a LOT of data
(e.g. global variables & status)
Embeds basic visualisation console
By default scraps every 15s
A word about
Prometheus vs Graphite
Prometheus does not see a metric as an "event".
Metrics are current value until they are replaced.
You can not see when a metric has been included
in Prometheus.
For Events, Prometheus refers to Elasticsearch.
One tool does one job...
Prometheus will collect data
Exporters will expose data
Grafana will graph data
Grafana
Open Source (Apache 2.0)
Web app
Specialized in visualization
Pluggable
Multiple datasources: prometheus, graphite,
influxdb...
Has an API!
History of Grafana
Grafana is a fork of Kibana 3 ; used to be JS-
Driven.
Now fully featured, requires a database, multi-
projects/users support, etc...
Grafana and Prometheus
Prometheus shipped its own consoles
Now it recommends Grafana and deprecated
its own consoles
Grafana Dashboards
Grafana Dashboards
Time Picker
Configure Prometheus in
Grafana
Configure Prometheus in
Grafana
Prometheus Dashboard
Creating Grafana Dashboards
Takes time
Requires deep knowledge of the tools
Improved over time
Easy to share (json + online library)
Percona Grafana Dashboard
Percona Open Sourced Grafana Dashboards
Covering MySQL, Mongo and Linux monitoring
Part of a bigger picture, PMM, but usable
standalone
Open Source (AGPL!)
https://github.com/percona/grafana-
dashboards
Installing Percona Graphes
Method 1 (RO dashboards)
Enable File dashboards in Grafana
Clone grafana-dashboards to the configured
location (or make a package)
job_name: linux
static_configs:
targets: ['10.0.98.43:9100']
labels:
instance: db1
job_name: mysql
static_configs:
targets: ['10.0.98.43:9104']
labels:
instance: db1
Dashboards
Dashboards
Dashboards
We don't need all of them?
Because Grafana is just viz, you can import
only the one you want (e.g. exclude Mongo)
You can import later any extra dashboard you
need
MySQL Overview
MySQL Overview
MySQL Overview
InnoDB
InnoDB
InnoDB
Replication
Conclusions
Prometheus and Grafana are first-class
monitoring tools
Totally different approach than other tools
Embeddable into your apps
Percona Dashboards gets your graphes ready
in no-time with minimal efforts
Contact