-
Notifications
You must be signed in to change notification settings - Fork 62
Template variables in aggregators #67
Comments
Hi Francesco |
@jifwin We are also really interested in this feature ! Do you think this represent a big effort ? I was able to do that like 1 month ago but I don't remember which datasource or Grafana version I was using. |
Templating of aggregators parameters is a bit more tricky, but definitely doable. The question is how to handle multi-value variables with many aggregators defined. E.g. var1=[1,2,3], AVG($var1,HOUR) + MAX($var1, HOUR) Or maybe multivalue variables shouldn't be allowed allowed at all? |
I'm not sure I understood your point. |
Yes, currently only "custom" variables seem not working in aggregators and for now it should be ok to support just single value variables. |
Oh really ? That means that if I use any other variable, like store my desired Units in a mysql table I can query them and use them in the query builder ? I didn't know that |
I don't think so. It doesn't matter what type of variable it is. |
@gucharbon Are you OK with support for single-value variables? |
@jifwin Definitely ! 👍 |
Sorry, |
Hi,
I need to use a template variable in an aggregator expression as for example:
$N = 24
and then in aggregator I try to do:
scale($N)
where $N is a "custom" type template variable.
Executing this query I have the following error:
query.metric[1].aggregators[1].factor For input string: "$N"
It seems that variables are not interpolated in aggregators. Is there a way/plan to do this?
thanks!
Francesco
The text was updated successfully, but these errors were encountered: