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

Proposing support for many metrics per node / edge

Open ivlcic opened this issue 3 years ago • 5 comments

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.

grafana-diag-label-prop

updateDiagramStyle.ts

ivlcic avatar Jun 08 '21 08:06 ivlcic

Hi , yes i need me too the multiple metrics in one node !! because i have one database but multiple node in diagram image

SN4K3D avatar Sep 24 '21 13:09 SN4K3D

dist.zip

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

graf-diag

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)

ivlcic avatar Sep 27 '21 07:09 ivlcic

Would love if this could become official.

cbryant42 avatar Dec 10 '21 15:12 cbryant42

yeah ... me too.

ivlcic avatar Dec 11 '21 07:12 ivlcic

Hi, is there any plan to incorporate the change? Thanks.

vb8448 avatar Apr 12 '24 14:04 vb8448