Skip to content

Data visualization in Grafana

With the containers raised, you can access the container containing Grafana through your browser using the following URL:

http://”public_IP_of_yourVM”:3000

To log in you will use the following credentials that are indicated in the “docker-compose.yml” file, which are the following:

User: admin

Password: supersecretpassword

Now you must configure the database from which you want Grafana to read data. To do this, you must access the configuration menu and access the Data Sources section.

Click Add Data Source and select InfluxDB as the database type.

You must give a name to this Data Source (it does not have to be the same as the InfluxDB database) and indicate the URL address of the InfluxDB container.

In the Database field you must enter the name of your database. Make sure that the HTTP Method and Min time Interval fields remain as in the screenshot.

You can validate that Grafana has detected the database by clicking the Save & Test button. A successful result should return the following message:

To view the data written in the InfluxDB database, you must create a Grafana Dashboard:

Click on Add new panel and a panel will open that will be updated with the information you add in the Query tab. Now you must modify the highlighted fields in the screenshot with the name of the InfluxDB measurement series where you have written the data and the variable that contains the numerical values of the measurements.

Once you have done it, in the graphic panel at the top you will be able to visualize the synthetic data that you have generated in Node-RED. You can select a period of time on which to zoom in to better see the data. With this you will have fulfilled the objective set for this first part of the project, good job!

Click Apply in the top right corner of the screen to save the panel changes you've generated. Once done, at the top of the dashboard you also have an option to save the changes to the dashboard.

You must provide a screenshot of the Grafana dashboard where you can clearly see the data that is written in the InfluxDB database. Configure the dashboard so that you can clearly see the behavior of the data.