grafana-flowcharting
grafana-flowcharting copied to clipboard
Mapping multiple metrics in one rule
Hello,
I am using the plugin 0.8.1.
I added drawing on Grafana and I am trying to get multiple metrics in one rule and apply colouring to each of them. The plan is instead of having 300 rules to have 5 matching groups (mappings) where the same rule applies.
For instance, I have A1111_status, A1112_status,..., Axxxx_status. Each of them can have 5 different statuses(& colours) and I do not manage to find the correct expression in order to get all the different values.
I have already tried to apply different expressions like the following on the 'Apply to metrics' and 'Color/Tooltip value':
/(A.+)_status/ /.(?i)$_status/ ^/(A.+)_status/$ ^/.(.+)_status.*/$
See also the pictures below:


Is it possible to succeed that and how?
Thank you in advance!
Best regards, Mirella
If they all end in _status try the following:
/_status/
Hello,
It does not make any difference. I do not get the correct colour/value for each of them individually but just the same value for all.
Any other idea?
Thanks, Mirella
Ok the What should be the object ID. Not the query value.
So in the “apply to metrics” add the /_status/.
Under color/tooltip add the value of the flowchart element that will have its color changed.
If you want to change multiple items then you may need to map to multiple objects or create multiple (one for each object)
To Map to an object the easiest way is to click the chain button under Just to the left of the WHAT field then click the object on the flowchart. This will map the field to that object.
I think what Mirella means is the following scenario
- a query returning 50 metrics, called
A1111_status,A1112_status,A1113_status, ... All these metrics return a numeric value between0and6 - a diagram with 50 objects in it. The object ID's have been set to
A1111,A1112,A1113, ...
We want to color the 50 objects, based on the same tresholds, on their respective status. So the value of A1111_status should color the object with ID A1111, ...
Is this possible using regular expressions in one rule? Like you could extract part of the metric name using a regex capture group and use that to build the ID (like in grafana dashboard variables)? In this case /(A\d+)_status/.
Nope. A mapping is a range of values to a single object. Not a range of values to a range of objects. If you have 50 objects you need 50 mappings.
Get Outlook for Androidhttps://aka.ms/ghei36
From: Jeroen Coussement [email protected] Sent: Wednesday, July 8, 2020 11:42:17 AM To: algenty/grafana-flowcharting [email protected] Cc: Garrett B. Polo [email protected]; Comment [email protected] Subject: Re: [algenty/grafana-flowcharting] Mapping multiple metrics in one rule (#204)
I think what Mirella means is the following scenario
- a query returning 50 metrics, called A1111_status, A1112_status, A1113_status, ... All these metrics return a numeric value between 0 and 6
- a diagram with 50 objects in it. The object ID's have been set to A1111, A1112, A1113, ...
We want to color the 50 objects, based on the same tresholds, on their respective status. So the value of A1111_status should color the object with ID A1111, ...
Is this possible using regular expressions in one rule? Like you could extract part of the metric name using a regex capture group and use that to build the ID (like in grafana dashboard variables)? In this case /(A\d+)_status/.
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/algenty/grafana-flowcharting/issues/204#issuecomment-655630952, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AECW6MTWXBXM2XHBTCE3TJLR2SOWTANCNFSM4OUWJA5A.
Alright,
Is it going to be an option on a a next version of the plugin then? It would be really handy.
And how many mappings could we have?
We have already tried that option but it was a long list of mappings and it takes a long time to load.
Thanks, Mirella
Not sure as I'm not the developer but it was a request I made as well.
The long load time is most likely due to the query size. Try optimizing this as that greatly speed up my graph load times. I have some with graphed with 300 elements in them and once optimized loads in under 2 seconds. Prior to optimization was taking 30 seconds or more.
Get Outlook for Androidhttps://aka.ms/ghei36
From: mirellou [email protected] Sent: Wednesday, July 8, 2020 11:57:32 AM To: algenty/grafana-flowcharting [email protected] Cc: Garrett B. Polo [email protected]; Comment [email protected] Subject: Re: [algenty/grafana-flowcharting] Mapping multiple metrics in one rule (#204)
Alright,
Is it going to be an option on a a next version of the plugin then? It would be really handy.
And how many mappings could we have?
We have already tried that option but it was a long list of mappings and it takes a long time to load.
Thanks, Mirella
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/algenty/grafana-flowcharting/issues/204#issuecomment-655638735, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AECW6MXBHKVCPJQOYWOPGW3R2SQPZANCNFSM4OUWJA5A.
Alright,
Thank you for the answer. The issue is not really the queries in our case but the mappings.
In any case, let's hope that someone has a solution for the mappings or that it will be possible in a future version then.
Br, Mirella
I would love to do the same thing. My query returns multiple Metrics for the objects within the diagram. I would love to be able to map them using the 1 query rather than have 1 metric to 1 object
+1 would really love this feature This would drastically reduce the number of rules required per panel.
+1
I need this feature too
+1 really need it
+1 really need it
It should be easy to change. Multiple queries with different results. So its just needed to check if its from A. or B. or C. etc... Anyways as others mentioned, it doesnt work currently.