Raspberry Pi Computing: Monitoring with Prometheus and Grafana by Malcolm Maclean
Author:Malcolm Maclean [Malcolm Maclean]
Language: eng
Format: epub, pdf
Publisher: leanpub.com
Published: 2020-01-27T00:00:00+00:00
Then we restart Prometheus to load our new configuration;
sudo systemctl restart prometheus
Now if we return to our Prometheus GUI (http://10.1.1.110:9090/targets) to check which targets we are scraping we can see three targets, including our new node at 10.1.1.160.
New Prometheus Target
Creating a new graph in Grafana
Rightoâ¦
We now have our custom exporter reading our values successfully, letâs visualize the results in Grafana!
From the Grafana home page select the Add icon (itâs a â+â sign) from the left hand menu bar and from there select dashboard. Technically this is adding a dashboard, but at this stage weâre just going to implement a single graph.
Add a Graph
The next screen will allow us to start the process by either choosing the type of visualisation (Line graph, gauge, table, list etc) or by simply adding a query. In our case weâre going to take a simple route and select âAdd Queryâ. Grafana will use the default visualisation which is the line graph.
Add a Query
Now we are presented with our graph with no data assigned.
Add a Query
By adding a query, we are selecting the data source that will be used to populate the graph. The main source that our Query will be selecting against is already set as the default Prometheus. All that remains for us is to select which metric we want from Prometheus.
We do that by clicking on the âMetricsâ drop down which will provide a range of different potential sources. Scroll down the list and we will see âwaterâ which is the first part of our metric name (the domain) that we assigned. Click on that and we can see the two metrics that we set up to record. Select âwater_depth_metresâ.
Select a Metric
That will instantly add the metric data stream with whatever data has been recorded up to that point. Depending on how fast you are, that could be only a few data points or, as you can see from the graph below, there could be a bit more.
Simple Graph
Spectacularly we have our graph of water depth!
At the moment itâs a static graph, so letâs change it to refresh every minute by selecting the drop-down by the refresh symbol in the top right corner and selecting â1mâ.
Set a refresh rate
Now all we have remaining is to save our masterpiece so that we can load it again as desired. To do this, go to the save icon at the top of the screen and click it.
Save the Graph
The following dialogue will allow us to give our graph a fancy name and then we slick on the âSaveâ button.
Our first Graph
There it is! It looks slightly unusual stuck on the left hand side of the screen, but thatâs because it is a single graph (or panel) in a row that is built for two. As an exercise for the reader, go through the process of adding a second panel by selecting the âAdd Panelâ icon on the top of the screen.
Add a panel
This time select the water temperature as the metric. You might want to move
Download
Raspberry Pi Computing: Monitoring with Prometheus and Grafana by Malcolm Maclean.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(15805)
The Mikado Method by Ola Ellnestam Daniel Brolund(13064)
Hello! Python by Anthony Briggs(12901)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(12115)
Dependency Injection in .NET by Mark Seemann(11950)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(10737)
A Developer's Guide to Building Resilient Cloud Applications with Azure by Hamida Rebai Trabelsi(10535)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(10522)
Grails in Action by Glen Smith Peter Ledbrook(10033)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(9862)
Sass and Compass in Action by Wynn Netherland Nathan Weizenbaum Chris Eppstein Brandon Mathis(9408)
Hit Refresh by Satya Nadella(9040)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(8610)
Kotlin in Action by Dmitry Jemerov(8572)
The Kubernetes Operator Framework Book by Michael Dame(8481)
Exploring Deepfakes by Bryan Lyon and Matt Tora(8304)
Robo-Advisor with Python by Aki Ranin(8258)
Practical Computer Architecture with Python and ARM by Alan Clements(8228)
Implementing Enterprise Observability for Success by Manisha Agrawal and Karun Krishnannair(8199)