GoshPosh / grafana-meta-queries

Grafana plugin for calculating time period metrics like week over week, month over month and year over year etc.
Apache License 2.0
283 stars 71 forks source link

Add "group by" support for arithmetic calculations #14

Open notz opened 6 years ago

notz commented 6 years ago

If i have a data source the that is group by time and a tag it's should be possible to do the same calcualtion over the same "groups" and set the output name to the "group".

for ($group in keys(A)) { $group = A[$group]*B[$group] }

Gauravshah commented 6 years ago

@notz unable to understand, can you sent in a screenshot of the configuration ? if you are plotting "translate keys to rows" then it should be doing one row at a time. About translating to column then its a different column

notz commented 6 years ago

screen Now i want to add arithmetic to this graph for each grouped value. I don't no the column names because the are changing so it must be dynamic. The arithmetic should be the same for all grouped values.

Itsmedenise commented 6 years ago

Hi,

I had the same problem lately. Let's say I want to monitor how good my caching for specific pages works. I have a metric "cache" with tags for the result (hit or miss) and the name of the page (lets say homepage, productpage, categorypage) To achieve this you can create 6 queries (homepage hit, homepage miss, productpage hit, productpage miss, categorypage hit, categorypage miss) A easier way would be to group them by name of the page (tag_pageName hit, tag_pageName miss)

Unfortunatly the neither the query syntax not the actual calculations (I guess) support that right now.

Example Configurations (Using InfluxDB as Datasource) query editor

sunnut commented 6 years ago

@notz I had the same problem, and the solution is as follow: https://github.com/sunnut/grafana-meta-queries

Gauravshah commented 6 years ago

@sunnut Thanks for brining up interesting feature. Can you raise a PR after rebasing latest changes ? that way all us would be able use it.

stefi994 commented 3 years ago

Is this in any way possible now? or it's still not fixed?

A-Salata commented 2 years ago

Still not fixed :/