Send custom SQL queries into Graphite to visualize your database tables over time.
- Clone this repo.
cp config.sh.example config.sh- Configure your database and Graphite endpoint in the
config.shfile. - Write your SQL queries in the
queries/folder - Run it using
./collect.sh. - Watch your metrics roll into your preferred visualizer (e.g. Grafana)
Graphite requires the labeling the metrics you export. Therefor, query results are expected in two columns: the timeseries name and the actual value.
Optionally, you can add the interval (in seconds) at which the metrics can be expected as a third column.
Beware that, when combining many queries with a UNION statement, they must all have the interval column.
- crontab
- system.d
- Currently it opens a new MySQL session and a new HTTP session to your Graphite endpoint for every SQL file in the
queriesfolder - Don't pass the MySQL password as argument.
- Support posting tags to Graphite