Adding Prometheus as a Data Source to Grafana

Posted on Tuesday, February 2, 2021


 


I recently wrote a few article on installing Grafana and Prometheus.

http://www.whiteboardcoder.com/2021/01/installing-grafana-on-ubuntu-2004.html [1]
http://www.whiteboardcoder.com/2021/01/installing-prometheus-on-ubuntu-2004.html [2]

Now that I have it set up and I have prometheus ingesting some data I want to hook it into Promtheus and see some beautiful graphs 

Now I want to start getting some real data into it to have something to graph! 

 

 

 

Adding a Data Source

 

I have Prometheus and Grafana running on the same box.
Let me ssh into my box and also pull some ports on the way.

 

  > ssh prometheus -L 3000:localhost:3000 -L 9090:localhost:9090 -L 9100:localhost:9100

 


Now check if prometheus and grafana are running.

 

  > sudo systemctl status grafana-server

 




And Prometheus

 

  > sudo systemctl status prometheus

 

 

OK all looks good.
Now let me open up Grafana.
http://localhost:3000/login

 

 

Click on Configuration and select Data Sources.


Click Add data sources


Click on Select in the Prometheus


Set URL to http://localhost:9090

All other settings leave as is since I have no SSL or anything fancy set up in front of prometheus.

 


Click on Save & Test



Wahoo its working!



Now go back to Data Sources
Now we should see that we have Promtheus as a data source.


 

Testing data

First let me prove I have some node exporter data in prometheus.
Head over to http://localhost:9090/graph


 

 Click on Graph

 Enter node_cpu_seconds_total and click Execute.



 Yeah data

Now back to grafana

 


Click on + and select Dashboard


Click Add New Panel
Enter the query

 

(100 - 100*(avg by (node) (irate(node_cpu_seconds_total{mode="idle"}[15m]))))

 

 


 

Then hit apply



On the right scroll down to Axes and set the Y-Min to 0 and Y-Max to 100 and click Apply


