oijkn / Docker-Raspberry-PI-Monitoring

A docker-compose stack solution for monitoring host and containers with Prometheus, Grafana, cAdvisor and NodeExporter.
MIT License
363 stars 55 forks source link

Consistent presentation filters per host instance #14

Closed kurac338 closed 1 year ago

kurac338 commented 2 years ago

Hi, I noticed an issue when using this dashboard with two node-exporter instances, which are collected by the same Prometheus instance.

Description: I have one RPI4 with the entire stack (Docker with: Grafana (using only this dashboard), Prometheus, cAdvisor and node-exporter) very similar to the docker-compose in your own repository.

I also have a RPI3 which only has node-exporter. Once Prometheus picked up the new job (RPI3 node-exporter), it has appeared in this dashboard. But it broke the presentation of: Uptime, RAM Used, SWAP Used metrics. I did not notice if other metrics were affected.

Workaround: As I don't have any experience with GF dashboards, the best thing I could do to temporarily fix this is: Uptime example: time() - node_boot_time_seconds -> time() - node_boot_time_seconds{job=~"$job"} ... I added the same logic/filter to the other metrics mentioned above.

Question: Obviously this was my attempt to quick fix the issue, but I was wondering if the dashboard could be reworked to mitigate this issue properly? In essence is there a way to limit the dashboard to present data ONLY from one job/host instance?

oijkn commented 2 years ago

Thanks for your feedback, I would love to help you but I only have one Raspberry so only one node. Currently I could not reproduce this problem.

martadinata666 commented 2 years ago

You use separate prometheus, and get duplicate dashboard for every Pi, or this one maybe fit your needs https://grafana.com/grafana/dashboards/10619 or https://grafana.com/grafana/dashboards/8321, personally i use last one.

kurac338 commented 2 years ago

@martadinata666 I have thought about that option, and it is certainly valid. However I think that it is somewhat wasteful (in regards to resources) and would require additional maintenance.

@oijkn I believe the issue can be reproduced in your own version of docker-compose.yml by adding an additional node-exporter container instance and publishing it on a different port (i.e. 9101)?

oijkn commented 1 year ago

Can you try my last update, check the README please.

kurac338 commented 1 year ago

Can you try my last update, check the README please.

Hi, unfortunately no, the issue persists. I have attached a screenshot. Let me know if I can help by attaching some logs or configs.

Capture

oijkn commented 1 year ago

Indeed my configuration is for a single node, if you have several nodes you would have to add a variable in Grafana and modify the queries to display the selected node.

oijkn commented 1 year ago

This issue was closed because it has been open for 30 days with no activity.