User Tools

Site Tools


Writing /app/www/public/data/meta/development/applications/prometheus-mysql-exporter.meta failed
development:applications:prometheus-mysql-exporter

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
development:applications:prometheus-mysql-exporter [2017/12/05 11:13] adsilvadevelopment:applications:prometheus-mysql-exporter [2021/06/25 10:09] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== Prometheus MySQL Exporter ======
 +
 +We use [[https://github.com/prometheus/mysqld_exporter|mysqld_exporter ]] as a Prometheus exporter for MySQL server metrics. 
 +
 +
 +mysqld_exporter is a platform specific binary which must be deployed on the server where mysqld is running. It basically provides an HTTP endpoint with all the statistics related to the database. This end point is fetched/requested by Prometheus on a periodic basis.
 +
 +
 +The set up is very straight forward.
 +
 +Download the appropriate binary, usually mysqld_exporter-*.*.*.linux-amd64.tar.gz
 +
 +uncompress the archive and set the environment variable as follows:
 +
 +<code>
 +export DATA_SOURCE_NAME='login:password@(hostname:port)/'
 +</code>
 +
 +Then execute the binary:
 +<code>
 +./mysqld_exporter <flags>
 +</code>
 +
 +====== Prometheus Configuration ======
 +
 +Once mysqld_exporter is running and it is confirmed that the endpoint is available, we can configure Prometheus as follows:
 +
 +<code yaml>
 +  - job_name: 'mysql performance'
 +    scrape_interval: 5m
 +    static_configs:
 +      - targets:
 +        - '10.91.100.125:9104'  #sfqadb1
 +</code>
 +
 +**Note:** Due to Errigal's large database size, A single scrape requests takes a few seconds on the server and may hamper the speed of other running applications. Hence it is optimal to keep the scrape interval to 5 minutes or above. 
 +
 +
 +Here is an extensive list of examples of rules that could be applied: [[https://github.com/prometheus/mysqld_exporter/blob/master/example.rules | Example Rules]]
 +
 +For more information on how to setup your own rules in the Errigal environment, 
 +refer: [[https://bitbucket.org/errigal/prometheus-monitoring-config|prometheus-monitoring-config]]