Using prometheus stats with Node Graph

Node Graph seems to be a very promising plugin, but with it’s strict requirements on the data frames is awkward to use. I think I understand why it is that way and I was able to make my services expose Prometheus metrics just the way it wants them.

The only thing that I am missing is support for statistics (mainstat etc.). I wanted to pick the brains of the community so I understand better the design of Node Graph.

Node Graph will not pick up values from a time series even if I name it correctly (e.g. mainstat). There is no way (that I know of) in PromQL to put timeseries data into a label. It seems that the only option is for the monitored service to put value into label just like with nodes and edges, but… it’s rare that process reporting the metric knows something that is globally useful. Example:
I’d like to scale the node/circle size based on number of pods of a given deployment. No one pod knows that information as they do not talk to each other. It is easy to get stats like number of pods, sum of requests processed etc. but it’s based on data from many pods and so no one pod can generate it in arc_ or mainstat label.

In the end it seems to me that the ability to use regular metric values for stats inside Node Graph would be very useful.

I hope that this post does is not too much of a rambling mess and does not come across as me being ungrateful to the great OSS project that Grafana is.

3 Likes

Humbly bumping this up in hope someone can help.

You may try transformations (this is idea, not copy paste solution, so you need a lot of tries - I was never been able to have proper result for my use case):

Thanks for replying. The NodeGraph plugin is notorious for not using the column names and values from transformations. Nevertheless I’ll try this approach for metrics.

Did you get anywhere on this? I’ve sat for about 3-4 hours trying to get nodegraph to render anything using prometheus as the datasource, but as you say - it seems like the transformations are ignored, and all I get is “No data”.

I have crafted the metrics reported by each of my services to look exactly how the plugin wants. While it’s ridiculous, it is effective. But this goes only far enough to get a working graph of services with names. No metrics like throughput, memory usage etc. I have several k8s pods that “implement” logically single node from the NodeGraph so I need to sum the metrics - these are in prometheus and need to be added to the “base” data. I wasn’t able to make that work.

Ah, that’s a shame. It just looks so promising!

Did you look at this one? Service Dependency Graph plugin for Grafana | Grafana Labs

Might try it out later today.