In the world of data analysis and graphs, we have three important tools: Grafana, PostgreSQL, and Python. They work together to help us look at data and track how it changes over time. In this article, we’ll learn step by step how to use Grafana with a PostgreSQL database. We’ll also discover how to use Python to record data that changes over time. By the end of this article, you’ll know how to set up these tools, and you’ll see how they can be useful for your work with data.
First, we create our table. We also create a sequence for the primary key.
And a simple python script to persists a timeseries.
Now we set up PostgreSQL database and Grafana in a docker-compose.yml.
More information about the configuration of postgresql and grafana here in the links
We run the stack, Connect the grafana at port 3000 and configure the datasource
After that we can create the dashboard
We are using this query
And that’s the dashboard
Proyect available in my github account.