NovatecConsulting / novatec-service-dependency-graph-panel

A Grafana panel for visualizing a Service Dependency Graph.
Apache License 2.0
191 stars 64 forks source link

[Question] - Prometheus example #94

Open everton-martins opened 3 years ago

everton-martins commented 3 years ago

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?

mariomann commented 3 years ago

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.

eryajf commented 2 years ago

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?

hugodopradofernandes commented 2 years ago

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 commented 2 years ago

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

erachenko23 commented 2 years ago

@hugodopradofernandes

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

Thank you

vipulsodha commented 1 year ago

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