Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] - Prometheus example #94

Open
everton-martins opened this issue Jul 2, 2021 · 6 comments
Open

[Question] - Prometheus example #94

everton-martins opened this issue Jul 2, 2021 · 6 comments
Labels
question Further information is requested

Comments

@everton-martins
Copy link

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 everton-martins added the question Further information is requested label Jul 2, 2021
@mariomann
Copy link
Contributor

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
Copy link

eryajf commented Jul 22, 2021

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
Copy link

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
Copy link

hugodopradofernandes commented Jul 28, 2021

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
Copy link

@hugodopradofernandes

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

Thank you

@vipulsodha
Copy link

vipulsodha commented Sep 25, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants