Code review comment for ~rharding/charm-grafana:add-mysql-datasource

Revision history for this message
Richard Harding (rharding) wrote :

Thanks for the initial review.

gypsy-danger is a python project to parse the apache log files from the charmstore that are tossed into swift looking for important juju kpi data. It then loads that data into several tables in a mysql database that then allows for building queries against the parsed data.

The python code project is: https://github.com/canonicalltd/gypsy-danger
and I started a charm that will eventually deploy and cron job the fetching of new apache logs from swift each day (updating the mysql database with new log data each day).

I've gotten this working with hand coding/deploying here at: kpi.jujugui.org where it talks to a mysql server and I've put the gypsy-danger python parser code on it's own server and so I'm working to charm this up.

If I build a new relation for mysql->grafana directly then it adds a second path to add a new grafana datasource. It also breaks the usability. My code needs a database to store parsed data from apache logs. It needs to be the same exact database with the same user/credential as grafana needs to build a dashboard upon. In this way the theory is that:

gypsy-danger needs a database to store data in. It requests from mysql a fresh db, username, password. MySQL provides that and gypsy-danger then starts to populate the database with tables and records of data. Then, gypsy-danger wants to have a visual front end of that data and sends the data source information to grafana for visualization.

In fact, one long term thing in my wishlist, is that gypsy-danger could actually send over a saved dashboard to grafana so that both the datasource and the dashboard are loaded and ready to go out of the box.

I hope that clears up what I'm trying to do with this. Let me know if I'm unclear or I've taken a dark path of wrongness that I should stay away from.

« Back to merge proposal