On my Graphite database, I have series that look like this :
server.[server-name].app.[app-name].memory.used
server.[server-name].app.[app-name].memory.committed
For example :
server.backend.app.apiserver.memory.used
server.backend.app.apiserver.memory.committed
server.backend.app.database.memory.used
server.backend.app.database.memory.committed
server.frontend.app.webserver.memory.used
server.frontend.app.webserver.memory.committed
Using Graphana, I would like to plot a single graph where I show the amount of free memory on multiple application based on template values that I may filter by server name(s) or application name(s). I also want the time series to be aliased by the server name and application name.
For example, in the example above, I'd like to see 3 series on a single graph :
Series 1, free memory for backend.apiserver
Series 2, free memory for backend.database
Series 3, free memory for frontend.webserver
I'm able to do this by selecting a single server and a single application in a template using a function such as :
Series A(hidden ) : server.$server.app.$app.memory.used
Series B(visible) : diffSeries(server.$server.app.$app.memory.committed), #A)
However, if want the graph to show multiple servers and multiple applications at once, Series B just becomes a subtraction of all the values in the A series.
An easy answer would be to send the "free" memory data explicitly to Graphite as a third data point on every application, but I was wondering if the Grafana dashboard had a function that could accomplish the same results without tampering with the existing data collection scripts I have.