grafana-flowcharting icon indicating copy to clipboard operation
grafana-flowcharting copied to clipboard

Is it possible to map wildcard metrics to object labels?

Open schors opened this issue 3 years ago • 1 comments

v 1.0.0

There are some graphical objects with labels A1, A3, A4 for example. There are metrics ifOutOctets for example. In my case it is prometheus datasource. So I can easily assign usable names to metrics. ifOutOctets-A1, ifOutCotets-A2, etc.

Is it possible to create only one Rule to handle my simple image?

Actually I am wanting to develop simple network diagram. I need visual info about online state, switch port, their states and STP roles. I have about 15 switches on one image. Each switch has 10 ports. There are abot 150-200 rules at one flowcharting panel.... Actualy it is very simple diagram

schors avatar Jan 20 '22 09:01 schors

Hi Phil,

More flexible and/or templated rules have been discussed before. When the metric names and graphical object names match somehow, it may be possible to generate the rules from your drawing after parsing the mxgraph/drawio file. However, it may need some thought to generalise this for different use-cases, i.e. in my case multiple graphical objects can have the same name but will have a different parent (e.g. output ports of different sensors VT / DSPs / ADC / out:0 and CT / DSPs / ADC / out:0 ).

Alternatively, support for multi-select template variables could be developed for flowcharting rules, e.g. have a template variable like $MyMultiSelect that contains all your different object names [ A1, A2, etc. ], and expand the rule automatically for all metrics in this variable. The metric in the rule could then look like /ifOutCotets-$MyMultiSelect/, and the matching object as $MyMultiSelect. For this a placeholder attribute could be more appropriate than the object-ID or label, since IDs are autogenerated by drawIO and labels can contain all sorts of HTML tags. In my case the graphical object label usually looks like "%name%" while the name attribute holds the actual name of the graphical object.

Kind regards, Dennis

bijwaard avatar Jan 31 '22 10:01 bijwaard