grafana-diagram
grafana-diagram copied to clipboard
Proposing support for many metrics per node / edge
Hi,
We have to show more than one independent metric in a single node and edge.
I made a demo version where you can add metric name as a variable and use it in node/edge labels.
This demo solution is somewhat hackish, so I'll attach it here instead of a pull request.
Hi , yes i need me too the multiple metrics in one node !! because i have one database but multiple node in diagram
Here is my temporary "patched" version. I hope it helps.
I use it with Grafana v7.5.4 (615c153b3a) in production.
You can create "default" query value node as usual and add additional numbers to node text:
Example Re-e_fail, Re-e_in, Re-e_out, Re-i_in, ... are all "query names"/"query result names" in grafana.
Re-e_fail is the default query value that renders node color. $__Re-e_in is a reference to Re-e_in named query result value.
graph TD
%% ...
%% sample node:
Re-e_fail[(Reception <br />_n_ in: $__Re-e_in / out: $__Re-e_out / in dup: $__Re-i_in <br />_n_ failed: $__Re-e_fail / errors: $__Re-err)]
%% sample edge (link)
HFe-e_fail -- Opoint: $__Re-opo-e_in <br />_n_ STA: $__Re-sta-e_in ------> Re-e_fail
%% "<br />_n_" is forced new line
Just a side node: Use short query name / result name strings for template, since node sizing is computed on template names, not values so node size can get unreasonably big. (values are replaced afterwards so sizes are not adjusted to resulting text)
Would love if this could become official.
yeah ... me too.
Hi, is there any plan to incorporate the change? Thanks.