novatec-service-dependency-graph-panel icon indicating copy to clipboard operation
novatec-service-dependency-graph-panel copied to clipboard

[Question] - Prometheus example

Open everton-martins opened this issue 3 years ago • 6 comments

Write your question here Could you give me an example with the prometheus data source? I'm trying to show the service dependencies with the istio metrics

Screenshots

image image

Where and how could we improve the readme?

everton-martins avatar Jul 02 '21 21:07 everton-martins

Hi @everton-martins,

actually this plugin is already compatible with the Prometheus datasource! Here is an example of a corresponding dashboard with Prometheus as datasource:

https://github.com/inspectIT/inspectit-ocelot/blob/master/inspectit-ocelot-demo/grafana/provisioning/prometheus/dashboards/service-graph.json

As far as I see you use an older version of the panel, version 2. With version 2 you need to add a template variable which is called aggregationType, as you can see in your first screenshot.

mariomann avatar Jul 05 '21 06:07 mariomann

actually this plugin is already compatible with the Prometheus datasource! Here is an example of a corresponding dashboard with Prometheus as datasource:

https://github.com/inspectIT/inspectit-ocelot/blob/master/inspectit-ocelot-demo/grafana/provisioning/prometheus/dashboards/service-graph.json

As far as I see you use an older version of the panel, version 2. With version 2 you need to add a template variable which is called aggregationType, as you can see in your first screenshot.

Despite the JSON template, it is still unable to draw any icon based on the PROMETHEUS data. Can you add an example on the Grafana online platform?

eryajf avatar Jul 22 '21 08:07 eryajf

I was able to make it work with prometheus. The issue is that this panel does not respect the names from Transformation "Organize fields". You must use the original field names from prometheus. Maybe it's another issue to be solved..... other transformation works, but renaming with organizefields don't

hugodopradofernandes avatar Jul 28 '21 17:07 hugodopradofernandes

Another solution: Rename the origin and destination:


sum 
(label_replace
(label_replace
(rate (container_network_receive_bytes_total{namespace!=""}[5m]),
"origin","$1","namespace", "(.+)"),
"destination","$1","pod", "(.+)"))
without (namespace)

And then use on widget the origin and destination as field. This way I can do multiple queries, only renaming origin and destination, and they will be added to topology. Example: kubelet(job) --> namespace --> pod Yum must use also the transformation "label to fields"!!!

QUERY A:
sum 
(label_replace
(label_replace
(rate (container_network_receive_bytes_total{namespace!=""}[5m]),
"origin","$1","namespace", "(.+)"),
"destination","$1","pod", "(.+)"))
without (namespace)

QUERY B:
sum 
(label_replace
(label_replace
(rate (container_network_receive_bytes_total{namespace!=""}[5m]),
"origin","$1","job", "(.+)"),
"destination","$1","namespace", "(.+)"))
without (job)

Screenshot_20210728_231217

Screenshot_20210728_231324

hugodopradofernandes avatar Jul 28 '21 18:07 hugodopradofernandes

@hugodopradofernandes

Hello, maybe you can share dashboard/panel in grafana json format?

Thank you

erachenko23 avatar Dec 24 '21 12:12 erachenko23

@hugodopradofernandes hi can you please share the grafana dashboard in json format ?

vipulsodha avatar Sep 25 '22 11:09 vipulsodha