Grafana and Prometheus Just Married & PMM Was Born to Monitor Your
Total Page:16
File Type:pdf, Size:1020Kb
23.11.2020 Grafana and Prometheus just married & PMM was born to monitor your DBs 1 Who we are The Company > Founded in 2010 > More than 70 specialists > Specialized in the Middleware Infrastructure > The invisible part of IT > Customers in Switzerland and all over Europe Our Offer > Consulting > Service Level Agreements (SLA) > Trainings > License Management Grafana and Prometheus just married & PMM was born to monitor your DBs 19.11.2020 Page 2 2 23.11.2020 About me Elisa Usai Delivery Manager & Consultant +41 78 638 09 78 elisa.usai[at]dbi-services.com Elisa Usai elisetta1984 Grafana and Prometheus just married & PMM was born to monitor your DBs 19.11.2020 Page 3 3 Agenda Grafana and Prometheus just married & PMM was born to monitor your DBs 19.11.2020 Page 4 4 23.11.2020 Agenda 1.Introduction 2.Percona Monitoring and Management (PMM) tool 3.Monitor your DBs with PMM 4.Conclusion Grafana and Prometheus just married & PMM was born to monitor your DBs 19.11.2020 Page 5 5 Introduction 1 > Monitor a DB 2 > Prometheus > Grafana > The benefits of a marriage 3 4 Grafana and Prometheus just married & PMM was born to monitor your DBs 19.11.2020 Page 6 6 23.11.2020 Introduction Monitor a DB Why is the monitoring so essential? > Services Health > System Optimization > Performance Problems > Business Process Improvement > Capacity Planning What could we monitor? > Databases, Instances > Hosts > CPU, Memory, I/O, Network > Storage, Filesystems > Application Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 7 7 Introduction Monitor a DB And finally what makes the difference nowadays? > Multiple databases > Comparisons between machines, instances configuration > Features > Price Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 8 8 23.11.2020 Introduction Once upon a time… Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 9 9 Introduction Prometheus What is Prometheus? > Open source tool Event monitoring Alerting > 100% community-driven > Apache 2 licence > Go > https://prometheus.io Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 10 10 23.11.2020 Introduction Prometheus push Alertmanager notify Components alerts HTTP pull metrics Prometheus Pushgateway Grafana ServiceJobs Exporter Exporter Short-lived jobs Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 11 11 Introduction Prometheus Some features… > Multi-dimensional data model > PromQL > No reliance on distributed storage > Pull model over HTTP > Service discovery or static configuration > Graphing and dashboarding support When to use it? When not to use it? > Recording numeric time series data (metrics) > If you need 100% accuracy (per-request billing) Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 12 12 23.11.2020 Introduction Grafana What is Grafana? > Open source tool Visualize data Monitoring Performance analysis Alerting > Multiple data sources > Dashboards and plugins > Configurable > https://grafana.com Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 13 13 Introduction Grafana push Alertmanager notify Components alerts HTTP pull metrics Prometheus PromQL data visualization Pushgateway Grafana ServiceJobs Exporter Exporter Short-lived jobs Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 14 14 23.11.2020 Introduction The benefits of a marriage Requirements > Good communication > Solid roots > Common interests Advantages > Living in the same space > Tasks sharing > Stability Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 15 15 Introduction PMM Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 16 16 23.11.2020 Percona Monitoring and Management (PMM) tool 1 > Percona 2 > PMM introduction > PMM server > PMM client 3 > PMM overview 4 Grafana and Prometheus just married & PMM was born to monitor your DBs 19.11.2020 Page 17 17 Percona Monitoring and Management (PMM) tool Percona The story of Percona What is Percona? > Peter Zaitsev > Provider of open source DB solutions > Vadim Tkachenko > Multi-vendor environments > Worked at MySQL AB MySQL > Co-founded Percona (2006) MariaDB MongoDB Postgres > No vendor lock-in > On-premises and Cloud environments Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 18 18 23.11.2020 Percona Monitoring and Management (PMM) tool PMM introduction What is PMM? > Open source tool for monitoring managing MySQL, PostgreSQL and MongoDB performances > Developed by Percona > https://www.percona.com/doc/percona- monitoring-and-management/index.html Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 19 19 Percona Monitoring and Management (PMM) tool PMM introduction Architecture Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 20 20 23.11.2020 Percona Monitoring and Management (PMM) tool PMM server > PMM server as appliance via: 1. Docker image 2. Open Virtual Appliance 3. Amazon Machine Image > Requirements (for option 1) Docker >= 1.12.6 Storage: > 1GB Memory: > 2GB Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 21 21 Percona Monitoring and Management (PMM) tool PMM client > PMM client Agents Exporters > https://www.percona.com/downloads/pmm/ DEB packages for Ubuntu RPM packages for CentOS Generic tarballs Source code > Requirements Different host name Storage: > 100MB Good connection to PMM server Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 22 22 23.11.2020 Percona Monitoring and Management (PMM) tool PMM overview Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 23 23 Percona Monitoring and Management (PMM) tool PMM overview Dashboards > Default Dashboards Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 24 24 23.11.2020 Percona Monitoring and Management (PMM) tool PMM overview Dashboards > Possibility to Create custom Dashboards Import Dashboards Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 25 25 Percona Monitoring and Management (PMM) tool PMM overview Metrics Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 26 26 23.11.2020 Percona Monitoring and Management (PMM) tool PMM overview PMM Settings > Metrics resolution, retention time, telemetry, check for updates, security tool Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 27 27 Percona Monitoring and Management (PMM) tool PMM overview PMM Settings > Diagnostic Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 28 28 23.11.2020 Percona Monitoring and Management (PMM) tool PMM overview Alerting Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 29 29 Percona Monitoring and Management (PMM) tool PMM overview Alerting … using Grafana Alerting feature … using External Prometheus Alertmanager > Integrated into PMM Server > More sophisticated alert rules > Simpler to set-up > Easier to manage many hosts > Configured in the Alert Tab of any dashboard > Maybe integrated into PMM in next releases! graph panel https://grafana.com/docs/grafana/latest/alerting/al https://prometheus.io/docs/alerting/alertmanager/ erts-overview/ https://www.percona.com/blog/2017/02/02/pmm- alerting-with-grafana-working-with-templated- dashboards/ Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 30 30 23.11.2020 Percona Monitoring and Management (PMM) tool PMM overview Alerting … using Grafana Alerting feature … using External Prometheus Alertmanager > Integrated into PMM Server > More sophisticated alert rules > Simpler to set-up > Easier to manage a large number of hosts > Configured in the Alert Tab of any dashboard > Maybe integrated into PMM in next releases! graph panel https://grafana.com/docs/grafana/latest/alerting/ru https://prometheus.io/docs/alerting/alertmanager/ les/ https://www.percona.com/blog/2017/02/02/pmm- alerting-with-grafana-working-with-templated- dashboards/ Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 31 31 Percona Monitoring and Management (PMM) tool PMM overview Prometheus Alertmanager Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 32 32 23.11.2020 Percona Monitoring and Management (PMM) tool PMM overview User Management > Users > Roles Admin Editor Viewer Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 33 33 Percona Monitoring and Management (PMM) tool PMM overview Query Analytics Grafana and Prometheus just married & PMM was born to monitor your DBs19.11.2020 Page 34 34 23.11.2020 Monitor your DBs with PMM 1 > MySQL/MariaDB Monitoring 2 > Galera Cluster Monitoring > Postgres Monitoring > Oracle Monitoring 3 > and much more… 4 Grafana and Prometheus just married & PMM was born to monitor your DBs 19.11.2020 Page 35 35 Percona Monitoring and Management (PMM) tool MySQL/MariaDB Monitoring > PMM user in MySQL 8.0 default_authentication_plugin = caching_sha2_password SHA-256 authentication not supported by PMM PMM user: mysql_native_password! > Adding MySQL/MariaDB service monitoring # pmm-admin add mysql --query-source=slowlog --username=pmm --password=manager