As you can see nothing much is going on my CPU is not taxed
On my computer let me run htop to confirm (if you don’t have htop install it with sudo apt-get install htop

 

  > htop

 

 


Now let’s do something to get our CPU to max out or at least jump up a bit.

Let me install and run stress

 

  > sudo apt-get install stress
   > stress --cpu 2

 

 


 

Wow



 

Run just one cpu

 

 

  > stress --cpu 1

 

 



 

References

 

[1]        Installing Grafana on Ubuntu 20.04

http://www.whiteboardcoder.com/2021/01/installing-grafana-on-ubuntu-2004.html
Accessed 2/2020

[2]        Installing Prometheus on Ubuntu 20.04

http://www.whiteboardcoder.com/2021/01/installing-prometheus-on-ubuntu-2004.html
Accessed 2/2020

 

 

62 comments:

  1. Wow, happy to see this awesome post. I hope this think help any newbie for their awesome work and by the way thanks for share this awesomeness, i thought this was a pretty interesting read when it comes to this topic. Thank you..
    Artificial Intelligence Course

    ReplyDelete
  2. I need to thank you for this very good read and i have bookmarked to check out new things from your post. Thank you very much for sharing such a useful article and will definitely saved and revisit your site.
    Data Science Course

    ReplyDelete
  3. Excellent Blog! I would like to thank you for the efforts you have made in writing this post. Gained lots of knowledge.
    Data Analytics Course

    ReplyDelete
  4. What an incredible message this is. Truly one of the best posts I have ever seen in my life. Wow, keep it up.
    AI Courses in Bangalore

    ReplyDelete
  5. Awesome article. I enjoyed reading your articles. this can be really a good scan for me. wanting forward to reading new articles. maintain the nice work!
    Data Science Courses in Bangalore

    ReplyDelete
  6. I am sure it will help many people. Keep up the good work. It's very compelling and I enjoyed browsing the entire blog.
    Business Analytics Course in Bangalore

    ReplyDelete
  7. I bookmarked your website because this site contains valuable information. I am very satisfied with the quality and the presentation of the articles. Thank you so much for saving great things. I am very grateful for this site.

    Data Science Training in Bangalore

    ReplyDelete
  8. I have voiced some of the posts on your website now, and I really like your blogging style. I added it to my list of favorite blogging sites and will be back soon ...

    Digital Marketing Training in Bangalore

    ReplyDelete
  9. I found Habit to be a transparent site, a social hub that is a conglomerate of buyers and sellers willing to offer digital advice online at a decent cost.

    Artificial Intelligence Training in Bangalore

    ReplyDelete
  10. The Extraordinary blog went amazed by the content that they have developed in a very descriptive manner. This type of content surely ensures the participants explore themselves. Hope you deliver the same near the future as well. Gratitude to the blogger for the efforts.

    Machine Learning Course in Bangalore

    ReplyDelete
  11. Your site is truly cool and this is an extraordinary moving article and If it's not too much trouble share more like that. Thank You..
    Digital Marketing Course in Hyderabad

    ReplyDelete
  12. Thank a lot. You have done excellent job. I enjoyed your blog . Nice efforts
    Data Science Certification in Hyderabad

    ReplyDelete
  13. Very interesting blog. A lot of the blogs I visit nowadays don't really provide anything that I'm interested in, but I'm definitely interested in this one Turkish e Visa is an electronic visa Turkey that allows entry into Turkey. Once available, eligible foreign will be able to complete the online application process without visiting an embassy or consulate.

    ReplyDelete
  14. Great post happy to see this. I thought this was a pretty interesting read when it comes to this topic Information. Thanks..
    Artificial Intelligence Course

    ReplyDelete
  15. Nice Post thank you very much for sharing such a useful information and will definitely saved and revisit your site and i have bookmarked to check out new things frm your post.
    Data Science Course

    ReplyDelete
  16. Really impressed! Everything is a very open and very clear clarification of the issues. It contains true facts. Your website is very valuable. Thanks for sharing.

    Digital Marketing Training in Bangalore

    ReplyDelete
  17. A good blog always contains new and exciting information, and reading it I feel like this blog really has all of these qualities that make it a blog.

    Artificial Intelligence Training in Bangalore

    ReplyDelete
  18. Thanks Your post is so cool and this is an extraordinary moving article and If it's not too much trouble share more like that.
    Digital Marketing Course in Hyderabad

    ReplyDelete
  19. You have done excellent job Thanks a lot and I enjoyed your blog. Great Post.
    Data Science Certification in Hyderabad

    ReplyDelete
  20. Happy to chat on your blog, I feel like I can't wait to read more reliable posts and think we all want to thank many blog posts to share with us.

    Machine Learning Course in Bangalore

    ReplyDelete
  21. I wanted to leave a little comment to support you and wish you the best of luck. We wish you the best of luck in all of your blogging endeavors.

    Data Science Training in Bangalore

    ReplyDelete
  22. What an incredible message this is. Truly one of the best posts I have ever seen in my life. Wow, keep it up.
    AI Courses in Bangalore

    ReplyDelete
  23. I am really enjoying reading your well written articles. I am looking forward to reading new articles. Keep up the good work.
    Data Science Courses in Bangalore

    ReplyDelete
  24. It is a very helpful and very informative blog. I really learned a lot from it thanks for sharing.
    Data Analytics Course

    ReplyDelete
  25. I am sure it will help many people. Keep up the good work. It's very compelling and I enjoyed browsing the entire blog.
    Business Analytics Course in Bangalore

    ReplyDelete
  26. Very good article and liked reading your post, very pleasant to share, I want to tweet this to my followers. Thank you!.
    Digital Marketing Institute in Hyderabad

    ReplyDelete
  27. I am always searching online for articles that can help me and you made some good points in Features also. Keep working, great job
    Data Science Training

    ReplyDelete
  28. First You got a great blog .I will be interested in more similar topics.I commend you for your excellent report on the knowledge that you have shared in this blog.

    digital marketing training in hyderabad
    free digital marketing course in hyderabad

    ReplyDelete
  29. Very interesting post and this is my first time visit here and found so many interesting stuff in your blog especially its discussion. Thanks for the post!
    Digital Marketing Training Institute in Hyderabad

    ReplyDelete
  30. It is late to find this act. At least one should be familiar with the fact that such events exist. I agree with your blog and will come back to inspect it further in the future, so keep your performance going.

    Best Data Analytics Courses in Bangalore

    ReplyDelete
  31. I really appreciate the kind of topics you post here and thanks for sharing us a great information that is actually helpful. Good day!
    AWS Training in Hyderabad

    ReplyDelete
  32. I am hoping the same best effort from you in the future as well and in fact your creative writing skills has inspired me.
    Data Science Course near me

    ReplyDelete
  33. This is an informative and knowledgeable article. therefore, I would like to thank you for your effort in writing this article.
    Best Digital Marketing Courses in Bangalore

    ReplyDelete
  34. I am impressed by the information that you have on this blog. It shows how well you understand this subject.
    Mlops Course

    ReplyDelete
  35. Wonderful blog post. It's absolute magic on your part! Hope you continue like this!
    Data Analytics Training in Bangalore

    ReplyDelete
  36. This is an informative and knowledgeable article. therefore, I would like to thank you for your effort in writing this article.
    Data Science Course in Bangalore

    ReplyDelete
  37. I am sure it will help many people. Keep up the good work. It's very compelling and I enjoyed browsing the entire blog.
    Business Analytics Course in Bangalore

    ReplyDelete
  38. Interesting and attractive information. This blog is really rocking... Yes, the post is very interesting and I enjoy it a lot. What to bring to the airport? You will need your passport, copy of ETV and a valid citizen card when you check-in on your flight to India.

    ReplyDelete
  39. Very informative Blog! There is so much information here that can help thank you for sharing.
    Data Analytics Training in Bangalore

    ReplyDelete
  40. I got to this amazing site not long ago. I actually captured with the piece of resources you have got here. Thanks for making such wonderful blog page.
    Data Science Course in Ahmedabad

    ReplyDelete
  41. I read your excellent post. It's a great job. I enjoyed reading your post for the first time. I want to thank you for this publication. Thank you...

    Data Science Course in Patna

    ReplyDelete
  42. This is an excellent article. I like this topic. I have found a lot of interesting things on this site.Thanks for posting this again.
    Business Analytics Course in Jaipur

    ReplyDelete
  43. Very informative Blog! There is so much information here that can help thank you for sharing.
    Data Analytics Course in Bangalore

    ReplyDelete
  44. Nice post, you give readers a lot to think about and I appreciate that kind of writing.
    Data Science Course Fees

    ReplyDelete
  45. I read your excellent blog post. It's a great job. I enjoyed reading your post for the first time, thank you.
    Data Science Institutes in Bangalore

    ReplyDelete
  46. Very nice job... Thanks for sharing this amazing and educative blog post!
    Data Science Course in Chandigarh

    ReplyDelete
  47. Very interesting blog. A lot of the blogs I see these days don't provide anything that interests me, but I'm really interested in this one. I just thought I would post and let you know.

    Data Science Course in Ernakulam

    ReplyDelete
  48. This is an informative and knowledgeable article. therefore, I would like to thank you for your effort in writing this article.
    Data Scientist Course in Chandigarh

    ReplyDelete
  49. I enjoyed reading your articles. I have bookmarked it and I am looking forward to reading new articles. Thanks for sharing.
    Data Science Course in Ahmedabad

    ReplyDelete
  50. Really impressed! Information shared was very helpful Your website is very valuable. Thanks for sharing.
    Business Analytics Course in Bangalore

    ReplyDelete
  51. Excellently written article and information was helpful. Please keep it up thank for sharing.
    Business Analytics Course in Lucknow

    ReplyDelete
  52. Thanks for your great article which is both informative and innovative: with the latest updates. It was highly invaluable. Travelers can apply Indian tourist visa for US citizens directly for e-visas online. Therefore, the Indian government has developed an easy-to-use online Indian visa application form that makes it easy to apply for a visa.

    ReplyDelete
  53. I finally found a great article here. Quality postings are essential to get visitors to visit the website, that's what this website offers.
    Data Science Course in Indore

    ReplyDelete
  54. Some really good points you wrote here ... Great things ... I think you raised some really interesting points. Keep up the good work.

    Best Data Analytics Courses in Bangalore

    ReplyDelete
  55. Really impressed! Everything is a very open and very clear clarification of the issues. It contains true facts. Your website is very valuable. Thanks for sharing.

    Best Data Analytics Courses in Bangalore

    ReplyDelete
  56. Thank you for your message. I've been thinking about writing a very similar article for the last few weeks, I'll probably keep it short and to the point and link to this article instead if that's interesting. Thank you.

    Business Analytics Course in Ernakulam

    ReplyDelete
  57. Thank you for sharing an amazing & wonderful blog. This content is very useful, informative and valuable in order to enhance knowledge. Keep sharing this type of content with us & keep updating us with new blogs. Apart from this, if anyone who wants to join the Data Science Training institute in Delhi, can contact 9311002620 or visit our website-
    https://htsindia.com/Courses/python/python-with-data-science-training-course

    ReplyDelete
  58. Really, this article is truly one of the best in the article. And this one that I found quite fascinating and should be part of my collection. Very good work!.
    Data Science Training in Amritsar

    ReplyDelete
  59. Learn to use analytics tools and techniques to manage and analyze large sets of data from Data Science training institutes in Bangalore. Learn to take on business challenges and solve problems by uncovering valuable insights from data. Learn from the comprehensively designed curriculum by the industry experts and work on live projects to sharpen your skills.
    Data Scientist Course in Bangalore

    ReplyDelete
  60. Companies are increasingly turning to data for decision-making and are depending on data professionals to do so. Develop strong logical and numerical aptitude and learn to work with R, Python, SQL, Hadoop, and statistical techniques like Linear Regression, Logistic Regression, etc. Sign up for the Data Scientist training in Bangalore, and gain expertise in using sophisticated analytical methods and statistical methods to prepare data for predictive and prescriptive modeling.
    Business Analytics Course in Jaipur

    ReplyDelete
  61. But the companies need skilled persons for their businesses, and the people are coming with less knowledge. That is why the demand for data scientists has increased in the industry.data science course in chandigarh

    ReplyDelete

  62. Really nice and amazing post. I was looking for this kind of information, Keep posting. Thanks for sharing.
    Data Science Courses in Bangalore

    ReplyDelete