Client side computed metrics

We have internal app that helped us look at metrics in realtime. Some of the metrics like moving average and week over week are pretty helpful. I was looking for support of such metrics on grafana but couldn’t find them. I did read up on grafana’s idea on relying on the backend DB to do it. In case of elastic search it does provide moving average. But I am unable to understand as to why that restriction. The way we look at , it is a function of data representation and not the data itself. So fitting it around the frontend made more sense.

Looker is a similar frontend for analytics and it supports it in a very nice fashion Is there any specific reason not to support it on frontend ?

Is there some place I can start with “computed metrics” ? and probably contribute back to community with these two functionalities ?

For week over week, use the timeshift functionality.

The reason to do it on the backend is performance but yes, it would be possible to do on the frontend.

There is a feature request for this and it is on our roadmap for after the summer:

Thanks @daniellee, I’ll work with the team in regards to the issue. Can you help me with one more query ?

I am looking for ability to join two metrics on client side. I do see that grafana supports showing two metrics on one table but the way it works is that it appends rows of one query with rows of another. It is very helpful to join metrics on a table. For example If we want to plot number of signups , orders by the app ( android vs iOS vs web) then its better to present in following fashion:

Time app signup orders
2017-01-02 web. 100. 150
2017-01-02 iphone 130. 50
2017-01-02 android 200. 450
2017-01-01 web. 160. 350
2017-01-01 iphone 190. 500
2017-01-01 android 70. 45

But grafana can do one of the follows

Time app signup orders
2017-01-02 web:signup. 100.
2017-01-02 web:orders. 150
2017-01-02 iphone:signup 130
2017-01-02 iphone:orders 50
2017-01-02 android:signup 200
2017-01-02 android:orders 450
2017-01-01 web:signup 160
2017-01-01 web:orders 350
2017-01-01 iphone:signup 190
2017-01-01 iphone:orders 500
2017-01-01 android:signup 70
2017-01-01 android:orders 45

Time web:signup web:orders. iphone:signups iphone:orders. android:signups andorid:orders
2017-01-02 . 100. 150 130 50. 200 450
2017-01-01 160. 350. 190. 500. 70. 45

Is this in elasticsearch?

nope, druid.

But I was asking in general from a frontend capability

Answer is no, I think. That would usually be done on the backend - with regex in the table/serie name for example and a group by.

Not sure how is this possible via backend, unless backend supports joins

also time shift functionality moves the existing chart by x points, It is helpful to compare today’s metric with previous weeks metric. In that case the timeshift functionality does not help.

Same thing there. Graphite and Prometheus have timeshift functions that allow you do shift time at a query level.