DevOps: Monitoring Tools (Prometheus and Grafana) (2024)

DevOps: Monitoring Tools (Prometheus and Grafana) (1)

DevOps includes software development and IT operations. Its main aim is to automate the systems deployment life cycle and provide continuous delivery without the downtime and with high software quality.

Continuous Monitoring is the process of monitoring each and every phase of DevOps and IT operations lifecycle. This process ensures the health, performance, and reliability of your application.

Prometheus and Grafana are two open-source tools used for monitoring the applications. Prometheus stored the metrics at backend and Grafana visualize those metrics.

“Here is the demonstration of Integration of Prometheus and Grafana”

Deploying Prometheus and Grafana as a pod on Kubernetes by creating resources Deployment, Replicaset, Pods, and service.

DevOps: Monitoring Tools (Prometheus and Grafana) (3)

It is open-source and community-driven. It's all components are available under the Apache 2 License on GitHub.

To create a dockerfile:

Build this image:

docker build -t prome:v1 .

Now Creating Persistent volume, Persistent volume claim, and Prometheus deployment.

To create deployment using this file and expose the deployment to the outside world so that we can access the Prometheus UI from any system into the network:

kubectl create -f prome.ymlkubectl expose deployment prometheus-deployment --port=9090 --type=NodePort
DevOps: Monitoring Tools (Prometheus and Grafana) (4)
DevOps: Monitoring Tools (Prometheus and Grafana) (5)
DevOps: Monitoring Tools (Prometheus and Grafana) (6)

Grafana is multi-platform open-source analytics and interactive visualization web application. It provides charts, graphs, and alerts for the web when connected to supported data sources. It is expandable through a plug-in system. End users can create complex monitoring dashboards using interactive query builders.

To create grafana image:

FROM centos
RUN yum install wget -y
RUN wget https://dl.grafana.com/oss/release/grafana-7.0.3-1.x86_64.rpm
RUN yum install grafana-7.0.3-1.x86_64.rpm -y
WORKDIR /usr/share/grafana
CMD /usr/sbin/grafana-server start && /usr/sbin/grafana-server enable && /bin/bash

Build this image:

docker build -t graf:v1 .

Now creating persistent volume, persistent volume claim, and deployment for grafana.

Now creating PV, PVC, and deployment for grafana and also exposing it to port no 3000.

kubectl create -f grafana_deployment.ymlkubectl expose deployment grafana-deployment --port=3000 --type=NodePort
DevOps: Monitoring Tools (Prometheus and Grafana) (7)
DevOps: Monitoring Tools (Prometheus and Grafana) (8)

Conclusion :

By this, you can successfully integrate Prometheus and Grafana and deploy them on Kubernetes.

DevOps: Monitoring Tools (Prometheus and Grafana) (2024)
Top Articles
Latest Posts
Article information

Author: Kimberely Baumbach CPA

Last Updated:

Views: 5397

Rating: 4 / 5 (61 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Kimberely Baumbach CPA

Birthday: 1996-01-14

Address: 8381 Boyce Course, Imeldachester, ND 74681

Phone: +3571286597580

Job: Product Banking Analyst

Hobby: Cosplaying, Inline skating, Amateur radio, Baton twirling, Mountaineering, Flying, Archery

Introduction: My name is Kimberely Baumbach CPA, I am a gorgeous, bright, charming, encouraging, zealous, lively, good person who loves writing and wants to share my knowledge and understanding with you.