sitespeedio / grafana-bootstrap-docker

59 stars 77 forks source link

Use variables to configure node index parameter in aliasByNode #3

Open gajus opened 7 years ago

gajus commented 7 years ago

At the moment, all the metric queries use hardcoded node index number to invokealiasByNode function, e.g.

aliasByNode(sitespeed_io.$path.summary.$group.$browser.$connectivity.browsertime.pageTimings.*.median, 8);

Here is an example in the code base,

https://github.com/sitespeedio/grafana-bootstrap-docker/blob/b04d2799862e76b723c2c59b49f4bd32e1e0e4f5/dashboards/pageSummary.json#L627

This makes it very tedious to add new dimensions (e.g. such as this requirement https://github.com/sitespeedio/sitespeed.io/issues/1327).

Consider using variables, e.g.

aliasByNode(sitespeed_io.$path.summary.$group.$browser.$connectivity.browsertime.pageTimings.*.median, $aliasNodeDepth);
gajus commented 7 years ago

Or even smarter approach would be to use a constant that defines a number of new dimensions after the default namespace, default being 1 and add this constant to whatever the metric depth is. Then if user adds a new depth to the data, user would only need to increment the former variable.