prometheus
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
prometheus [2019/09/29 22:13] – dreiggy | prometheus [2019/10/04 23:50] – dreiggy | ||
---|---|---|---|
Line 3: | Line 3: | ||
* Grafana prometheus dashboard: https:// | * Grafana prometheus dashboard: https:// | ||
* Grafana prometheus percona mysqld dashboard: https:// | * Grafana prometheus percona mysqld dashboard: https:// | ||
+ | * Prometheus rules collection: https:// | ||
Line 8: | Line 9: | ||
<code bash> | <code bash> | ||
sudo useradd node_exporter -s / | sudo useradd node_exporter -s / | ||
+ | mkdir -p / | ||
wget https:// | wget https:// | ||
tar xvfz node_exporter-*.*-amd64.tar.gz | tar xvfz node_exporter-*.*-amd64.tar.gz | ||
- | sudo cp node_exporter-*.*-amd64/ | + | sudo mv node_exporter-*.*-amd64/ |
+ | rm -rf node_exporter-*.*-amd64 | ||
</ | </ | ||
Line 21: | Line 24: | ||
User=node_exporter | User=node_exporter | ||
EnvironmentFile=/ | EnvironmentFile=/ | ||
- | ExecStart=/usr/sbin/ | + | ExecStart=/opt/prom-exporters/ |
[Install] | [Install] | ||
Line 52: | Line 55: | ||
GRANT SELECT ON performance_schema.* TO ' | GRANT SELECT ON performance_schema.* TO ' | ||
FLUSH PRIVILEGES; | FLUSH PRIVILEGES; | ||
+ | </ | ||
+ | |||
+ | Create a mysql password file ''/ | ||
+ | < | ||
+ | [client] | ||
+ | user=mysqld_exporter | ||
+ | password=My_Secure_Password | ||
+ | </ | ||
+ | |||
+ | Change file owner and permission: | ||
+ | < | ||
+ | chown prometheus. / | ||
+ | chmod 600 / | ||
</ | </ | ||
Line 60: | Line 76: | ||
cd mysqld_exporter-0.12.1.linux-amd64 | cd mysqld_exporter-0.12.1.linux-amd64 | ||
chown prometheus. mysqld_exporter | chown prometheus. mysqld_exporter | ||
- | mv mysqld_exporter /usr/local/bin/ | + | mv mysqld_exporter /opt/prom-exporters/ |
cd .. | cd .. | ||
rm -rf mysqld_exporter-0.12.1.linux-amd64* | rm -rf mysqld_exporter-0.12.1.linux-amd64* | ||
Line 68: | Line 84: | ||
< | < | ||
[Unit] | [Unit] | ||
- | Description=MySQL Exporter | + | Description=Prometheus |
- | Wants=network.target | + | |
After=network.target | After=network.target | ||
- | |||
- | [Service] | ||
User=prometheus | User=prometheus | ||
Group=prometheus | Group=prometheus | ||
- | Environment=" | + | |
+ | [Service] | ||
Type=simple | Type=simple | ||
- | ExecStart=/ | ||
Restart=always | Restart=always | ||
+ | ExecStart=/ | ||
+ | --config.my-cnf / | ||
+ | --collect.global_status \ | ||
+ | --collect.info_schema.innodb_metrics \ | ||
+ | --collect.auto_increment.columns \ | ||
+ | --collect.info_schema.processlist \ | ||
+ | --collect.binlog_size \ | ||
+ | --collect.info_schema.tablestats \ | ||
+ | --collect.global_variables \ | ||
+ | --collect.info_schema.query_response_time \ | ||
+ | --collect.info_schema.userstats \ | ||
+ | --collect.info_schema.tables \ | ||
+ | --collect.perf_schema.tablelocks \ | ||
+ | --collect.perf_schema.file_events \ | ||
+ | --collect.perf_schema.eventswaits \ | ||
+ | --collect.perf_schema.indexiowaits \ | ||
+ | --collect.perf_schema.tableiowaits \ | ||
+ | --collect.slave_status \ | ||
+ | --web.listen-address=0.0.0.0: | ||
[Install] | [Install] | ||
Line 90: | Line 122: | ||
sudo systemctl start mysqld_exporter | sudo systemctl start mysqld_exporter | ||
</ | </ | ||
+ | |||
+ | Once the MySQLd Exporter is installed, verify that metrics are being exported: | ||
+ | <code bash> | ||
+ | curl http:// | ||
+ | </ | ||
+ | |||
+ | ===== Usefull links ===== | ||
+ | * About monitoring: https:// | ||
+ |
prometheus.txt · Last modified: 2019/10/04 23:50 by dreiggy