I am working on a new web service where many events are going to be registered in a MySQL database. The idea is that users will change the status of "tickets" and this will all be recorded in this MySQL database.
However, a key point for developing the project is being able to keep an accurate tracking of the behavior of the users as well as the number of "tickets" opened and their changes of status. To do so, I believe some kind of tracking shall be implemented but I am not quite sure how to proceed.
I've used Grafana as a user, so I thought it could provide part of the infrastructure needed. However, I don't know the details on how to pass the data to Grafana. I've heard about InfluxDB and Graphite but I am not quite sure what they are, how they work and how they would relate to a normal MySQL database.
Could someone provide a detailed explanation on how to implement a tracking starting from the simple MySQL database of the web service which registers the current status of the "tickets" at each moment?
Thanks!
Graphite and InfluxDB are both Time Series databases, they're designed to efficiently store series of numeric values that change over time. For an application like what you're describing you'd want to use statsd to accept data from your application and store it in graphite or influxdb so that grafana can then query on it.
For a concrete example, say you want to track the total number of tickets over time. You would instrument your code that opens a new ticket by using a statsd client for whatever language you're using and updating the value of a gauge that tracks the total number of tickets like:
statsdClient.gauge('tickets.total', 123.45);
By doing the same for your other counts (tickets.open
, etc) you can create a number of series in your time series database that track the values of the metrics you're interested in over time, then you'll be able to graph them in grafana.