Visualize Your Data with Grafana - Step 2

grafana Mar 26, 2020

How to Add Data Source?

In this section, we gonna learn how to add a data source to Grafana. We talked about how to build local Grafana at the previous post. You can click to access previous post, Creating Grafana Environment

Now, let's talk about data sources in Grafana. Grafana provides some data sources that might be a database or store something about data. However, in this article I will show you how to connect Elasticsearch and PostgreSQL data sources.

Add Elasticsearch Data Source

Now, if you have a Elasticsearch data source we can start to add with own connection informations. Please follow these steps:

  1. Open local Grafana and go to left menu and click Data Sources


  1. Click Add data source button on this page.


  1. Okay. Please select Elasticsearch on the list.


  1. Enter your Elasticsearch connection information(At Auth section). I entered my Elasticsearch connection information that is on a live server. You must customize according to yourself.


  1. Now, There is important step to connect. On the Elasticsearch Detail section you must enter your Elastic index name that you want to track. My Elasticsearch index name is "traffic" so I entered it. The other information is Time Field Name. Elasticsearch stream data always has its own time history value. My time field name is executeAt. You must enter your own time field.


  1. Click Save & Test button. And done!


Add PostgreSQL Data Source

  1. Open Data Sources List and select PostgreSQL


  1. Enter your PostgreSQL connection informations and click Save & Test


  1. Done!


After adding own data sources you can check the data sources list on the left menu. You must see two data sources Elastic and Postgre :)

If you have been able to follow these steps, we will continue to creating dashboards and some graphs! Please keep following.


Muhammed Güngör

Full Stack Engineer

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.