… Image …

Integrate Prometheus and Grafana and also make their storage persistent …

Nithish Kumar
3 min readJun 30, 2020

Prometheus is a free software application used for event monitoring and alerting. It records real-time metrics in a time series database built using a HTTP pull model, with flexible queries and real-time alerting.
It stores data locally on disk, which helps for fast data storage and fast querying. There is ability to store metrics in remote storage .It collects data in the form of time series.

Grafana is a 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.
As a visualization tool, Grafana is a popular component in monitoring stacks, often used in combination with time series databases such as InfluxDB, Prometheus and Graphite; monitoring platforms such as Sensu,Icinga, Zabbix, Netdata, and PRTG; SIEMs such as Elasticsearch and Splunk; and other data sources.

… Grafana tool using prometheus Database …

Data Persistence is “the continuance of an effect after its cause is removed”. In the context of storing data in a computer system, this means that the data survives after the process with which it was created has ended. In other words, for a data store to be considered persistent, it must write to non-volatile storage.

To Integrate Prometheus and Grafana we are going to use Kubernetes …
Steps to Integrate Prometheus & Grafana …

Step 1: To make data persistent of prometheus and grafana server . Create pvc for both pods … Here is the code …

pvc.yml

Step 2: Write the code for deploying prometheus and grafana …. And expose to world … Here I wrote deplyment and service in single file …

… Deployment …
… Service …

For prometheus Docker image → go to website
For Grafana Docker image → got to website

Step 3: For Automation purpose , I am going to write a kustomization yml code ….

kustomization.yml

Now type the command “ kubectl apply -k . “ in console…
Note : Run the cmd only in the respective folde ,, Means go to folder where u have created kustomization.yml , pvc.yml , task.yml ….

Output :

Prometheus port → 31479 ( It is a random port number )
Grafana Port → 30386 ( It is a random port number )

Prometheus Server

Grafana Server

Finally done with the task …. Thanks for Reading …
Here is the GitHub link..

…. Signing off ….

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Nithish Kumar
Nithish Kumar

Written by Nithish Kumar

Aspiring DevOps/Cloud Engineer. #Believe in you.

No responses yet

Write a response