git clone https://github.com/guedim/grafana-postgres.git
docker-compose up -d
Access http: // localhost: 3000 / from your browser user : admin password: foobar Log in with. (Set in grafana-postgres / grafana / dashboard / post.sh)
Press Add data source to set up postgres The most difficult part is the following setting location. Set the host name to ** postgres: 5432 ** instead of localhost: 5432
After inputting, press ** Save & Test ** and if Database Connection OK appears, the cooperation is completed.
dashboard> table> edit will bring up a screen where you can write sql statements. Since https://github.com/guedim/grafana-postgres.git originally contains data, I displayed that data.
docker-compose exec postgres bash
su postgres
psql
\d #Table list display
\l #View database list
\d account_metrics #Display column list Since it is a column, specify the database
\q #exit
Recommended Posts