Cloud Computing, DevOps

5 Mins Read

Integration and Visualization of Prometheus Metrics in Grafana

What is Grafana?

Grafana is open source platform for visualization and analytics of the metrics. It helps you to query, alert on, visualize, and explore your metrics from different data sources such as Prometheus, Influx DB, JSON, etc. It offers you the ability to transform your time-series database (TSDB) data into stunning graphs and visualizations. For visualization of all target metrics it can be easily integrated with Prometheus.

In this blog we will learn,

Prerequisite

To continue with this blog and learn it better, there are some prerequisites which are required.

  1. You must have a Prometheus Server setup configured with Node Exporter as we are going to query Node Exporter metrics in Grafana.
  2. Grafana should be able to access Prometheus server for 9090 port.

Install and Configure Grafana

Centos/Redhat

Ubuntu/debian

Configure Grafana

The default credentials admin/admin as username and password to login. After the first login, you will be prompted to create the new password. Enter the new password and proceed.

Add Prometheus Source to Grafana

In this section of the blog, you will learn how to add Prometheus time series database (TSDB) as the data source to Grafana. Data source is the origin where our data is stored and Grafana can use it to query the required metrics.

Note: Please make sure that you can access the Prometheus endpoint from Grafana server.

Now, data source is set up and we can use it further for querying metrics in dashboards.

Create Dashboards from Prometheus Source

In this section, you learn how to create dashboards where you can visualize and monitor metrics. Dashboards allows you to visualize metrics over a period. You can also modify this time frame according to your requirements and understand the patterns. You can organize these dashboards in different folders categorically. In a dashboard, you can create different types of panels like Graph, Stat, Gauge, Table, Text, Heatmap, Dashboard List, etc.

Also, you can perform many operations to manage and organize your dashboards under different folders based on your needs. You can create new folders or you can move your dashboards under the existing folders.
Integration and Visualization of Prometheus Metrics in Grafana

Importing Predefined Grafana Dashboard Templates

In this section, you will learn how to import predefined templates to your Grafana server. Till now, we have seen how to create dashboards but Grafana provides us flexibility to import templates which are predefined by the Grafana community and you can use them for free. You can also create your own templates and share them in the community which can be used by others. These shared community dashboards can be found from Grafana Shared Templates. To import these templates to your Grafana server is very simple. You can use a dashboard ID or the JSON file as shown below.

Integration and Visualization of Prometheus Metrics in Grafana

The purpose of this blog was to make you familiar with the basic setup of Grafana and integration with Prometheus. But Grafana offers us a lot of options and functionalities to play around like creating alerts, annotations, variables, versioning, and many more. So off course, you can explore more and be familiar with all other options.

If you want to learn more about Prometheus go to our website and check more courses on DevOps.

Please comment if you have any questions.

WRITTEN BY Saurabh Jain

Saurabh Kumar Jain is a Subject Matter Expert working with CloudThat. He has experience in AWS, Microsoft Azure, and DevOps technologies. He is specialized in cloud security and architecture design. He also holds experience on various cloud and DevOps projects based on the cloud maturity model. He is an AWS Certified Security Speciality, AWS Certified Solutions Architect - Associate, Microsoft certified Azure Administrator and a certified Terraform Associate.

SHARE

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!